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

[$250] Negative amount displayed in Pay with Expensify Dropdown Button and Confirm payment amount Modal #42325

Closed
1 of 6 tasks
m-natarajan opened this issue May 16, 2024 · 42 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented May 16, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.74-4
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @ikevin127
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1715813045792699

Action Performed:

Prerequisite : Have one existing account (A) and one newly created account (B)

  1. Login as new user (B) in a browser
  2. On the “What do you want to do today?” modal choose “Manage my team's expenses” and Continue.
    3, Input business name and Continue.
  3. Input First and Last Name and Continue.
  4. On the “Welcome” modal click Get Started.
  5. Log in as an existing user (A) in incognito or in another browser
  6. Click FAB > Submit expense > Manual > enter any amount and select the user B
  7. Create one more IOU with user B to have 2 expenses report
  8. Hold one of the expenses
  9. Login to user B account and look for the IOU request from user A (If the report with the existing user does not show-up in LHN then click FAB > Start chat > Input existing user email and start a chat)
  10. Once the chat opens, we should see the two report expenses requested by the existing user with the “Pay with Expensify” green dropdown button.
  11. Click on the report preview showing “2 expenses” at the bottom in order to see the two expenses.
    Notice that the report header “Pay with Expensify” green dropdown button shows negative amount like -$7.00.
  12. Click on the “Pay with Expensify” green dropdown arrow button and notice that both options are showing negative amount.
    After clicking on the dropdown arrow button > Select “Pay elsewhere”.
  13. Click on the header “Pay elsewhere” button and notice that the “Confirm what to pay” modal also shows negative amount for both options.

Expected Result:

-Report header “Pay with Expensify” green dropdown button shows the amount as positive amount
-Clicking on the header “Pay elsewhere” button “Confirm what to pay” modal also shows positive amount for both options.

Actual Result:

  • Notice that the report header “Pay with Expensify” green dropdown button shows negative amount like -$7.00.
  • Click on the “Pay with Expensify” green dropdown arrow button and notice that both options are showing negative amount.
  • After clicking on the dropdown arrow button > Select “Pay elsewhere”.
  • Click on the header “Pay elsewhere” button and notice that the “Confirm what to pay” modal also shows negative amount for both options.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Screenshot 2024-05-10 at 21 54 05

Screenshot 2024-05-10 at 21 53 52

Screen.Recording.2024-05-15.at.15.31.26.mov
Recording.80.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cc7f63f52440c4db
  • Upwork Job ID: 1800107311798006347
  • Last Price Increase: 2024-06-17
  • Automatic offers:
    • alitoshmatov | Reviewer | 102858943
    • dominictb | Contributor | 102858945
Issue OwnerCurrent Issue Owner: @zanyrenney
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 16, 2024
Copy link

melvin-bot bot commented May 16, 2024

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

@ikevin127
Copy link
Contributor

To me this looks BE-related if we look at the transaction amounts (see C+ Slack 🧵) being a positive number, considering it should be negative as that's how we store it in BE and since we have logic here, here and other places in FE in order to make it positive.

Note

If this is BE related, I'd look at the “What do you want to do today?” Modal -> “Manage my team's expenses” flow.

But could also be some mix-up on the FE, not entirely sure 🤔

@melvin-bot melvin-bot bot added the Overdue label May 20, 2024
@zanyrenney
Copy link
Contributor

Thanks for adding these thoughts @ikevin127 !

@melvin-bot melvin-bot bot removed the Overdue label May 20, 2024
@zanyrenney
Copy link
Contributor

@melvin-bot melvin-bot bot added the Overdue label May 22, 2024
Copy link

melvin-bot bot commented May 23, 2024

@zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick!

@zanyrenney
Copy link
Contributor

Seeing as this is a BE issue and noone has volunteered for it in slack. I think we should reopen if we encounter this via a real user flow rather than the slightly complex reproduction steps above.

@melvin-bot melvin-bot bot removed the Overdue label May 24, 2024
@lanitochka17
Copy link

lanitochka17 commented May 27, 2024

Issue is still reproducible on the latest build 1.4.76-2
Steps:
Submitter

  1. Create an IOU with several expenses in a 1:1 with another user you have access to
    Participant
  2. Log in as the other user
  3. Navigate to a expense, click the three dots in the header, and choose Hold
  4. Leave a hold comment and confirm
  5. Navigate up to the report conversation
