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
Prohibited expense violations don't appear on report previews in workspace chat. This affects all prohibited expense types, not just the new
handwrittenReceipttoggle.Root cause:
mergeProhibitedViolationscreates a merged violation object withoutshowInReview: true. The transaction preview callshasViolation(..., true), which filters out violations missingshowInReview: true, soshouldShowRBRis 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: trueto the merged violation object inmergeProhibitedViolations:Found in: #87533