From 66cf34833f91e5a378495dc4a326a78b36fe2a0a Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 27 Nov 2023 13:15:11 +0000 Subject: [PATCH] Move the conditional to its on variable in AddPaymentsMethod --- src/components/AddPaymentMethodMenu.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index a9c9aa5f4556..cfaf47c77bf0 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -64,6 +64,11 @@ const defaultProps = { function AddPaymentMethodMenu({isVisible, onClose, anchorPosition, anchorAlignment, anchorRef, iouReport, onItemSelected, session}) { const {translate} = useLocalize(); + // Users can choose to pay with business bank account in case of Expense reports or in case of P2P IOU report + // which then starts a bottom up flow and creates a Collect workspace where the payer is an admin and payee is an employee. + const canUseBusinessBankAccount = ReportUtils.isExpenseReport(iouReport) || + (ReportUtils.isIOUReport(iouReport) && !ReportActionsUtils.hasRequestFromCurrentAccount(lodashGet(iouReport, 'reportID', 0), lodashGet(session, 'accountID', 0))); + return (