Fix invoice showing 'waiting for bank account' when user has VBBA (#78241)#84221
Fix invoice showing 'waiting for bank account' when user has VBBA (#78241)#84221Walle2131235 wants to merge 1 commit intoExpensify:mainfrom
Conversation
- Check if policy has verified business bank account (VBBA) before showing 'waiting for bank account' message - Prevents incorrect message display when payee already has achAccount set up - Fixes issue Expensify#78241 where users with VBBA saw confusing bank account prompts
|
I have read the CLA Document and I hereby sign the CLA walle seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
|
@carlosmiceli Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d3b1ed926
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const hasVBBA = !!policy?.achAccount?.bankAccountID && policy.achAccount.state === CONST.BANK_ACCOUNT.STATE.OPEN; | ||
| if (report.isWaitingOnBankAccount && !hasVBBA) { |
There was a problem hiding this comment.
Check VBBA against report policy data
Use the report-linked policy here instead of the optional policy argument, because most getReportPreviewMessage() callers pass null/undefined for that parameter (for example src/libs/OptionsListUtils/index.ts at lines 687 and 716), which makes hasVBBA evaluate false and keeps showing iou.waitingOnBankAccount even when the report's workspace already has an open VBBA. In those common paths this change does not actually fix the invoice preview message bug.
Useful? React with 👍 / 👎.
|
Please don't open a PR before it is approved. Let's close this PR. |
Fixed Issues
Changes
src/libs/ReportUtils.tsto check if policy has a verified business bank account (VBBA) before showing the 'waiting for bank account' message!!policy?.achAccount?.bankAccountID && policy.achAccount.state === CONST.BANK_ACCOUNT.STATE.OPENTests
Why This Fix Is Needed
When a payer pays an invoice with a credit card, users with an existing Verified Business Bank Account (VBBA) were incorrectly seeing the message: '[payer] started payment, but is waiting for [payee] to add a bank account.'
This fix ensures the message only appears when the user actually needs to add a bank account.
Related