From 56387ab8a2a520a45bf08051d5f68a0a2d73f2f6 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sun, 22 Feb 2026 12:08:25 +0800 Subject: [PATCH 1/8] pass billing grace end period data from useOnyx --- src/components/MoneyReportHeader.tsx | 10 ++++--- src/components/ProcessMoneyReportHoldMenu.tsx | 2 ++ .../MoneyRequestReportPreviewContent.tsx | 6 ++-- src/libs/actions/IOU/index.ts | 11 ++++--- tests/actions/IOUTest.ts | 30 ++++++++++++------- 5 files changed, 38 insertions(+), 21 deletions(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index 6582252ebec16..ba7a5d0d76af4 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -615,6 +615,7 @@ function MoneyReportHeader({ activePolicy, policy, betas, + userBillingGraceEndPeriodCollection, }); if (currentSearchQueryJSON && !isOffline) { search({ @@ -649,6 +650,7 @@ function MoneyReportHeader({ shouldCalculateTotals, currentSearchResults?.search?.isLoading, betas, + userBillingGraceEndPeriodCollection, ], ); @@ -674,7 +676,7 @@ function MoneyReportHeader({ showDelegateNoAccessModal(); } else if (!isAnyTransactionOnHold) { startApprovedAnimation(); - approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, true); + approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, userBillingGraceEndPeriodCollection, true); } }; @@ -1024,7 +1026,7 @@ function MoneyReportHeader({ return; } startApprovedAnimation(); - approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, isFullApproval); + approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, userBillingGraceEndPeriodCollection, isFullApproval); if (currentSearchQueryJSON) { search({ searchKey: currentSearchKey, @@ -1050,7 +1052,7 @@ function MoneyReportHeader({ return; } startSubmittingAnimation(); - submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep); + submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, userBillingGraceEndPeriodCollection); if (currentSearchQueryJSON && !isOffline) { search({ searchKey: currentSearchKey, @@ -1322,7 +1324,7 @@ function MoneyReportHeader({ showDWEModal(); return; } - submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep); + submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, userBillingGraceEndPeriodCollection); }, }, [CONST.REPORT.SECONDARY_ACTIONS.APPROVE]: { diff --git a/src/components/ProcessMoneyReportHoldMenu.tsx b/src/components/ProcessMoneyReportHoldMenu.tsx index 9f15da5d0d8a1..4dacc8393ea64 100644 --- a/src/components/ProcessMoneyReportHoldMenu.tsx +++ b/src/components/ProcessMoneyReportHoldMenu.tsx @@ -64,6 +64,7 @@ function ProcessMoneyReportHoldMenu({ // We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to apply the correct modal type // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth const {isSmallScreenWidth} = useResponsiveLayout(); + const [userBillingGraceEndPeriodCollection] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END, {canBeMissing: true}); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true}); const activePolicy = usePolicy(activePolicyID); const policy = usePolicy(moneyRequestReport?.policyID); @@ -94,6 +95,7 @@ function ProcessMoneyReportHoldMenu({ activePolicy, policy, betas, + userBillingGraceEndPeriodCollection, }); } onClose(); diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx index b48907fced4d4..1c69c07114fae 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx @@ -283,6 +283,7 @@ function MoneyRequestReportPreviewContent({ activePolicy, policy, betas, + userBillingGraceEndPeriodCollection, }); } } @@ -327,7 +328,7 @@ function MoneyRequestReportPreviewContent({ showDelegateNoAccessModal(); } else if (!hasHeldExpensesReportUtils(iouReport?.reportID)) { startApprovedAnimation(); - approveMoneyRequest(iouReport, activePolicy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, true); + approveMoneyRequest(iouReport, activePolicy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, userBillingGraceEndPeriodCollection, true); } }; @@ -628,7 +629,7 @@ function MoneyRequestReportPreviewContent({ return; } startSubmittingAnimation(); - submitReport(iouReport, policy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep); + submitReport(iouReport, policy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, userBillingGraceEndPeriodCollection); }} isSubmittingAnimationRunning={isSubmittingAnimationRunning} onAnimationFinish={stopAnimation} @@ -658,6 +659,7 @@ function MoneyRequestReportPreviewContent({ isASAPSubmitBetaEnabled, iouReportNextStep, betas, + userBillingGraceEndPeriodCollection, isFullApproval, ); }} diff --git a/src/libs/actions/IOU/index.ts b/src/libs/actions/IOU/index.ts index d37630cc1b57b..a6b0f1ccca2ca 100644 --- a/src/libs/actions/IOU/index.ts +++ b/src/libs/actions/IOU/index.ts @@ -886,6 +886,7 @@ type PayMoneyRequestFunctionParams = { introSelected: OnyxEntry; iouReportCurrentNextStepDeprecated: OnyxEntry; currentUserAccountID: number; + userBillingGraceEndPeriodCollection: OnyxCollection; paymentPolicyID?: string; full?: boolean; activePolicy?: OnyxEntry; @@ -10527,13 +10528,14 @@ function approveMoneyRequest( isASAPSubmitBetaEnabled: boolean, expenseReportCurrentNextStepDeprecated: OnyxEntry, betas: OnyxEntry, + userBillingGraceEndPeriodCollection: OnyxCollection, full?: boolean, ) { if (!expenseReport) { return; } - if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID)) { + if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID, userBillingGraceEndPeriodCollection)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(expenseReport.policyID)); return; } @@ -11413,11 +11415,12 @@ function submitReport( hasViolations: boolean, isASAPSubmitBetaEnabled: boolean, expenseReportCurrentNextStepDeprecated: OnyxEntry, + userBillingGraceEndPeriodCollection: OnyxCollection, ) { if (!expenseReport) { return; } - if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID)) { + if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID, userBillingGraceEndPeriodCollection)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(expenseReport.policyID)); return; } @@ -11931,8 +11934,8 @@ function completePaymentOnboarding( } function payMoneyRequest(params: PayMoneyRequestFunctionParams) { - const {paymentType, chatReport, iouReport, introSelected, iouReportCurrentNextStepDeprecated, currentUserAccountID, paymentPolicyID, full = true, activePolicy, policy, betas} = params; - if (chatReport.policyID && shouldRestrictUserBillableActions(chatReport.policyID)) { + const {paymentType, chatReport, iouReport, introSelected, iouReportCurrentNextStepDeprecated, currentUserAccountID, paymentPolicyID, userBillingGraceEndPeriodCollection, full = true, activePolicy, policy, betas} = params; + if (chatReport.policyID && shouldRestrictUserBillableActions(chatReport.policyID, userBillingGraceEndPeriodCollection)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(chatReport.policyID)); return; } diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index 080217e179067..00d0892ccf55f 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -6170,6 +6170,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriodCollection: undefined, }); } return waitForBatchedUpdates(); @@ -6370,6 +6371,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriodCollection: undefined, }); } return waitForBatchedUpdates(); @@ -6524,6 +6526,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriodCollection: undefined, }); } return waitForBatchedUpdates(); @@ -6573,6 +6576,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriodCollection: undefined, }); await waitForBatchedUpdates(); @@ -6684,6 +6688,7 @@ describe('actions/IOU', () => { currentUserAccountID: CARLOS_ACCOUNT_ID, full: false, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriodCollection: undefined, }); return waitForBatchedUpdates(); }) @@ -6776,6 +6781,7 @@ describe('actions/IOU', () => { full: false, policy, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriodCollection: undefined, }); await waitForBatchedUpdates(); const newExpenseReport = await getOnyxValue(`${ONYXKEYS.COLLECTION.REPORT}${newExpenseReportID}`); @@ -6874,6 +6880,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriodCollection: undefined, }); } return waitForBatchedUpdates(); @@ -8836,7 +8843,7 @@ describe('actions/IOU', () => { .then(async () => { if (expenseReport) { const nextStep = await getOnyxValue(`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`); - submitReport(expenseReport, {} as Policy, CARLOS_ACCOUNT_ID, CARLOS_EMAIL, true, true, nextStep); + submitReport(expenseReport, {} as Policy, CARLOS_ACCOUNT_ID, CARLOS_EMAIL, true, true, nextStep, undefined); } return waitForBatchedUpdates(); }) @@ -9112,7 +9119,7 @@ describe('actions/IOU', () => { .then(async () => { if (expenseReport) { const nextStep = await getOnyxValue(`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`); - submitReport(expenseReport, policy, CARLOS_ACCOUNT_ID, CARLOS_EMAIL, true, true, nextStep); + submitReport(expenseReport, policy, CARLOS_ACCOUNT_ID, CARLOS_EMAIL, true, true, nextStep, undefined); } return waitForBatchedUpdates(); }) @@ -9362,7 +9369,7 @@ describe('actions/IOU', () => { mockFetch?.fail?.(); if (expenseReport) { const nextStep = await getOnyxValue(`${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`); - submitReport(expenseReport, {} as Policy, CARLOS_ACCOUNT_ID, CARLOS_EMAIL, true, true, nextStep); + submitReport(expenseReport, {} as Policy, CARLOS_ACCOUNT_ID, CARLOS_EMAIL, true, true, nextStep, undefined); } return waitForBatchedUpdates(); }) @@ -11199,6 +11206,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriodCollection: undefined, }); } await waitForBatchedUpdates(); @@ -13216,7 +13224,7 @@ describe('actions/IOU', () => { }); // Admin approves the report - approveMoneyRequest(expenseReport, policy, adminAccountID, adminEmail, false, false, undefined, [CONST.BETAS.ALL]); + approveMoneyRequest(expenseReport, policy, adminAccountID, adminEmail, false, false, undefined, [CONST.BETAS.ALL], undefined); await waitForBatchedUpdates(); // Should be approved since admin took control and is the last approver @@ -13254,7 +13262,7 @@ describe('actions/IOU', () => { }); // Manager approves the report - approveMoneyRequest(expenseReport, policy, managerAccountID, managerEmail, false, false, undefined, [CONST.BETAS.ALL]); + approveMoneyRequest(expenseReport, policy, managerAccountID, managerEmail, false, false, undefined, [CONST.BETAS.ALL], undefined); await waitForBatchedUpdates(); // Should be submitted to senior manager (normal flow) since take control was invalidated @@ -13288,7 +13296,7 @@ describe('actions/IOU', () => { }); // Admin approves the report - approveMoneyRequest(expenseReport, policy, adminAccountID, adminEmail, false, false, undefined, [CONST.BETAS.ALL]); + approveMoneyRequest(expenseReport, policy, adminAccountID, adminEmail, false, false, undefined, [CONST.BETAS.ALL], undefined); await waitForBatchedUpdates(); // Get the optimistic next step @@ -13398,7 +13406,7 @@ describe('actions/IOU', () => { }); // Manager approves the report (no take control actions) - approveMoneyRequest(expenseReport, policy, managerAccountID, managerEmail, false, false, undefined, [CONST.BETAS.ALL]); + approveMoneyRequest(expenseReport, policy, managerAccountID, managerEmail, false, false, undefined, [CONST.BETAS.ALL], undefined); await waitForBatchedUpdates(); // Should be submitted to admin (next in approval chain) since manager is not the final approver @@ -13415,7 +13423,7 @@ describe('actions/IOU', () => { accountID: managerAccountID, }); - approveMoneyRequest(expenseReport, policy, managerAccountID, managerEmail, false, false, undefined, [CONST.BETAS.ALL]); + approveMoneyRequest(expenseReport, policy, managerAccountID, managerEmail, false, false, undefined, [CONST.BETAS.ALL], undefined); await waitForBatchedUpdates(); // Should be submitted to admin @@ -13430,7 +13438,7 @@ describe('actions/IOU', () => { accountID: adminAccountID, }); - approveMoneyRequest(updatedReport, policy, adminAccountID, adminEmail, false, false, undefined, [CONST.BETAS.ALL]); + approveMoneyRequest(updatedReport, policy, adminAccountID, adminEmail, false, false, undefined, [CONST.BETAS.ALL], undefined); await waitForBatchedUpdates(); // Should be fully approved @@ -13475,7 +13483,7 @@ describe('actions/IOU', () => { }); // Manager approves the report - approveMoneyRequest(singleApproverReport, singleApproverPolicy, managerAccountID, managerEmail, false, false, undefined, [CONST.BETAS.ALL]); + approveMoneyRequest(singleApproverReport, singleApproverPolicy, managerAccountID, managerEmail, false, false, undefined, [CONST.BETAS.ALL], undefined); await waitForBatchedUpdates(); // Should be fully approved since manager is the final approver in the chain @@ -13576,7 +13584,7 @@ describe('actions/IOU', () => { accountID: adminAccountID, }); - const newExpenseReportID = approveMoneyRequest(expenseReport, policy, adminAccountID, adminEmail, false, false, undefined, [CONST.BETAS.ALL], false); + const newExpenseReportID = approveMoneyRequest(expenseReport, policy, adminAccountID, adminEmail, false, false, undefined, [CONST.BETAS.ALL], undefined, false); await waitForBatchedUpdates(); const newExpenseReport = await getOnyxValue(`${ONYXKEYS.COLLECTION.REPORT}${newExpenseReportID}`); From 1c5816354c84a5a1a22ee46fb05e6bac41030ada Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sun, 22 Feb 2026 12:18:24 +0800 Subject: [PATCH 2/8] prettier & missing param --- .../MoneyRequestReportPreviewContent.tsx | 13 ++++++++++++- src/components/SettlementButton/index.tsx | 4 ++-- src/libs/actions/IOU/index.ts | 15 ++++++++++++++- tests/actions/IOUTest.ts | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx index 1c69c07114fae..c124840ca07c2 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx @@ -328,7 +328,18 @@ function MoneyRequestReportPreviewContent({ showDelegateNoAccessModal(); } else if (!hasHeldExpensesReportUtils(iouReport?.reportID)) { startApprovedAnimation(); - approveMoneyRequest(iouReport, activePolicy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, userBillingGraceEndPeriodCollection, true); + approveMoneyRequest( + iouReport, + activePolicy, + currentUserAccountID, + currentUserEmail, + hasViolations, + isASAPSubmitBetaEnabled, + iouReportNextStep, + betas, + userBillingGraceEndPeriodCollection, + true, + ); } }; diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx index 187afb92e4d65..3e46aac09a8b5 100644 --- a/src/components/SettlementButton/index.tsx +++ b/src/components/SettlementButton/index.tsx @@ -108,7 +108,7 @@ function SettlementButton({ const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || CONST.DEFAULT_NUMBER_ID}`, {canBeMissing: true}); const [conciergeReportID = ''] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID, {canBeMissing: true}); const [iouReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${iouReport?.reportID}`, {canBeMissing: true}); - + const [userBillingGraceEndPeriodCollection] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END, {canBeMissing: true}); const [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isUserValidatedSelector, canBeMissing: true}); const policyEmployeeAccountIDs = getPolicyEmployeeAccountIDs(policy, accountID); const reportBelongsToWorkspace = policyID ? doesReportBelongToWorkspace(chatReport, policyEmployeeAccountIDs, policyID, conciergeReportID) : false; @@ -464,7 +464,7 @@ function SettlementButton({ if (confirmApproval) { confirmApproval(); } else { - approveMoneyRequest(iouReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, false); + approveMoneyRequest(iouReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, userBillingGraceEndPeriodCollection, false); } return; } diff --git a/src/libs/actions/IOU/index.ts b/src/libs/actions/IOU/index.ts index a6b0f1ccca2ca..2045d0ac39e11 100644 --- a/src/libs/actions/IOU/index.ts +++ b/src/libs/actions/IOU/index.ts @@ -11934,7 +11934,20 @@ function completePaymentOnboarding( } function payMoneyRequest(params: PayMoneyRequestFunctionParams) { - const {paymentType, chatReport, iouReport, introSelected, iouReportCurrentNextStepDeprecated, currentUserAccountID, paymentPolicyID, userBillingGraceEndPeriodCollection, full = true, activePolicy, policy, betas} = params; + const { + paymentType, + chatReport, + iouReport, + introSelected, + iouReportCurrentNextStepDeprecated, + currentUserAccountID, + paymentPolicyID, + userBillingGraceEndPeriodCollection, + full = true, + activePolicy, + policy, + betas, + } = params; if (chatReport.policyID && shouldRestrictUserBillableActions(chatReport.policyID, userBillingGraceEndPeriodCollection)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(chatReport.policyID)); return; diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index 00d0892ccf55f..0a128074d2e97 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -9521,7 +9521,7 @@ describe('actions/IOU', () => { ) .then(() => { if (expenseReport) { - submitReport(expenseReport, policy, CARLOS_ACCOUNT_ID, CARLOS_EMAIL, true, true, undefined); + submitReport(expenseReport, policy, CARLOS_ACCOUNT_ID, CARLOS_EMAIL, true, true, undefined, undefined); } return waitForBatchedUpdates(); }) From 809164e26276c88fe85ef6959c901571175dda3d Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sun, 22 Feb 2026 12:22:53 +0800 Subject: [PATCH 3/8] missing param --- src/components/MoneyReportHeader.tsx | 1 + src/libs/PaymentUtils.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index ba7a5d0d76af4..3055d7152292e 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -1825,6 +1825,7 @@ function MoneyReportHeader({ iouReport: moneyRequestReport, iouReportNextStep: nextStep, betas, + userBillingGraceEndPeriodCollection, }); const showNextStepBar = shouldShowNextStep && !!(optimisticNextStep?.message?.length ?? (optimisticNextStep && 'messageKey' in optimisticNextStep)); diff --git a/src/libs/PaymentUtils.ts b/src/libs/PaymentUtils.ts index c0261e6a74b5d..1f9c8462500c1 100644 --- a/src/libs/PaymentUtils.ts +++ b/src/libs/PaymentUtils.ts @@ -42,6 +42,7 @@ type SelectPaymentTypeParams = { iouReport?: OnyxEntry; iouReportNextStep: OnyxEntry; betas: OnyxEntry; + userBillingGraceEndPeriodCollection: OnyxCollection; }; /** @@ -178,8 +179,9 @@ const selectPaymentType = (params: SelectPaymentTypeParams) => { iouReport, iouReportNextStep, betas, + userBillingGraceEndPeriodCollection, } = params; - if (policy && shouldRestrictUserBillableActions(policy.id)) { + if (policy && shouldRestrictUserBillableActions(policy.id, userBillingGraceEndPeriodCollection)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policy.id)); return; } @@ -197,7 +199,7 @@ const selectPaymentType = (params: SelectPaymentTypeParams) => { if (confirmApproval) { confirmApproval(); } else { - approveMoneyRequest(iouReport, policy, currentAccountID, currentEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, true); + approveMoneyRequest(iouReport, policy, currentAccountID, currentEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, userBillingGraceEndPeriodCollection, true); } return; } From f35f9f5804b80122e543fcab6595ecfd19958bcb Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sun, 22 Feb 2026 12:24:19 +0800 Subject: [PATCH 4/8] prettier --- src/libs/PaymentUtils.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libs/PaymentUtils.ts b/src/libs/PaymentUtils.ts index 1f9c8462500c1..59483deec7f66 100644 --- a/src/libs/PaymentUtils.ts +++ b/src/libs/PaymentUtils.ts @@ -199,7 +199,18 @@ const selectPaymentType = (params: SelectPaymentTypeParams) => { if (confirmApproval) { confirmApproval(); } else { - approveMoneyRequest(iouReport, policy, currentAccountID, currentEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, userBillingGraceEndPeriodCollection, true); + approveMoneyRequest( + iouReport, + policy, + currentAccountID, + currentEmail, + hasViolations, + isASAPSubmitBetaEnabled, + iouReportNextStep, + betas, + userBillingGraceEndPeriodCollection, + true, + ); } return; } From 9c0b2eca513fd17341a0aa2e146fe01501cf8598 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sun, 22 Feb 2026 12:31:25 +0800 Subject: [PATCH 5/8] lint --- .../MoneyRequestReportPreviewContent.tsx | 1 + src/libs/PaymentUtils.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx index c124840ca07c2..d93e1f3f0f817 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx @@ -302,6 +302,7 @@ function MoneyRequestReportPreviewContent({ activePolicy, policy, betas, + userBillingGraceEndPeriodCollection, ], ); diff --git a/src/libs/PaymentUtils.ts b/src/libs/PaymentUtils.ts index 59483deec7f66..87ae9fd68547e 100644 --- a/src/libs/PaymentUtils.ts +++ b/src/libs/PaymentUtils.ts @@ -1,6 +1,6 @@ import isEmpty from 'lodash/isEmpty'; import type {GestureResponderEvent} from 'react-native'; -import type {OnyxEntry} from 'react-native-onyx'; +import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; import type {Merge, ValueOf} from 'type-fest'; import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types'; import getBankIcon from '@components/Icon/BankIcons'; @@ -11,7 +11,7 @@ import type {BankAccountMenuItem} from '@components/Search/types'; import type {ThemeStyles} from '@styles/index'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -import type {Beta, Policy, Report, ReportNextStepDeprecated} from '@src/types/onyx'; +import type {Beta, BillingGraceEndPeriod, Policy, Report, ReportNextStepDeprecated} from '@src/types/onyx'; import type BankAccount from '@src/types/onyx/BankAccount'; import type Fund from '@src/types/onyx/Fund'; import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage'; From a39e0d608970887458777f019f96f14edf2d711c Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 26 Feb 2026 13:36:04 +0800 Subject: [PATCH 6/8] rename --- src/components/MoneyReportHeader.tsx | 22 +++++++++---------- src/components/ProcessMoneyReportHoldMenu.tsx | 4 ++-- .../MoneyRequestReportPreviewContent.tsx | 16 +++++++------- src/components/SettlementButton/index.tsx | 4 ++-- src/libs/PaymentUtils.ts | 8 +++---- src/libs/actions/IOU/index.ts | 14 ++++++------ tests/actions/IOUTest.ts | 16 +++++++------- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index 03bfa318e8fb8..3305aa182b76e 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -213,7 +213,7 @@ function MoneyReportHeader({ const {login: currentUserLogin, accountID, email} = useCurrentUserPersonalDetails(); const defaultExpensePolicy = useDefaultExpensePolicy(); const activePolicyExpenseChat = getPolicyExpenseChat(accountID, defaultExpensePolicy?.id); - const [userBillingGraceEndPeriodCollection] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); + const [userBillingGraceEndPeriods] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${moneyRequestReport?.chatReportID}`); const [nextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${moneyRequestReport?.reportID}`); const [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isUserValidatedSelector}); @@ -613,7 +613,7 @@ function MoneyReportHeader({ activePolicy, policy, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, }); if (currentSearchQueryJSON && !isOffline) { search({ @@ -648,7 +648,7 @@ function MoneyReportHeader({ shouldCalculateTotals, currentSearchResults?.search?.isLoading, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, ], ); @@ -674,7 +674,7 @@ function MoneyReportHeader({ showDelegateNoAccessModal(); } else if (!isAnyTransactionOnHold) { startApprovedAnimation(); - approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, userBillingGraceEndPeriodCollection, true); + approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, userBillingGraceEndPeriods, true); } }; @@ -921,8 +921,8 @@ function MoneyReportHeader({ const addExpenseDropdownOptions = useMemo( () => - getAddExpenseDropdownOptions(translate, expensifyIcons, moneyRequestReport?.reportID, policy, userBillingGraceEndPeriodCollection, undefined, undefined, lastDistanceExpenseType), - [moneyRequestReport?.reportID, policy, userBillingGraceEndPeriodCollection, lastDistanceExpenseType, expensifyIcons, translate], + getAddExpenseDropdownOptions(translate, expensifyIcons, moneyRequestReport?.reportID, policy, userBillingGraceEndPeriods, undefined, undefined, lastDistanceExpenseType), + [moneyRequestReport?.reportID, policy, userBillingGraceEndPeriods, lastDistanceExpenseType, expensifyIcons, translate], ); const exportSubmenuOptions: Record> = useMemo(() => { @@ -1024,7 +1024,7 @@ function MoneyReportHeader({ return; } startApprovedAnimation(); - approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, userBillingGraceEndPeriodCollection, isFullApproval); + approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, userBillingGraceEndPeriods, isFullApproval); if (currentSearchQueryJSON) { search({ searchKey: currentSearchKey, @@ -1050,7 +1050,7 @@ function MoneyReportHeader({ return; } startSubmittingAnimation(); - submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, userBillingGraceEndPeriodCollection); + submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, userBillingGraceEndPeriods); if (currentSearchQueryJSON && !isOffline) { search({ searchKey: currentSearchKey, @@ -1322,7 +1322,7 @@ function MoneyReportHeader({ showDWEModal(); return; } - submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, userBillingGraceEndPeriodCollection); + submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, userBillingGraceEndPeriods); }, }, [CONST.REPORT.SECONDARY_ACTIONS.APPROVE]: { @@ -1660,7 +1660,7 @@ function MoneyReportHeader({ if (!moneyRequestReport?.reportID) { return; } - if (policy && shouldRestrictUserBillableActions(policy.id, userBillingGraceEndPeriodCollection)) { + if (policy && shouldRestrictUserBillableActions(policy.id, userBillingGraceEndPeriods)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policy.id)); return; } @@ -1823,7 +1823,7 @@ function MoneyReportHeader({ iouReport: moneyRequestReport, iouReportNextStep: nextStep, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, }); const showNextStepBar = shouldShowNextStep && !!(optimisticNextStep?.message?.length ?? (optimisticNextStep && 'messageKey' in optimisticNextStep)); diff --git a/src/components/ProcessMoneyReportHoldMenu.tsx b/src/components/ProcessMoneyReportHoldMenu.tsx index 03e68ae876a2b..c30727e26a33c 100644 --- a/src/components/ProcessMoneyReportHoldMenu.tsx +++ b/src/components/ProcessMoneyReportHoldMenu.tsx @@ -64,7 +64,7 @@ function ProcessMoneyReportHoldMenu({ // We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to apply the correct modal type // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth const {isSmallScreenWidth} = useResponsiveLayout(); - const [userBillingGraceEndPeriodCollection] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); + const [userBillingGraceEndPeriods] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const activePolicy = usePolicy(activePolicyID); const policy = usePolicy(moneyRequestReport?.policyID); @@ -95,7 +95,7 @@ function ProcessMoneyReportHoldMenu({ activePolicy, policy, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, }); } onClose(); diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx index 93c9eba2cb146..f2bb31e490881 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx @@ -131,7 +131,7 @@ function MoneyRequestReportPreviewContent({ onPress, forwardedFSClass, }: MoneyRequestReportPreviewContentProps) { - const [userBillingGraceEndPeriodCollection] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); + const [userBillingGraceEndPeriods] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); const [chatReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${chatReportID}`, {allowStaleData: true}); const [iouReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${iouReportID}`); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); @@ -283,7 +283,7 @@ function MoneyRequestReportPreviewContent({ activePolicy, policy, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, }); } } @@ -302,7 +302,7 @@ function MoneyRequestReportPreviewContent({ activePolicy, policy, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, ], ); @@ -338,7 +338,7 @@ function MoneyRequestReportPreviewContent({ isASAPSubmitBetaEnabled, iouReportNextStep, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, true, ); } @@ -619,12 +619,12 @@ function MoneyRequestReportPreviewContent({ expensifyIcons, iouReport?.reportID, policy, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, chatReportID, iouReport?.parentReportID, lastDistanceExpenseType, ), - [translate, expensifyIcons, iouReport?.reportID, iouReport?.parentReportID, policy, userBillingGraceEndPeriodCollection, chatReportID, lastDistanceExpenseType], + [translate, expensifyIcons, iouReport?.reportID, iouReport?.parentReportID, policy, userBillingGraceEndPeriods, chatReportID, lastDistanceExpenseType], ); const isReportDeleted = action?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; @@ -641,7 +641,7 @@ function MoneyRequestReportPreviewContent({ return; } startSubmittingAnimation(); - submitReport(iouReport, policy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, userBillingGraceEndPeriodCollection); + submitReport(iouReport, policy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, userBillingGraceEndPeriods); }} isSubmittingAnimationRunning={isSubmittingAnimationRunning} onAnimationFinish={stopAnimation} @@ -671,7 +671,7 @@ function MoneyRequestReportPreviewContent({ isASAPSubmitBetaEnabled, iouReportNextStep, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, isFullApproval, ); }} diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx index 17b3232112b54..0b9ef01104643 100644 --- a/src/components/SettlementButton/index.tsx +++ b/src/components/SettlementButton/index.tsx @@ -108,7 +108,7 @@ function SettlementButton({ const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || CONST.DEFAULT_NUMBER_ID}`); const [conciergeReportID = ''] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); const [iouReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${iouReport?.reportID}`); - const [userBillingGraceEndPeriodCollection] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); + const [userBillingGraceEndPeriods] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); const [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isUserValidatedSelector}); const policyEmployeeAccountIDs = getPolicyEmployeeAccountIDs(policy, accountID); const reportBelongsToWorkspace = policyID ? doesReportBelongToWorkspace(chatReport, policyEmployeeAccountIDs, policyID, conciergeReportID) : false; @@ -464,7 +464,7 @@ function SettlementButton({ if (confirmApproval) { confirmApproval(); } else { - approveMoneyRequest(iouReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, userBillingGraceEndPeriodCollection, false); + approveMoneyRequest(iouReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, userBillingGraceEndPeriods, false); } return; } diff --git a/src/libs/PaymentUtils.ts b/src/libs/PaymentUtils.ts index 87ae9fd68547e..f9ddc7ce84c34 100644 --- a/src/libs/PaymentUtils.ts +++ b/src/libs/PaymentUtils.ts @@ -42,7 +42,7 @@ type SelectPaymentTypeParams = { iouReport?: OnyxEntry; iouReportNextStep: OnyxEntry; betas: OnyxEntry; - userBillingGraceEndPeriodCollection: OnyxCollection; + userBillingGraceEndPeriods: OnyxCollection; }; /** @@ -179,9 +179,9 @@ const selectPaymentType = (params: SelectPaymentTypeParams) => { iouReport, iouReportNextStep, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, } = params; - if (policy && shouldRestrictUserBillableActions(policy.id, userBillingGraceEndPeriodCollection)) { + if (policy && shouldRestrictUserBillableActions(policy.id, userBillingGraceEndPeriods)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policy.id)); return; } @@ -208,7 +208,7 @@ const selectPaymentType = (params: SelectPaymentTypeParams) => { isASAPSubmitBetaEnabled, iouReportNextStep, betas, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, true, ); } diff --git a/src/libs/actions/IOU/index.ts b/src/libs/actions/IOU/index.ts index 08580e884d069..2a559c66f3361 100644 --- a/src/libs/actions/IOU/index.ts +++ b/src/libs/actions/IOU/index.ts @@ -886,7 +886,7 @@ type PayMoneyRequestFunctionParams = { introSelected: OnyxEntry; iouReportCurrentNextStepDeprecated: OnyxEntry; currentUserAccountID: number; - userBillingGraceEndPeriodCollection: OnyxCollection; + userBillingGraceEndPeriods: OnyxCollection; paymentPolicyID?: string; full?: boolean; activePolicy?: OnyxEntry; @@ -10535,14 +10535,14 @@ function approveMoneyRequest( isASAPSubmitBetaEnabled: boolean, expenseReportCurrentNextStepDeprecated: OnyxEntry, betas: OnyxEntry, - userBillingGraceEndPeriodCollection: OnyxCollection, + userBillingGraceEndPeriods: OnyxCollection, full?: boolean, ) { if (!expenseReport) { return; } - if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID, userBillingGraceEndPeriodCollection)) { + if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID, userBillingGraceEndPeriods)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(expenseReport.policyID)); return; } @@ -11422,12 +11422,12 @@ function submitReport( hasViolations: boolean, isASAPSubmitBetaEnabled: boolean, expenseReportCurrentNextStepDeprecated: OnyxEntry, - userBillingGraceEndPeriodCollection: OnyxCollection, + userBillingGraceEndPeriods: OnyxCollection, ) { if (!expenseReport) { return; } - if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID, userBillingGraceEndPeriodCollection)) { + if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID, userBillingGraceEndPeriods)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(expenseReport.policyID)); return; } @@ -11949,13 +11949,13 @@ function payMoneyRequest(params: PayMoneyRequestFunctionParams) { iouReportCurrentNextStepDeprecated, currentUserAccountID, paymentPolicyID, - userBillingGraceEndPeriodCollection, + userBillingGraceEndPeriods, full = true, activePolicy, policy, betas, } = params; - if (chatReport.policyID && shouldRestrictUserBillableActions(chatReport.policyID, userBillingGraceEndPeriodCollection)) { + if (chatReport.policyID && shouldRestrictUserBillableActions(chatReport.policyID, userBillingGraceEndPeriods)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(chatReport.policyID)); return; } diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index 5e67dbbfad71d..c68a26ef3c359 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -6170,7 +6170,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID, betas: [CONST.BETAS.ALL], - userBillingGraceEndPeriodCollection: undefined, + userBillingGraceEndPeriods: undefined, }); } return waitForBatchedUpdates(); @@ -6371,7 +6371,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], - userBillingGraceEndPeriodCollection: undefined, + userBillingGraceEndPeriods: undefined, }); } return waitForBatchedUpdates(); @@ -6526,7 +6526,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], - userBillingGraceEndPeriodCollection: undefined, + userBillingGraceEndPeriods: undefined, }); } return waitForBatchedUpdates(); @@ -6576,7 +6576,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], - userBillingGraceEndPeriodCollection: undefined, + userBillingGraceEndPeriods: undefined, }); await waitForBatchedUpdates(); @@ -6688,7 +6688,7 @@ describe('actions/IOU', () => { currentUserAccountID: CARLOS_ACCOUNT_ID, full: false, betas: [CONST.BETAS.ALL], - userBillingGraceEndPeriodCollection: undefined, + userBillingGraceEndPeriods: undefined, }); return waitForBatchedUpdates(); }) @@ -6781,7 +6781,7 @@ describe('actions/IOU', () => { full: false, policy, betas: [CONST.BETAS.ALL], - userBillingGraceEndPeriodCollection: undefined, + userBillingGraceEndPeriods: undefined, }); await waitForBatchedUpdates(); const newExpenseReport = await getOnyxValue(`${ONYXKEYS.COLLECTION.REPORT}${newExpenseReportID}`); @@ -6880,7 +6880,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], - userBillingGraceEndPeriodCollection: undefined, + userBillingGraceEndPeriods: undefined, }); } return waitForBatchedUpdates(); @@ -11206,7 +11206,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], - userBillingGraceEndPeriodCollection: undefined, + userBillingGraceEndPeriods: undefined, }); } await waitForBatchedUpdates(); From f1dca8d07d5342464e38992a664cd133376f1d70 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 2 Mar 2026 17:25:46 +0800 Subject: [PATCH 7/8] remove dupe var --- src/components/SettlementButton/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx index 1415b29b889bb..e83b267e05b7d 100644 --- a/src/components/SettlementButton/index.tsx +++ b/src/components/SettlementButton/index.tsx @@ -109,7 +109,6 @@ function SettlementButton({ const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || CONST.DEFAULT_NUMBER_ID}`); const [conciergeReportID = ''] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); const [iouReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${iouReport?.reportID}`); - const [userBillingGraceEndPeriods] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); const [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isUserValidatedSelector}); const policyEmployeeAccountIDs = getPolicyEmployeeAccountIDs(policy, accountID); const reportBelongsToWorkspace = policyID ? doesReportBelongToWorkspace(chatReport, policyEmployeeAccountIDs, policyID, conciergeReportID) : false; From f1d2997ede416d7e2bc0de05089e2900088e0dc6 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 2 Mar 2026 17:27:51 +0800 Subject: [PATCH 8/8] lint --- src/components/MoneyReportHeader.tsx | 3 +-- src/components/ProcessMoneyReportHoldMenu.tsx | 1 + src/libs/PaymentUtils.ts | 13 +------------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index d4aff9432f5f6..1dd9ba0f516bd 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -940,8 +940,7 @@ function MoneyReportHeader({ }); const addExpenseDropdownOptions = useMemo( - () => - getAddExpenseDropdownOptions(translate, expensifyIcons, moneyRequestReport?.reportID, policy, userBillingGraceEndPeriods, undefined, undefined, lastDistanceExpenseType), + () => getAddExpenseDropdownOptions(translate, expensifyIcons, moneyRequestReport?.reportID, policy, userBillingGraceEndPeriods, undefined, undefined, lastDistanceExpenseType), [moneyRequestReport?.reportID, policy, userBillingGraceEndPeriods, lastDistanceExpenseType, expensifyIcons, translate], ); diff --git a/src/components/ProcessMoneyReportHoldMenu.tsx b/src/components/ProcessMoneyReportHoldMenu.tsx index 8b1cc9854dc9e..ea8f986e5cc63 100644 --- a/src/components/ProcessMoneyReportHoldMenu.tsx +++ b/src/components/ProcessMoneyReportHoldMenu.tsx @@ -105,6 +105,7 @@ function ProcessMoneyReportHoldMenu({ isASAPSubmitBetaEnabled, moneyRequestReportNextStep, betas, + userBillingGraceEndPeriods, full, ); } else if (chatReport && paymentType) { diff --git a/src/libs/PaymentUtils.ts b/src/libs/PaymentUtils.ts index f9ddc7ce84c34..4c752788238cb 100644 --- a/src/libs/PaymentUtils.ts +++ b/src/libs/PaymentUtils.ts @@ -199,18 +199,7 @@ const selectPaymentType = (params: SelectPaymentTypeParams) => { if (confirmApproval) { confirmApproval(); } else { - approveMoneyRequest( - iouReport, - policy, - currentAccountID, - currentEmail, - hasViolations, - isASAPSubmitBetaEnabled, - iouReportNextStep, - betas, - userBillingGraceEndPeriods, - true, - ); + approveMoneyRequest(iouReport, policy, currentAccountID, currentEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, userBillingGraceEndPeriods, true); } return; }