Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.43k stars 2.8k forks source link

[$500] [HOLD for payment 2024-08-19] CRITICAL: Add Pay as Business option for invoices sent to an individual who is admin of their primary workspace #40438

Closed cristipaval closed 1 month ago

cristipaval commented 5 months ago

Part of the Invoicing V0.3 project

Main issue: https://github.com/Expensify/Expensify/issues/341717 Doc section: Invoicing V1 Project: #vip-billpay

Feature Description

Implement the Pay as business option in the App for the individuals who are admin of their primary workspace. This also includes calling the PayInvoice API command.

Manual Test Steps

Automated Tests

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d3f5acd99a5e211f
  • Upwork Job ID: 1825773836120920532
  • Last Price Increase: 2024-08-20
  • Automatic offers:
    • jjcoffee | Reviewer | 103598175
melvin-bot[bot] commented 5 months ago

Triggered auto assignment to @kadiealexander (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

kadiealexander commented 5 months ago

@cristipaval any updates here?

cristipaval commented 5 months ago

Still held. This is part of Invoicing V0.2. We'll get to this when Invoicing V0.1 is done.

kadiealexander commented 5 months ago

Still on hold! Shifting to monthly while we wait for V2.

kadiealexander commented 4 months ago

No longer on hold!

kadiealexander commented 4 months ago

Actually, still on hold!

VickyStash commented 4 months ago

Hi, I'm Viktoryia from Callstack - expert contributor group - and I would like to work on this issue.

VickyStash commented 4 months ago

@shawnborton If I paid the invoice as a business: 1) Should the report preview say that I paid the invoice or should it say that my workspace paid the invoice (ex: viktoryia.kliushun+2 @callstack.com paid or Vik's Workspace paid): IMG1.

IMG22

2) Should the invoice report preview avatars be updated to be workspace-to-workspace same way as the room avatars are updated? Same question for all previously/future created invoices in the room?

VickyStash commented 4 months ago

Updates:

Waiting for some design clarifications to make sure UI looks as expected.

shawnborton commented 4 months ago

Should the report preview say that I paid the invoice or should it say that my workspace paid the invoice (ex: viktoryia.kliushun+2 @callstack.com paid or Vik's Workspace paid):

Good question, I think it would say Workspace paid. We already do this for submitting expenses, when your workspace pays you back and not the individual who approved/paid within the workspace: CleanShot 2024-05-23 at 11 45 41@2x

Should the invoice report preview avatars be updated to be workspace-to-workspace same way as the room avatars are updated? Same question for all previously/future created invoices in the room?

So are you saying that if the invoice receiver choses to pay via a business bank account, and we update that invoice to be workspace-to-workspace, right? In that case, yes, we should update all of the avatars to reflect the nature of it being workspace-to-workspace.

VickyStash commented 4 months ago

@shawnborton @cristipaval 1) Could you please also clarify this use case: I have a workspace-to-individual invoice room with three open invoices. And I pay invoice number 2 using business bank account. The room turns into workspace-to-workspace room. So invoices 1 and 3 will have workspace-to-workspace avatars and will say "Workspace A owes:" instead of "viktoryia.kliushun@callstack.com owes:", right? image


2) In case of Workspace expenses, when a workspace pays the expense, inside the expense view we have a message that the individual paid expense using something: image How this message should look like for the invoice paid by BBA?

VickyStash commented 4 months ago

Updates:

VickyStash commented 4 months ago

Some examples of how the B2B invoice room looks (offline mode, since API updates are still in work).

INV_EX3 INV_EX4 INV_EX5
shawnborton commented 4 months ago
  1. The room turns into workspace-to-workspace room. So invoices 1 and 3 will have workspace-to-workspace avatars and will say "Workspace A owes:" instead of "viktoryia.kliushun@callstack.com owes:", right?

That's my understanding, yes!

How this message should look like for the invoice paid by BBA?

I think we'd follow the same pattern as workspace expenses - it would show the individual that actually took the action. But cc @davidcardoza and @danielrvidal to confirm

davidcardoza commented 4 months ago