bandicam.2024-05-27.20-59-23-495.mp4

@lanitochka17 lanitochka17 reopened this May 27, 2024
@melvin-bot melvin-bot bot added the Overdue label May 29, 2024
Copy link

melvin-bot bot commented May 30, 2024

@zanyrenney this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented May 31, 2024

@zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Jun 6, 2024

@zanyrenney Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

@zanyrenney
Copy link
Contributor

Been OOO, this reopened whilst I was out.

@melvin-bot melvin-bot bot removed the Overdue label Jun 10, 2024
@zanyrenney
Copy link
Contributor

As it's still reproducible, assigning external.

@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Jun 10, 2024
@melvin-bot melvin-bot bot changed the title Negative amount displayed in Pay with Expensify Dropdown Button and Confirm payment amount Modal [$250] Negative amount displayed in Pay with Expensify Dropdown Button and Confirm payment amount Modal Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

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

@dominictb
Copy link
Contributor

dominictb commented Jun 10, 2024

Proposal

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

Notice that the report header “Pay with Expensify” green dropdown button shows negative amount like -$7.00.
Click on the “Pay with Expensify” green dropdown arrow button and notice that both options are showing negative amount.
After clicking on the dropdown arrow button > Select “Pay elsewhere”.
Click on the header “Pay elsewhere” button and notice that the “Confirm what to pay” modal also shows negative amount for both options.

What is the root cause of that problem?

We show the displayed amount as the nonHeldAmount here if the iouReport has held request and nonHeldAmount is returned by getNonHeldAndFullAmount

In this function, we always *-1 here without checking the iouReport is expense report or not. And then because the iou report has positive amount, the negative amount is displayed.

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

For here and here we should check if the iouReport is expense report, we will * -1 otherwise we will * 1.

What alternative solutions did you explore? (Optional)

NA

Copy link

melvin-bot bot commented Jun 24, 2024

📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@blimpich
Copy link
Contributor

This confused me for a minute and I had to read through the discussions and look at the code for awhile but it does make sense to me that this is a frontend issue. Appears that we overlooked this particular scenario when implementing the hold functionality for reports.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jun 26, 2024
@alitoshmatov
Copy link
Contributor

alitoshmatov commented Jun 27, 2024

@blimpich Sorry missed your comment.

Can you elaborate, which part you think we have a problem. Is this the fact that amounts are in negative when in expense reports and positive in iou reports?

Should we pause PR or go on with proposed solution?

@blimpich
Copy link
Contributor

Go with the proposed solution, sorry, my comment was worded poorly. When I say "we overlooked" I don't mean you and @dominictb, I mean the original implementors of this code that we are now fixing.

Please proceed forward with the proposed solution.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

This issue has not been updated in over 15 days. @blimpich, @zanyrenney, @alitoshmatov, @dominictb eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@blimpich
Copy link
Contributor

Did we ever pay out for this issue? @zanyrenney can you make sure we paid for the work done here? I think maybe the automation failed?

@blimpich blimpich added Weekly KSv2 and removed Monthly KSv2 labels Jul 22, 2024
@alitoshmatov
Copy link
Contributor

The PR was deployed to production on july 16th

@alitoshmatov
Copy link
Contributor

We can complete the payment and close the issue

cc: @blimpich @zanyrenney

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Aug 15, 2024
Copy link

melvin-bot bot commented Aug 15, 2024

This issue has not been updated in over 15 days. @blimpich, @zanyrenney, @alitoshmatov, @dominictb eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@alitoshmatov
Copy link
Contributor

@blimpich @zanyrenney

Bump

@blimpich
Copy link
Contributor

blimpich commented Sep 3, 2024

Sorry for the delay @alitoshmatov!

@zanyrenney can we get payment completed and close out this issue soon?

@blimpich blimpich added Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 and removed Reviewing Has a PR in review Monthly KSv2 labels Sep 3, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 3, 2024
@zanyrenney
Copy link
Contributor

Sure thing @blimpich - on it now.

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2024
@zanyrenney
Copy link
Contributor

Payment summary

paid @alitoshmatov $250 via upwork
paid @dominictb $250 via upwork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Development

No branches or pull requests

7 participants