Skip to content

Commit 4b7a0a5

Browse files
Merge pull request Expensify#65397 from thelullabyy/fix/64585-add-bank-option-open-wrong-page
Invoice - Add bank account option opens More features page when paying the second invoice
2 parents f00318d + 457d7c4 commit 4b7a0a5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/libs/ReportUtils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,10 @@ function getBankAccountRoute(report: OnyxEntry<Report>): Route {
16631663
}
16641664

16651665
if (isInvoiceRoom(report) && report?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.BUSINESS) {
1666-
return ROUTES.WORKSPACE_INVOICES.getRoute(report?.invoiceReceiver?.policyID);
1666+
const invoiceReceiverPolicy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.invoiceReceiver?.policyID}`];
1667+
if (invoiceReceiverPolicy?.areInvoicesEnabled) {
1668+
return ROUTES.WORKSPACE_INVOICES.getRoute(report?.invoiceReceiver?.policyID);
1669+
}
16671670
}
16681671

16691672
return ROUTES.SETTINGS_ADD_BANK_ACCOUNT.route;

0 commit comments

Comments
 (0)