Skip to content

Commit 457d7c4

Browse files
committed
fix: invoice add bank account option opens more feature
1 parent fd5c717 commit 457d7c4

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)