Skip to content

Fix invoice showing 'waiting for bank account' when user has VBBA (#78241)#84221

Closed
Walle2131235 wants to merge 1 commit intoExpensify:mainfrom
Walle2131235:fix-invoice-waiting-bank-account-message
Closed

Fix invoice showing 'waiting for bank account' when user has VBBA (#78241)#84221
Walle2131235 wants to merge 1 commit intoExpensify:mainfrom
Walle2131235:fix-invoice-waiting-bank-account-message

Conversation

@Walle2131235
Copy link

@Walle2131235 Walle2131235 commented Mar 4, 2026

Fixed Issues

Changes

  • Modified src/libs/ReportUtils.ts to check if policy has a verified business bank account (VBBA) before showing the 'waiting for bank account' message
  • Added VBBA check: !!policy?.achAccount?.bankAccountID && policy.achAccount.state === CONST.BANK_ACCOUNT.STATE.OPEN
  • Only shows 'waiting for bank account' message when user actually doesn't have a VBBA set up

Tests

  • TypeScript compilation: ✅ Pass
  • Logic: Checks policy.achAccount state matches pattern used elsewhere in codebase (SearchUIUtils.ts, WorkspaceWorkflowsPage.tsx)

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

- 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
@Walle2131235 Walle2131235 requested review from a team as code owners March 4, 2026 23:45
@melvin-bot melvin-bot bot requested review from heyjennahay and removed request for a team March 4, 2026 23:46
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@melvin-bot melvin-bot bot requested review from carlosmiceli and removed request for a team March 4, 2026 23:46
@melvin-bot
Copy link

melvin-bot bot commented Mar 4, 2026

@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]

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +5405 to +5406
const hasVBBA = !!policy?.achAccount?.bankAccountID && policy.achAccount.state === CONST.BANK_ACCOUNT.STATE.OPEN;
if (report.isWaitingOnBankAccount && !hasVBBA) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@huult
Copy link
Contributor

huult commented Mar 5, 2026

Please don't open a PR before it is approved. Let's close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants