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 2024-07-24] [$250] Expense - Payment buttons show different amount for report consisting of submitted & tracked expense #44158

Closed
6 tasks done
m-natarajan opened this issue Jun 21, 2024 · 31 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 Jun 21, 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: 9.0.0.0
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: Applause internal team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit an expense ($200).
  4. Track an expense ($100).
  5. Look at the amount on the payment button in expense preview in the main chat and expense report.

Expected Result:

The amount on the payment button in expense preview in the main chat and expense report should be the same.

Actual Result:

The amount on the payment button in expense preview in the main chat and expense report are different.
Main chat shows $300.
Expense report shows $200.

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

Bug6520331_1718960940842.20240621_170327.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019e4af48063736ac0
  • Upwork Job ID: 1805264313238989971
  • Last Price Increase: 2024-06-24
Issue OwnerCurrent Issue Owner: @slafortune
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

@m-natarajan
Copy link
Author

@slafortune FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@m-natarajan
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@bernhardoj
Copy link
Contributor

bernhardoj commented Jun 21, 2024

Proposal

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

The amount in report preview button and in expense report button is different.

What is the root cause of that problem?

In report preview, we always use the total amount of the expense.

const getDisplayAmount = (): string => {
if (totalDisplaySpend) {
return CurrencyUtils.convertToDisplayString(totalDisplaySpend, iouReport?.currency);
}

In expense report header, we use the reimbursableSpend for the amount.

const formattedAmount = CurrencyUtils.convertToDisplayString(reimbursableSpend, moneyRequestReport.currency);

The expense report header also have more condition to show the amount, for example, if there is an held expense, then we only show the non-hold amount.

const displayedAmount = ReportUtils.hasHeldExpenses(moneyRequestReport.reportID) && canAllowSettlement ? nonHeldAmount : formattedAmount;

But if every expense are held, then we don't show the amount.

formattedAmount={!ReportUtils.hasOnlyHeldExpenses(moneyRequestReport.reportID) ? displayedAmount : ''}

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

To make it consistent, we can follow the condition/logic from the expense report header. We will create a new function called getSettlementAmount which will use the reimbursableSpend as the amount and take the other condition from the expense report header.

const getSettlementAmount = () => {
    if all is on hold: return empty
    if has held expense and allow settlement: return non held amount
    
    return CurrencyUtils.convertToDisplayString(reimbursableSpend, iouReport?.currency);
}

Also, I found that it's possible that the amount is 0 when we have 1 submitted expense and 1 tracked expense and hold the submitted expense. The non-held amount in this case will be -0. If we don't want to show 0, then we can return an empty string if it's 0.

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@slafortune slafortune added the External Added to denote the issue can be worked on by a contributor label Jun 24, 2024
@melvin-bot melvin-bot bot changed the title Expense - Payment buttons show different amount for report consisting of submitted & tracked expense [$250] Expense - Payment buttons show different amount for report consisting of submitted & tracked expense Jun 24, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

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

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

melvin-bot bot commented Jun 24, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jun 24, 2024
@slafortune slafortune moved this to Release 1: Spring 2024 (May) in [#whatsnext] #wave-collect Jun 24, 2024
@thesahindia
Copy link
Member

thesahindia commented Jun 27, 2024

@bernhardoj's proposal looks good to me!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 27, 2024

Triggered auto assignment to @dangrous, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@dangrous
Copy link
Contributor

whattt I thought I posted a comment here yesterday. Well, it said basically:

This proposal makes sense! But, I want to confirm internally to make sure there's not a specific reason that these DON'T currently match (like, from an accounting or other perspective). I've asked in Slack and should hear back soon! (internal link: https://expensify.slack.com/archives/C03U7DCU4/p1719527792898199)

@dangrous
Copy link
Contributor

dangrous commented Jul 1, 2024

reasked, that was a bad time to do it I think. Hopefully will have an answer soon! If I hear nothing, I think we can move forward because to me it seems to make sense that they should match.

@melvin-bot melvin-bot bot added the Overdue label Jul 1, 2024
@dangrous
Copy link
Contributor

dangrous commented Jul 1, 2024

rude, melvin.

@dangrous dangrous removed the Overdue label Jul 1, 2024
@melvin-bot melvin-bot bot added the Overdue label Jul 1, 2024
@dangrous
Copy link
Contributor

dangrous commented Jul 2, 2024

Okay after discussing internally, we're closing this out as expected behavior - thanks so much for the proposal and review @thesahindia and @bernhardoj

Basically the thought is the preview shows all charges, the pay button only shows what you can actually pay currently, and so both serve different purposes.

@dangrous dangrous closed this as completed Jul 2, 2024
@github-project-automation github-project-automation bot moved this from Release 1: Spring 2024 (May) to Done in [#whatsnext] #wave-collect Jul 2, 2024
@melvin-bot melvin-bot bot removed the Overdue label Jul 2, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jul 4, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @thesahindia

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 17, 2024
@melvin-bot melvin-bot bot changed the title [$250] Expense - Payment buttons show different amount for report consisting of submitted & tracked expense [HOLD for payment 2024-07-24] [$250] Expense - Payment buttons show different amount for report consisting of submitted & tracked expense Jul 17, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

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

Copy link

melvin-bot bot commented Jul 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 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 2024-07-24. 🎊

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

  • @bernhardoj requires payment through NewDot Manual Requests
  • @thesahindia requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented Jul 17, 2024

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:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] 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:
  • [@thesahindia] 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:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] 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.
  • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jul 23, 2024
@dangrous
Copy link
Contributor

not overdue, payment tomorrow.

@bernhardoj
Copy link
Contributor

Requested in ND.

Copy link

melvin-bot bot commented Jul 24, 2024

Payment Summary

Upwork Job

BugZero Checklist (@slafortune)

  • 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/1805264313238989971/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@slafortune
Copy link
Contributor

@bernhardoj can you please complete the checklist?

@melvin-bot melvin-bot bot removed the Overdue label Jul 24, 2024
@bernhardoj
Copy link
Contributor

@slafortune @thesahindia is the C+ here.

@slafortune
Copy link
Contributor

Ah yes - sorry about that!

@thesahindia can you please complete the checklist?

@slafortune
Copy link
Contributor

@bernhardoj role Contributor - owed $250 via NewDot
@thesahindia role C+ - owed $250 via NewDot

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@melvin-bot melvin-bot bot added the Overdue label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

@dangrous, @slafortune, @bernhardoj, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@thesahindia
Copy link
Member

It was like this from the beginning.

If we want we can add a test case, here are the steps:-

  1. Go to a workspace chat
  2. Click at the "+" icon
  3. Click on "Submit expense" > Fill the details
  4. Click at "+" icon again
  5. Click on "Track expense" > Fill the details
  6. Verify the report preview pay button shows the submitted expense amount and doesn't include the track amount

@slafortune
Copy link
Contributor

cc - @JmillsExpensify
@thesahindia role C+ - owed $250 via NewDot

@melvin-bot melvin-bot bot removed the Overdue label Jul 30, 2024
@JmillsExpensify
Copy link

$250 approved for @thesahindia

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
Archived in project
Development

No branches or pull requests

6 participants