Yes, we should show in the message both the user who made the payment and the user who owes the payment. This is important for approval and audit purposes to confirm who processed the payment.

VickyStash commented 4 months ago

Updates: Waiting for https://github.com/Expensify/App/issues/40437 to be merged to continue working on this one.

VickyStash commented 4 months ago

Draft PR is ready. HOLD for API updates for the OpenReport and OpenApp commands to provide invoice receiver policy info for the invoice sender.

cristipaval commented 4 months ago

I asked here for permission to merge the PR that adds the name and avatar of the invoice receiver policy in the response of the OpenApp and OpenReport commands.

@VickyStash, I'll let you know if the team agrees to deploy it.

VickyStash commented 4 months ago

Updates:

When the API issue with previousReportActionID: "0" will be resolved I'll open the PR for review

VickyStash commented 3 months ago

Updates: The PR has been opened for the review

VickyStash commented 3 months ago

Updates: working on the C+ reviewer feedback applying

melvin-bot[bot] commented 3 months ago

@cristipaval, @VickyStash, @jjcoffee, @kadiealexander Whoops! This issue is 2 days overdue. Let's get this updated quick!

davidcardoza commented 3 months ago

@VickyStash any new update on this issue?

VickyStash commented 3 months ago

@davidcardoza The related PR is ON HOLD till API updates to support at most one b2b and one b2c invoice room between the sender and the receiver are implemented.

jjcoffee commented 3 months ago

Just a heads up that I'll be going OOO until Jul 24 or so, but the PR is pretty close to being approved and I'll be able to check in to retest until we're done.

VickyStash commented 3 months ago

Same, I'm going to be OOO Jul 1- Jul 7 🌴

davidcardoza commented 3 months ago

Thanks for the heads up @jjcoffee let me know if you'll end up needing this issue reassigned out while you're OOO.

jjcoffee commented 3 months ago

@davidcardoza PR approved from my end as it's just waiting for BE changes left, so we should be all good!

melvin-bot[bot] commented 3 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 3 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 2 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

VickyStash commented 2 months ago

Updates: Investigating blockers that caused the PR revert and applying fixes in Draft PR

melvin-bot[bot] commented 2 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 2 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.5-13 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-17. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 2 months ago

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

cristipaval commented 2 months ago

the PR for this issue was reverted

VickyStash commented 2 months ago

I've put Draft PR on hold for now, till two affecting issues are resolved, see the comment.

melvin-bot[bot] commented 2 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.6-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-22. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 2 months ago

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

VickyStash commented 2 months ago

One more blocker issue was found during the testing of the Draft PR. See the discussion for more details. It looks like it can be the Onyx issue.

davidcardoza commented 2 months ago

@VickyStash Is there any update on this issue?

VickyStash commented 2 months ago

@davidcardoza I'm working on the FE fix for the room update to B2B after the receiver paid as a business for the first time. As soon as it is resolved, I think I'll reopen the PR.

VickyStash commented 2 months ago

Updates: I've almost finished fixing the mentioned issue with the B2B room update. If nothing new pops up, I should be able to open the PR for review tomorrow.

VickyStash commented 2 months ago

The FE issue is resolved!

There are two separate issues that were mentioned previous time:

@cristipaval Should we block the PR for the current issue due to these two?

cristipaval commented 2 months ago

It seems that these are not related to the current PR, so I wouldn't block the PR on them.

melvin-bot[bot] commented 1 month ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 1 month ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 1 month ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.18-10 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-08-19. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 1 month ago

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

jjcoffee commented 1 month ago

Regression Test Proposal

  1. Login to the app as User A. The user should be the admin of any workspace.
  2. Go to FAB -> Select "Send invoice"
  3. Send an invoice of any amount to User B (who should be the admin of his primary workspace)
  4. Login as User B and open the invoice room from step 3.
  5. Tap the Pay button and select Pay as business -> Pay elsewhere
  6. Verify that:
    • the invoice got paid
    • the room is turned into a B2B invoices room, the title and avatars reflect the workspace names and any custom avatars.
  7. Login as User A and open the same invoice room. Verify against step 6.

Do we agree 👍 or 👎