Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2ed5c78
Show global reimbursements modal for reports skipped in bulk pay
WojtekBoman Oct 28, 2026
c5893c5
Merge branch 'main' into wojtekboman/wise-bulk-pay-gr-modal
WojtekBoman Oct 28, 2026
973c14c
Open global reimbursements intro directly when bulk pay pays nothing
WojtekBoman Oct 28, 2026
0541903
Test bulk pay global reimbursements with real bank account data
WojtekBoman Oct 29, 2026
7965b10
Add empty line before global reimbursements skip check
WojtekBoman Oct 29, 2026
ea52bc6
Reuse payable report IDs for bulk pay report names
WojtekBoman Oct 29, 2026
f58015f
Skip only reports the backend flags for global reimbursements in bulk…
dariusz-biela Nov 6, 2026
e8b4628
Add Spanish copy for the bulk pay global reimbursements modal
dariusz-biela Nov 6, 2026
72041d8
Open the global reimbursements onboarding through its action in payMo…
dariusz-biela Nov 6, 2026
e8496e3
Name skipped bulk pay reports from the report row instead of subscrib…
dariusz-biela Nov 6, 2026
506f611
Share the report name bullet list across bulk action modals
dariusz-biela Nov 6, 2026
0a4726d
Assert bulk pay clears the selection after paying some reports
dariusz-biela Nov 6, 2026
fabc535
Use the global reimbursements flag only when paying from the workspac…
dariusz-biela Nov 6, 2026
7944f2e
Merge remote-tracking branch 'origin/main' into wojtekboman/wise-bulk…
dariusz-biela Nov 6, 2026
681913f
Merge remote-tracking branch 'origin/main' into wojtekboman/wise-bulk…
dariusz-biela Nov 6, 2026
e14c85b
Merge remote-tracking branch 'origin/main' into wojtekboman/wise-bulk…
dariusz-biela Nov 6, 2026
e94c8bd
Translate the bulk pay global reimbursements copy and drop an unneede…
dariusz-biela Nov 6, 2026
777e489
Skip the global reimbursements prompt when the Wise quote carousel is…
WojtekBoman Nov 12, 2026
575c57e
Pay every bulk pay report from one bank account instead of skipping o…
WojtekBoman Nov 12, 2026
eee9ff6
Inline the global reimbursements intro subtitle so React Compiler kee…
WojtekBoman Nov 12, 2026
eab5172
Treat a bank account without the global reimbursements flag as not se…
WojtekBoman Nov 13, 2026
3095ece
List bulk pay reports the backend rejects for global reimbursements i…
WojtekBoman Nov 17, 2026
2b4e20e
Merge branch 'main' into wojtekboman/wise-bulk-pay-gr-modal
WojtekBoman Nov 17, 2026
ded9eb0
Merge branch 'main' into wojtekboman/wise-bulk-pay-gr-modal
WojtekBoman Nov 19, 2026
7736683
Keep reports in place until the backend answers a payment it may reje…
WojtekBoman Nov 19, 2026
c37be90
Show payments from the workspace account as paid right away when the …
WojtekBoman Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ const DYNAMIC_ROUTES = {
WISE_GLOBAL_REIMBURSEMENTS_INTRO: {
path: 'global-reimbursements/:bankAccountID',
entryScreens: ENABLE_GLOBAL_REIMBURSEMENTS_ENTRY_SCREENS,
getRoute: (bankAccountID: number | undefined) => `global-reimbursements/${bankAccountID}` as const,
getRoute: (bankAccountID: number | undefined, isPayingMultipleReports?: boolean) =>
getUrlWithParams(`global-reimbursements/${bankAccountID}`, {
// Shows the copy for several reports when bulk pay could not pay any of them
isPayingMultipleReports: isPayingMultipleReports ? 'true' : undefined,
}),
queryParams: ['isPayingMultipleReports'],
},
WISE_BUSINESS_ONBOARDING: {
path: 'business-onboarding/:subPage?/:action?',
Expand Down
32 changes: 30 additions & 2 deletions src/components/EnableGlobalReimbursementsPayModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';

import {getLastFourDigits} from '@libs/BankAccountUtils';
import deferModalPresentationAfterPopoverDismiss from '@libs/deferModalPresentationAfterPopoverDismiss';
import formatReportNamesAsBulletList from '@libs/formatReportNamesAsBulletList';
import {getEnableGlobalReimbursementsBusinessNavigationRoute, getWiseGlobalReimbursementsIntroNavigationRoute} from '@libs/Navigation/helpers/enableGlobalReimbursementsNavigationUtils';
import Navigation from '@libs/Navigation/Navigation';

import {clearEnableGlobalReimbursementsModal} from '@userActions/App';
import {clearEnableGlobalReimbursementsModal, showEnableGlobalReimbursementsModal as showEnableGlobalReimbursementsModalAction} from '@userActions/App';

import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand All @@ -30,14 +33,39 @@ function EnableGlobalReimbursementsPayModal() {
if (isModalOpenRef.current) {
return;
}

// Search bulk pay paid some reports and left these unpaid. It lists them here rather than in Search, because the responses can arrive after the admin left the Search page
const {unpaidReportNames, accountNumber, ...bankAccount} = modalData;
if (unpaidReportNames?.length) {
clearEnableGlobalReimbursementsModal();
deferModalPresentationAfterPopoverDismiss(() => {
showConfirmModal({
title: translate('walletPage.wiseGlobalReimbursementsBulkPayModal.title', getLastFourDigits(accountNumber ?? '')),
subtitle: translate('walletPage.wiseGlobalReimbursementsBulkPayModal.description'),
prompt: formatReportNamesAsBulletList(unpaidReportNames),
confirmText: translate('walletPage.wiseGlobalReimbursementsIntro.getStarted'),
cancelText: translate('common.notNow'),
shouldEnablePromptScroll: true,
}).then((result) => {
if (result.action !== ModalActions.CONFIRM) {
return;
}
showEnableGlobalReimbursementsModalAction(bankAccount);
});
});
return;
}

const navigationPathAtSignal = Navigation.getActiveRoute();

// The signal arrives after a pay attempt, so betas are loaded. An unknown beta state should take the Corpay path.
if (isBetaEnabled(CONST.BETAS.WISE_REIMBURSEMENTS)) {
if (isAccountLocked) {
showLockedAccountModal();
} else {
Navigation.navigate(getWiseGlobalReimbursementsIntroNavigationRoute(modalData.bankAccountID, navigationPathAtSignal), {skipMatchingFullScreenRoute: true});
Navigation.navigate(getWiseGlobalReimbursementsIntroNavigationRoute(modalData.bankAccountID, navigationPathAtSignal, modalData.isPayingMultipleReports), {
skipMatchingFullScreenRoute: true,
});
}
clearEnableGlobalReimbursementsModal();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import ROUTES from '@src/ROUTES';
import type {Transaction} from '@src/types/onyx';

import {hasSeenTourSelector} from '@selectors/Onboarding';
import {isActionLoadingSelector} from '@selectors/ReportMetaData';
import React from 'react';
import Onyx from 'react-native-onyx';

Expand Down Expand Up @@ -69,6 +70,8 @@ function PayPrimaryAction({reportID, chatReportID, isDisabled}: PayPrimaryAction
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(moneyRequestReport?.policyID)}`);
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID);
// The button keeps loading while an action on the report is in flight, such as a payment held until the backend answers, so it can't be paid twice
const [isPaymentInFlight] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${getNonEmptyStringOnyxID(moneyRequestReport?.reportID)}`, {selector: isActionLoadingSelector});

const activePolicy = usePolicy(activePolicyID);
const chatReportPolicy = usePolicy(chatReport?.policyID);
Expand Down Expand Up @@ -257,7 +260,7 @@ function PayPrimaryAction({reportID, chatReportID, isDisabled}: PayPrimaryAction
enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
shouldHidePaymentOptions={!shouldShowPayButton}
isDisabled={(isOffline && !canAllowSettlement) || isDisabled}
isLoading={(!isOffline && !canAllowSettlement) || isDownloadingABAFile}
isLoading={(!isOffline && !canAllowSettlement) || isDownloadingABAFile || !!isPaymentInFlight}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import usePermissions from '@hooks/usePermissions';
import usePolicy from '@hooks/usePolicy';

import {generateDefaultWorkspaceName} from '@libs/actions/Policy/Policy';
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import getHoldMenuAmounts from '@libs/HoldMenuUtils';
import {getTotalAmountForIOUReportPreviewButton} from '@libs/MoneyRequestReportUtils';
import {isTrackOnboardingChoice} from '@libs/OnboardingUtils';
Expand All @@ -33,6 +34,7 @@ import ROUTES from '@src/ROUTES';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';

import {hasSeenTourSelector} from '@selectors/Onboarding';
import {isActionLoadingSelector} from '@selectors/ReportMetaData';
import React from 'react';
import Onyx from 'react-native-onyx';

Expand Down Expand Up @@ -61,6 +63,8 @@ function PayActionButton() {
const {reportPreviewAction, canIOUBePaid, onlyShowPayElsewhere, shouldShowPayButton} = useReportPreviewActionState();

const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID);
// The button keeps loading while an action on the report is in flight, such as a payment held until the backend answers, so it can't be paid twice
const [isPaymentInFlight] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${getNonEmptyStringOnyxID(iouReportID)}`, {selector: isActionLoadingSelector});
const activePolicy = usePolicy(activePolicyID);
const actionButtonData = useReportPreviewActionButtonData(iouReportID);
const {iouReport, policy, userBillingGracePeriodEnds, amountOwed, ownerBillingGracePeriodEnd} = actionButtonData;
Expand Down Expand Up @@ -205,7 +209,7 @@ function PayActionButton() {
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
}}
isDisabled={isOffline && !canAllowSettlement}
isLoading={(!isOffline && !canAllowSettlement) || isDownloadingABAFile}
isLoading={(!isOffline && !canAllowSettlement) || isDownloadingABAFile || !!isPaymentInFlight}
sentryLabel={CONST.SENTRY_LABEL.REPORT_PREVIEW.PAY_BUTTON}
/>
);
Expand Down
Loading
Loading