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

Tax - Split scan - Unable to save tax amount when the tax amount does not exceed limit #42649

Closed
6 tasks done
lanitochka17 opened this issue May 27, 2024 · 8 comments
Closed
6 tasks done
Assignees
Labels
Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented May 27, 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.76-0
Reproducible in staging?: Y
Reproducible in production?: N
**If this was caught during regression testing, add the test name, ID and link from TestRail:**N/A
Issue reported by: Applause - Internal Team

Issue found when executing PR #40240

Action Performed:

Precondition:

  • Workspace is tax-enabled.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat
  3. Create a split scan expense
  4. While the receipt is scanning, click on the split preview
  5. Click Amount and enter amount
  6. Click Tax rate and select a non-zero tax rate
  7. Click Tax amount
  8. Click Save without modifying the current value

Expected Result:

Tax amount will be saved without issue

Actual Result:

User is unable to save the tax amount. It says "Maximum tax amount is 0.00", when the tax amount is updated according to the selected rate

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

Bug6493039_1716823322727.20240527_231712.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels May 27, 2024
Copy link

melvin-bot bot commented May 27, 2024

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

Copy link
Contributor

👋 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.

@lanitochka17
Copy link
Author

@srikarparsi 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

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-split

@cretadn22
Copy link
Contributor

Proposal

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

This is regression from this PR, We've overlooked updating transactionDetails across all places. @MonilBhavsar I'm reaching out to you because you authored the offending PR

What is the root cause of that problem?

When we update the split transaction, we save the data in splitDraftTransaction. However, we consistently rely on transaction to obtain the tax amount

taxAmount={getTaxAmount(transaction, taxRates, Boolean(backTo || isEditing))}

if (amountInSmallestCurrencyUnits === TransactionUtils.getTaxAmount(transaction, false)) {

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

In here and here

To ensure consistency, we ought to utilize transactionDetails instead of transaction, as transactionDetails will reflect splitDraftTransaction when editing the split transaction

const transactionDetails = ReportUtils.getTransactionDetails(isEditingSplitBill && !isEmptyObject(splitDraftTransaction) ? splitDraftTransaction : transaction);

What alternative solutions did you explore? (Optional)

We also manually use isEditingSplitBill ? splitDraftTransaction : transaction

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@bondydaa
Copy link
Contributor

the revert #42670 has been deployed, please retest and confirm this is no longer reproducible.

@kavimuru
Copy link

This bug is not reproduced because of #40755

20240528_095847.1.mp4

@MonilBhavsar MonilBhavsar removed DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels May 28, 2024
@MonilBhavsar
Copy link
Contributor

PR was reverted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants