diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index ddcf1c0298b7..1951b57d2954 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -413,6 +413,10 @@ function isSubmitAndClose(policy: OnyxInputOrEntry): boolean { return policy?.approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL; } +function arePaymentsEnabled(policy: OnyxEntry): boolean { + return policy?.reimbursementChoice !== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO; +} + function isControlOnAdvancedApprovalMode(policy: OnyxInputOrEntry): boolean { return policy?.type === CONST.POLICY.TYPE.CORPORATE && getApprovalWorkflow(policy) === CONST.POLICY.APPROVAL_MODE.ADVANCED; } @@ -1064,6 +1068,7 @@ export { isPolicyEmployee, isPolicyFeatureEnabled, isPolicyOwner, + arePaymentsEnabled, isSubmitAndClose, isTaxTrackingEnabled, shouldShowPolicy, diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index c18b6c41b420..9cef9488fa5e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1701,6 +1701,10 @@ function canAddOrDeleteTransactions(moneyRequestReport: OnyxEntry): bool return false; } + if (PolicyUtils.isInstantSubmitEnabled(policy) && PolicyUtils.isSubmitAndClose(policy) && !PolicyUtils.arePaymentsEnabled(policy)) { + return false; + } + if (isReportApproved(moneyRequestReport) || isSettled(moneyRequestReport?.reportID)) { return false; }