Skip to content

Prohibited expense violations missing from report preview #89631

@MelvinBot

Description

@MelvinBot

Prohibited expense violations don't appear on report previews in workspace chat. This affects all prohibited expense types, not just the new handwrittenReceipt toggle.

Root cause: mergeProhibitedViolations creates a merged violation object without showInReview: true. The transaction preview calls hasViolation(..., true), which filters out violations missing showInReview: true, so shouldShowRBR is false and the red dot + message are suppressed.

Expected behavior: Prohibited expense violations should show the red brick road (RBR) indicator and violation message on the report preview, just like they do on the individual expense.

Recommended fix: Add showInReview: true to the merged violation object in mergeProhibitedViolations:

const mergedProhibitedViolations: TransactionViolation = {
    name: CONST.VIOLATIONS.PROHIBITED_EXPENSE,
    data: { prohibitedExpenseRule: prohibitedExpenses },
    type: CONST.VIOLATION_TYPES.VIOLATION,
    showInReview: true,  // <-- add this
};

Found in: #87533

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions