From a6cca8b5cdebbce5bb29fe29f0b9396948aaefe0 Mon Sep 17 00:00:00 2001 From: gijoe0295 Date: Tue, 28 May 2024 02:32:28 +0700 Subject: [PATCH] only show receipt-related notice violations fin receipt audit --- .../ReportActionItem/MoneyRequestView.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 37836580b740..2ee8dd93a1fc 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -319,7 +319,15 @@ function MoneyRequestView({ const shouldShowMapOrReceipt = showMapAsImage || hasReceipt; const shouldShowReceiptEmptyState = !hasReceipt && !isInvoice && (canEditReceipt || isAdmin || isApprover); - const noticeTypeViolations = transactionViolations?.filter((violation) => violation.type === 'notice').map((v) => ViolationsUtils.getViolationTranslation(v, translate)) ?? []; + const receiptNoticeNames: OnyxTypes.ViolationName[] = [ + CONST.VIOLATIONS.RECEIPT_REQUIRED, + CONST.VIOLATIONS.RECEIPT_NOT_SMART_SCANNED, + CONST.VIOLATIONS.MODIFIED_DATE, + CONST.VIOLATIONS.CASH_EXPENSE_WITH_NO_RECEIPT, + CONST.VIOLATIONS.SMARTSCAN_FAILED, + ]; + const receiptNoticeViolations = + transactionViolations?.filter((violation) => receiptNoticeNames.includes(violation.name)).map((v) => ViolationsUtils.getViolationTranslation(v, translate)) ?? []; const shouldShowNotesViolations = !isReceiptBeingScanned && canUseViolations && ReportUtils.isPaidGroupPolicy(report); return ( @@ -328,7 +336,7 @@ function MoneyRequestView({ {!isInvoice && ( )} @@ -383,7 +391,7 @@ function MoneyRequestView({ /> )} {!shouldShowReceiptEmptyState && !shouldShowMapOrReceipt && } - {shouldShowNotesViolations && } + {shouldShowNotesViolations && } {canUseViolations && }