App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Web - IOU - Error message paying elsewhere partially a report with two held expenses and a tracked

Open IuliiaHerets opened this issue 1 year ago • 11 comments

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.70-0 Reproducible in staging?: Y Reproducible in production?: N Issue was found when executing this PR: https://github.com/Expensify/App/pull/49971 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/ on a workspace chat
  2. Submit 3 expenses (1 expense with a different currency) and track 1 forth expense
  3. Hold 2 expenses (1 expense with the different currency)
  4. Go back to the main chat
  5. Select Pay elsewhere on the report
  6. Confirm the partial amount

Expected Result:

The partial amount is paid

Actual Result:

"The requested amount has changed" error message is shown

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/e662d436-8de4-4ec3-ad92-ff97486ed5f6

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021864070097967682615
  • Upwork Job ID: 1864070097967682615
  • Last Price Increase: 2024-12-03
Issue OwnerCurrent Issue Owner: @sobitneupane

IuliiaHerets avatar Dec 03 '24 06:12 IuliiaHerets

Triggered auto assignment to @VictoriaExpensify (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.

melvin-bot[bot] avatar Dec 03 '24 06:12 melvin-bot[bot]

Triggered auto assignment to @techievivek (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] avatar Dec 03 '24 06:12 melvin-bot[bot]

💬 A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Dec 03 '24 06:12 melvin-bot[bot]

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

github-actions[bot] avatar Dec 03 '24 06:12 github-actions[bot]

Production behavior

https://github.com/user-attachments/assets/bddff7d6-5884-4a56-935e-e95338bbb619

IuliiaHerets avatar Dec 03 '24 06:12 IuliiaHerets

@bernhardoj Do you mind taking a look at this ticket and see if it's related to your changes above?

techievivek avatar Dec 03 '24 13:12 techievivek

Job added to Upwork: https://www.upwork.com/jobs/~021864070097967682615

melvin-bot[bot] avatar Dec 03 '24 22:12 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

melvin-bot[bot] avatar Dec 03 '24 22:12 melvin-bot[bot]

Demoting as discussed in thread: https://expensify.slack.com/archives/C01GTK53T8Q/p1733206499066379

puneetlath avatar Dec 03 '24 23:12 puneetlath

P.S when trying to look at this from that thread, I was getting a duplicate report preview when I held an expense on v9.0.70-1 desktop app.

Steps:

  1. Create 2 expenses in the workspace currency
  2. Create 1 expense in a different currency
  3. Click into the expense report
  4. Hover over the preview of the first expense in the report.
  5. Click Hold from the comment action menu on the expense preview
  6. Observe the duplicate report preview created
image

trjExpensify avatar Dec 03 '24 23:12 trjExpensify

I wanna test this on prod, but the PR is deployed to prod already. I think this issue exists on prod too. The prod video here doesn't show the pay behavior. The issue here is that, when we pay money request with held expenses partially, we use the amount of unheldTotal as the pay total. https://github.com/Expensify/App/blob/146204878d1b9d4358d91e9a0a81169a7819d96f/src/libs/actions/IOU.ts#L6642-L6645

However, unheldTotal includes non-reimbursable transactions too (track), so we got the error. Previously unheldTotal doesn't include non-reimbursable transactions, but we agreed to update it on the BE to include it. Since it's a BE change and has been updated since 16 Oct, I believe this exists on prod too.

The solution to this is to subtract unheldTotal by unheldNonReimbursableTotal.

bernhardoj avatar Dec 04 '24 13:12 bernhardoj

@bernhardoj This seems like something we missed? The plan already covered that.

In the approve modal display:

Partial: unheldTotal Full: total

In the pay modal display:

Partial: unheldTotal - unheldNonReimbursableTotal Full: total - nonReimbursableTotal

s77rt avatar Dec 04 '24 14:12 s77rt

@bernhardoj Please raise a PR since this is a regression (or at least it's something that was supposed to be done in the PR)

s77rt avatar Dec 04 '24 14:12 s77rt

This seems like something we missed? https://github.com/Expensify/App/pull/49971#issuecomment-2397561749 already covered that.

That plan only handles the amount to be shown, not the API params.

bernhardoj avatar Dec 04 '24 15:12 bernhardoj

I'll handle this tomorrow.

bernhardoj avatar Dec 04 '24 15:12 bernhardoj

PR is ready

bernhardoj avatar Dec 05 '24 06:12 bernhardoj

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

melvin-bot[bot] avatar Dec 09 '24 16:12 melvin-bot[bot]

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

  • https://github.com/Expensify/App/pull/53622

If no regressions arise, payment will be issued on 2024-12-16. :confetti_ball:

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

  • @sobitneupane requires payment through NewDot Manual Requests

melvin-bot[bot] avatar Dec 09 '24 16:12 melvin-bot[bot]

@sobitneupane @VictoriaExpensify @sobitneupane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

melvin-bot[bot] avatar Dec 09 '24 16:12 melvin-bot[bot]

This issue was a regression from https://github.com/Expensify/App/pull/49971 PR and is handled by the author of the PR, payment and checklist will be handled in the original issue.

sobitneupane avatar Dec 09 '24 16:12 sobitneupane

Let's close this one. No payment is due here (regression)

s77rt avatar Dec 15 '24 00:12 s77rt

Payment Summary

Upwork Job

  • Reviewer: @sobitneupane owed $250 via NewDot

BugZero Checklist (@VictoriaExpensify)

  • [ ] I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • [ ] I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1864070097967682615/hired)
  • [ ] I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • [ ] I have verified the payment summary above is correct

melvin-bot[bot] avatar Dec 16 '24 09:12 melvin-bot[bot]

Closing this based on above comments.

techievivek avatar Dec 16 '24 12:12 techievivek