Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoice - The Add bank account button is not displayed in the invoice report #54723

Closed
2 of 8 tasks
IuliiaHerets opened this issue Jan 1, 2025 · 8 comments
Closed
2 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@IuliiaHerets
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.80-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #54138
Issue reported by: Applause Internal Team
Device used: Windows 10/ Chrome, Samsung S23FE/ Android 14
App Component: Other

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace if needed
  3. Go to More features, scroll down and enable Invoices
  4. Click green plus, Send invoice
  5. Send an invoice to User B
  6. As User B, go to invoice chat and pay the invoice as business > Pay elsewhere
  7. As User A, go to invoice report

Expected Result:

The Add bank account button is displayed in the invoice report.

Actual Result:

The Add bank account button is not displayed in the invoice report on User A end.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6704799_1735743493413.No_Add_bank_account_button.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 1, 2025
Copy link

melvin-bot bot commented Jan 1, 2025

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@Shahidullah-Muffakir
Copy link
Contributor

Shahidullah-Muffakir commented Jan 1, 2025

Edited by proposal-police: This proposal was edited at 2025-01-01 17:24:05 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

After the user clicks on Pay elsewhere, the Add Bank Account button does not appear in the Invoice report

What is the root cause of that problem?

The button is only shown if the user has not added a bank account or if hasMissingInvoiceBankAccount is true, and the report is not settled. This logic is implemented in the following cases:

const shouldShowAddBankAccountButton = action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && ReportUtils.hasMissingInvoiceBankAccount(reportID) && !ReportUtils.isSettled(reportID);

and
const shouldPromptUserToAddBankAccount =
(ReportUtils.hasMissingPaymentMethod(userWallet, iouReportID) || ReportUtils.hasMissingInvoiceBankAccount(iouReportID)) && !ReportUtils.isSettled(iouReportID);

and
if (hasMissingInvoiceBankAccount(optionOrReport.reportID) && !isSettled(optionOrReport.reportID)) {

When the user clicks Pay elsewhere, the report is marked as settled, causing the condition !isSettled(reportID) to evaluate as false. As a result, the button is not displayed.

What changes do you think we should make in order to solve the problem?

Remove the !isSettled(reportID) condition from all relevant pages. This way, even if the report is marked as settled, the Add Bank Account button will still be displayed if the user has not added a bank account.

We can still use !isSettled(reportID) in the getReasonAndReportActionThatRequiresAttention function in the ReportUtils.ts file

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

Screen.20Recording.202025-01-01.20at.2010.mp4

@ijmalik
Copy link
Contributor

ijmalik commented Jan 1, 2025

Related PR: Fix: Remove GBR and 'Add a bank account' for paid invoices #53802

The current issue appears to be linked to the changes introduced in this PR.

@parasharrajat
Copy link
Member

@ikevin127 Looks like you PR is contradicting with this issue #53802.

@Shahidullah-Muffakir
Copy link
Contributor

Hmm, I’m wondering if this is even a bug.. If the invoice is marked as Paid elsewhere or settled, it might not make sense to display the Add bank account button. We should confirm the expected behavior for this scenario.

@Hokkekyo
Copy link

Hokkekyo commented Jan 1, 2025

I was able to reproduce the PR, but the steps were not exact.

  1. Go to staging.new.expensify.com
  2. Create a workspace if needed
  3. Go to More features, scroll down and enable Invoices
  4. Click green plus, Send invoice
    5 .Send an invoice to User B
  5. As User B Go to invoice chat and pay the invoice as business
  6. [User A] Go to invoice report (It is not possible to execute)
  7. [User A] Click Add bank account (It is not possible to execute)
  8. [User A] In settings Add bank account (It is not possible to execute)
  9. Go to Settings > WS > Click on the WS > Invoices > Click on the bank account for invoicing and choose to make it the default
  10. Click the green plus, send a $2 to user B
  11. Open the invoice report and verify it loads successfully
Fix_new_individual_invoice_after_one_is_paid_as_a_business__54138.mp4

@ikevin127
Copy link
Contributor

@ikevin127 Looks like you PR is contradicting with this issue #53802.

@parasharrajat Weird, we should have somebody from the team chime in and tell us what's the expected behaviour according to design doc, because the Expected result of issue:

clearly stated:

No GBR should appear for "Add a bank account" if:
The invoice was marked as "Paid elsewhere."
Bank accounts are already configured in the workspace.

whereas this issue is asking for a revert of that, which to me doesn't make much sense.

cc @cristipaval @garrettmknight from the other issue, maybe you can help us with a decision regarding this confusion, or call-in somebody with more context on the matter

@cristipaval
Copy link
Contributor

I don't agree with the Expected result in this issue. There's no pending money reimbursement to the payee, since the invoice is paid elsewhere, so no bank account need to be added. We'll solve this issue when we finish the Invoice payments with Stripe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

8 participants