diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 0380780e0ccb..7ed4cd55e97f 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -38,6 +38,7 @@ import * as IOU from '@userActions/IOU'; import * as Transaction from '@userActions/Transaction'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; +import * as ReportActions from '@src/libs/actions/ReportActions'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type * as OnyxTypes from '@src/types/onyx'; @@ -322,6 +323,11 @@ function MoneyRequestView({ const noticeTypeViolations = transactionViolations?.filter((violation) => violation.type === 'notice').map((v) => ViolationsUtils.getViolationTranslation(v, translate)) ?? []; const shouldShowNotesViolations = !isReceiptBeingScanned && canUseViolations && ReportUtils.isPaidGroupPolicy(report); + const errors = { + ...(transaction?.errorFields?.route ?? transaction?.errors), + ...parentReportAction?.errors, + }; + return ( {shouldShowAnimatedBackground && } @@ -332,37 +338,40 @@ function MoneyRequestView({ shouldShowAuditMessage={Boolean(shouldShowNotesViolations && didRceiptScanSucceed)} /> )} - {shouldShowMapOrReceipt && ( + {(shouldShowMapOrReceipt || errors) && ( { if (!transaction?.transactionID) { return; } Transaction.clearError(transaction.transactionID); + ReportActions.clearAllRelatedReportActionErrors(report.reportID, parentReportAction); }} > - - {showMapAsImage ? ( - - ) : ( - - )} - + {shouldShowMapOrReceipt && ( + + {showMapAsImage ? ( + + ) : ( + + )} + + )} )} {shouldShowReceiptEmptyState && (