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

[HOLD for payment 2023-05-23] [$1000] [Manual Requests] Ensure correct amount is displayed in the IOUPreview #18749

Closed
luacmartins opened this issue May 10, 2023 · 26 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

@luacmartins
Copy link
Contributor

luacmartins commented May 10, 2023

Coming from this comment, transaction amounts for Expense reports are stored as negative values in the database, so we need to invert the sign from negative to positive and vice-versa.

This is because there are instances where you can get a credit back on your card, or you enter a negative expense to “offset” future expenses. So in theory, the total of your expenseReport could be a negative.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013a4895d6068712f5
  • Upwork Job ID: 1656413205162098688
  • Last Price Increase: 2023-05-10
@luacmartins luacmartins added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@luacmartins luacmartins self-assigned this May 10, 2023
@luacmartins luacmartins added the External Added to denote the issue can be worked on by a contributor label May 10, 2023
@melvin-bot melvin-bot bot changed the title Ensure correct amount is displayed in the IOUPreview [$1000] Ensure correct amount is displayed in the IOUPreview May 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

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

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

melvin-bot bot commented May 10, 2023

Current assignee @luacmartins is eligible for the External assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

📣 @mollfpr You have been assigned to this job by @luacmartins!
Please apply to this job in Upwork 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 📖

@luacmartins luacmartins changed the title [$1000] Ensure correct amount is displayed in the IOUPreview [$1000] [Manual Requests] Ensure correct amount is displayed in the IOUPreview May 10, 2023
@mountiny
Copy link
Contributor

@mollfpr it might be clear from the body but just noting this applies only for the expense reports, not for the IOU reports

@mollfpr
Copy link
Contributor

mollfpr commented May 11, 2023

@mountiny Yes, this only happen on the expense reports.

@trjExpensify
Copy link
Contributor

Dope, are you good with a PR for this one @mollfpr?

@mollfpr
Copy link
Contributor

mollfpr commented May 11, 2023

@trjExpensify Yup! Will clean up my tasks on the proposals review and then raise a PR for this.

@trjExpensify
Copy link
Contributor

Neat, thanks!

@mollfpr
Copy link
Contributor

mollfpr commented May 11, 2023

moneyRequestReport.total += amount;

transaction amounts for Expense reports are stored as negative values in the database

@luacmartins in building an optimistic expense report based on the above comment, should we subtract the amount rather than increase it?

We have this glitch in the expense report

Screen.Recording.2023-05-11.at.22.06.44.mov

@luacmartins
Copy link
Contributor Author

Yes, we should do that

@melvin-bot
Copy link

melvin-bot bot commented May 12, 2023

🎯 ⚡️ Woah @mollfpr / @sobitneupane / @mollfpr, great job pushing this forwards! ⚡️

The pull request got merged within 2 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @mollfpr got assigned: 2023-05-10 21:41:41 Z
  • when the PR got merged: 2023-05-12 10:19:15 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@luacmartins luacmartins added the Reviewing Has a PR in review label May 15, 2023
@melvin-bot melvin-bot bot removed the Overdue label May 15, 2023
@luacmartins
Copy link
Contributor Author

PR merged

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 16, 2023
@melvin-bot melvin-bot bot changed the title [$1000] [Manual Requests] Ensure correct amount is displayed in the IOUPreview [HOLD for payment 2023-05-23] [$1000] [Manual Requests] Ensure correct amount is displayed in the IOUPreview May 16, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

If no regressions arise, payment will be issued on 2023-05-23. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

  • [@mollfpr / @sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
  • [@mollfpr / @sobitneupane] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@mollfpr / @sobitneupane] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@mollfpr / @sobitneupane] Determine if we should create a regression test for this bug.
  • [@mollfpr / @sobitneupane] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@mollfpr
Copy link
Contributor

mollfpr commented May 23, 2023

[@mollfpr / @sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr / @sobitneupane] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@mollfpr / @sobitneupane] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

Not a bug. This issue is another work for #18537.

[@mollfpr / @sobitneupane] Determine if we should create a regression test for this bug.
[@mollfpr / @sobitneupane] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Propose regression step.

  1. Go to the workspace report
  2. Request money using the action menu item
  3. Put any amount
  4. Submit the requested money
  5. Verify that the IOU preview is shown with a positive amount
  6. Verify that the amount on the Expense report that just added in LHN has a positive amount
  7. Navigate to the Expense report that just added
  8. Verify that the report header shows a positive amount
  9. Back to the workspace report and do request money again
  10. Verify again step 5, 6, and 8
  11. 👍 or 👎

@luacmartins
Copy link
Contributor Author

IMO we don't need regression steps for this case specifically. A negative amount is quite obvious and would get the testers attention.

@mollfpr
Copy link
Contributor

mollfpr commented May 23, 2023

Make sense to me!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 23, 2023
@trjExpensify
Copy link
Contributor

Alrighty, time to settle up here. Sorry for the delay, as I get back from EC3.

I've sent the following offers on this job:

@mollfpr - $1,500 for the fix & #urgency bonus
@sobitneupane - $1,500 for C+ & #urgency bonus

@trjExpensify
Copy link
Contributor

Settled up with @mollfpr. Awaiting @sobitneupane!

@sobitneupane
Copy link
Contributor

@trjExpensify I didn't review the PR. So, no payment for me.

@trjExpensify
Copy link
Contributor

Ah cool, got it. Thanks! Closing this out then. 👍

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
None yet
Development

No branches or pull requests

6 participants