Skip to content

Commit 7533aa5

Browse files
authored
Merge pull request #49361 from Expensify/srikar-paymentDisabledBug
2 parents 2c9a980 + e0b8326 commit 7533aa5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/libs/PolicyUtils.ts

+5
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ function isSubmitAndClose(policy: OnyxInputOrEntry<Policy>): boolean {
408408
return policy?.approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL;
409409
}
410410

411+
function arePaymentsEnabled(policy: OnyxEntry<Policy>): boolean {
412+
return policy?.reimbursementChoice !== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO;
413+
}
414+
411415
function isControlOnAdvancedApprovalMode(policy: OnyxInputOrEntry<Policy>): boolean {
412416
return policy?.type === CONST.POLICY.TYPE.CORPORATE && getApprovalWorkflow(policy) === CONST.POLICY.APPROVAL_MODE.ADVANCED;
413417
}
@@ -1058,6 +1062,7 @@ export {
10581062
isPolicyEmployee,
10591063
isPolicyFeatureEnabled,
10601064
isPolicyOwner,
1065+
arePaymentsEnabled,
10611066
isSubmitAndClose,
10621067
isTaxTrackingEnabled,
10631068
shouldShowPolicy,

src/libs/ReportUtils.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,10 @@ function canAddOrDeleteTransactions(moneyRequestReport: OnyxEntry<Report>): bool
16751675
return false;
16761676
}
16771677

1678+
if (PolicyUtils.isInstantSubmitEnabled(policy) && PolicyUtils.isSubmitAndClose(policy) && !PolicyUtils.arePaymentsEnabled(policy)) {
1679+
return false;
1680+
}
1681+
16781682
if (isReportApproved(moneyRequestReport) || isSettled(moneyRequestReport?.reportID)) {
16791683
return false;
16801684
}

0 commit comments

Comments
 (0)