diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index f4a258b9d6f81..1dd9ba0f516bd 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -217,7 +217,7 @@ function MoneyReportHeader({ const personalDetails = usePersonalDetails(); 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}); @@ -623,6 +623,7 @@ function MoneyReportHeader({ activePolicy, policy, betas, + userBillingGraceEndPeriods, }); if (currentSearchQueryJSON && !isOffline) { search({ @@ -657,6 +658,7 @@ function MoneyReportHeader({ shouldCalculateTotals, currentSearchResults?.search?.isLoading, betas, + userBillingGraceEndPeriods, ], ); @@ -685,7 +687,7 @@ function MoneyReportHeader({ setIsHoldMenuVisible(true); } else { startApprovedAnimation(); - approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, true); + approveMoneyRequest(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, betas, userBillingGraceEndPeriods, true); } }; @@ -938,9 +940,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(() => { @@ -1050,7 +1051,7 @@ function MoneyReportHeader({ return; } startSubmittingAnimation(); - submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep); + submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, userBillingGraceEndPeriods); if (currentSearchQueryJSON && !isOffline) { search({ searchKey: currentSearchKey, @@ -1304,7 +1305,7 @@ function MoneyReportHeader({ showDWEModal(); return; } - submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep); + submitReport(moneyRequestReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep, userBillingGraceEndPeriods); }, }, [CONST.REPORT.SECONDARY_ACTIONS.APPROVE]: { @@ -1646,7 +1647,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; } @@ -1813,6 +1814,7 @@ function MoneyReportHeader({ iouReport: moneyRequestReport, iouReportNextStep: nextStep, betas, + userBillingGraceEndPeriods, }); const showNextStepBar = shouldShowNextStep && !!(optimisticNextStep?.message?.length ?? (optimisticNextStep && 'messageKey' in optimisticNextStep)); diff --git a/src/components/ProcessMoneyReportHoldMenu.tsx b/src/components/ProcessMoneyReportHoldMenu.tsx index c0f213484fde8..ea8f986e5cc63 100644 --- a/src/components/ProcessMoneyReportHoldMenu.tsx +++ b/src/components/ProcessMoneyReportHoldMenu.tsx @@ -71,6 +71,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 [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); @@ -104,6 +105,7 @@ function ProcessMoneyReportHoldMenu({ isASAPSubmitBetaEnabled, moneyRequestReportNextStep, betas, + userBillingGraceEndPeriods, full, ); } else if (chatReport && paymentType) { @@ -121,6 +123,7 @@ function ProcessMoneyReportHoldMenu({ activePolicy, policy, betas, + userBillingGraceEndPeriods, }); } onClose(); diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx index 17e402d64dbdd..d5cdcfad8f5f4 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx @@ -132,7 +132,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); @@ -287,6 +287,7 @@ function MoneyRequestReportPreviewContent({ activePolicy, policy, betas, + userBillingGraceEndPeriods, }); } } @@ -305,6 +306,7 @@ function MoneyRequestReportPreviewContent({ activePolicy, policy, betas, + userBillingGraceEndPeriods, ], ); @@ -334,7 +336,18 @@ function MoneyRequestReportPreviewContent({ setIsHoldMenuVisible(true); } else { startApprovedAnimation(); - approveMoneyRequest(iouReport, activePolicy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, betas, true); + approveMoneyRequest( + iouReport, + activePolicy, + currentUserAccountID, + currentUserEmail, + hasViolations, + isASAPSubmitBetaEnabled, + iouReportNextStep, + betas, + userBillingGraceEndPeriods, + true, + ); } }; @@ -640,12 +653,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; @@ -662,7 +675,7 @@ function MoneyRequestReportPreviewContent({ return; } startSubmittingAnimation(); - submitReport(iouReport, policy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep); + submitReport(iouReport, policy, currentUserAccountID, currentUserEmail, hasViolations, isASAPSubmitBetaEnabled, iouReportNextStep, userBillingGraceEndPeriods); }} isSubmittingAnimationRunning={isSubmittingAnimationRunning} onAnimationFinish={stopAnimation} diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx index f0f72f187882d..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 [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isUserValidatedSelector}); const policyEmployeeAccountIDs = getPolicyEmployeeAccountIDs(policy, accountID); const reportBelongsToWorkspace = policyID ? doesReportBelongToWorkspace(chatReport, policyEmployeeAccountIDs, policyID, conciergeReportID) : false; @@ -470,7 +469,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, userBillingGraceEndPeriods, false); } return; } diff --git a/src/libs/PaymentUtils.ts b/src/libs/PaymentUtils.ts index c0261e6a74b5d..4c752788238cb 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'; @@ -42,6 +42,7 @@ type SelectPaymentTypeParams = { iouReport?: OnyxEntry; iouReportNextStep: OnyxEntry; betas: OnyxEntry; + userBillingGraceEndPeriods: OnyxCollection; }; /** @@ -178,8 +179,9 @@ const selectPaymentType = (params: SelectPaymentTypeParams) => { iouReport, iouReportNextStep, betas, + userBillingGraceEndPeriods, } = params; - if (policy && shouldRestrictUserBillableActions(policy.id)) { + if (policy && shouldRestrictUserBillableActions(policy.id, userBillingGraceEndPeriods)) { 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, userBillingGraceEndPeriods, true); } return; } diff --git a/src/libs/actions/IOU/index.ts b/src/libs/actions/IOU/index.ts index e80574ff02394..782cb3b88d9c3 100644 --- a/src/libs/actions/IOU/index.ts +++ b/src/libs/actions/IOU/index.ts @@ -894,6 +894,7 @@ type PayMoneyRequestFunctionParams = { introSelected: OnyxEntry; iouReportCurrentNextStepDeprecated: OnyxEntry; currentUserAccountID: number; + userBillingGraceEndPeriods: OnyxCollection; paymentPolicyID?: string; full?: boolean; activePolicy?: OnyxEntry; @@ -10573,13 +10574,14 @@ function approveMoneyRequest( isASAPSubmitBetaEnabled: boolean, expenseReportCurrentNextStepDeprecated: OnyxEntry, betas: OnyxEntry, + userBillingGraceEndPeriods: OnyxCollection, full?: boolean, ) { if (!expenseReport) { return; } - if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID)) { + if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID, userBillingGraceEndPeriods)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(expenseReport.policyID)); return; } @@ -11455,11 +11457,12 @@ function submitReport( hasViolations: boolean, isASAPSubmitBetaEnabled: boolean, expenseReportCurrentNextStepDeprecated: OnyxEntry, + userBillingGraceEndPeriods: OnyxCollection, ) { if (!expenseReport) { return; } - if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID)) { + if (expenseReport.policyID && shouldRestrictUserBillableActions(expenseReport.policyID, userBillingGraceEndPeriods)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(expenseReport.policyID)); return; } @@ -11973,8 +11976,21 @@ 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, + userBillingGraceEndPeriods, + full = true, + activePolicy, + policy, + betas, + } = params; + 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 f173cef2edc29..066e449399ce5 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -6230,6 +6230,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriods: undefined, }); } return waitForBatchedUpdates(); @@ -6433,6 +6434,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriods: undefined, }); } return waitForBatchedUpdates(); @@ -6590,6 +6592,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriods: undefined, }); } return waitForBatchedUpdates(); @@ -6639,6 +6642,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriods: undefined, }); await waitForBatchedUpdates(); @@ -6750,6 +6754,7 @@ describe('actions/IOU', () => { currentUserAccountID: CARLOS_ACCOUNT_ID, full: false, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriods: undefined, }); return waitForBatchedUpdates(); }) @@ -6842,6 +6847,7 @@ describe('actions/IOU', () => { full: false, policy, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriods: undefined, }); await waitForBatchedUpdates(); const newExpenseReport = await getOnyxValue(`${ONYXKEYS.COLLECTION.REPORT}${newExpenseReportID}`); @@ -6943,6 +6949,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriods: undefined, }); } return waitForBatchedUpdates(); @@ -8918,7 +8925,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(); }) @@ -9202,7 +9209,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(); }) @@ -9457,7 +9464,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(); }) @@ -9612,7 +9619,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(); }) @@ -11311,6 +11318,7 @@ describe('actions/IOU', () => { iouReportCurrentNextStepDeprecated: undefined, currentUserAccountID: CARLOS_ACCOUNT_ID, betas: [CONST.BETAS.ALL], + userBillingGraceEndPeriods: undefined, }); } await waitForBatchedUpdates(); @@ -13343,7 +13351,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 @@ -13381,7 +13389,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 @@ -13415,7 +13423,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 @@ -13525,7 +13533,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 @@ -13542,7 +13550,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 @@ -13557,7 +13565,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 @@ -13602,7 +13610,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 @@ -13703,7 +13711,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}`);