Skip to content

[HOLD for payment 2025-01-13] Tax rate - System message does not show the correct tax rate when category has tax rate #54515

Closed

Description

@IuliiaHerets

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.78-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+kh03120001@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Windows 11
App Component: Money Requests

Action Performed:

Precondition:

  • Rules and Taxes are enabled.
  • There are three tax rates - A, B and C.
  • Tax rate A belongs to Workspace currency default.
  • Tax rate B belongs to Foreign currency default.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Categories.
  3. Click Advertising category.
  4. Click Default tax rate.
  5. Select Tax rate C.
  6. Go to workspace chat.
  7. Submit an expense in foreign currency, and with "Advertising" category from Step 3.
  8. Go to transaction thread.
  9. Click Category.
  10. Click on Advertising category to unselect it.
  11. Note that tax field shows Tax rate B, but the system message shows "changed the tax rate to Tax rate A".
  12. Click Category.
  13. Select any other category except Advertising.
  14. Note that tax field shows Tax rate B, but the system message shows "changed the tax rate to Tax rate A".

Expected Result:

In Step 11 and 14, the system message should correctly reflect the current state of selected tax rate.

Actual Result:

In Step 11 and 14, the system message shows that the tax rate is changed to Tax rate A, when the tax field shows that Tax rate B is selected.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6701713_1735034366618.bandicam_2024-12-24_17-54-15-171.1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @sakluger

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 24, 2024
  2. melvin-bot commented on Dec 24, 2024

    @melvin-bot

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

  3. melvin-bot commented on Dec 24, 2024

    @melvin-bot

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

  4. melvin-bot commented on Dec 24, 2024

    @melvin-bot

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

  5. github-actions commented on Dec 24, 2024

    @github-actions
    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.
  6. sakluger commented on Dec 24, 2024

    @sakluger
    Contributor

    Discussing in Slack.

  7. nkdengineer commented on Dec 25, 2024

    @nkdengineer
    Contributor

    Proposal

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

    In Step 11 and 14, the system message shows that the tax rate is changed to Tax rate A, when the tax field shows that Tax rate B is selected.

    What is the root cause of that problem?

    We always pass the defaultTaxRate param as policy?.taxRates?.defaultExternalID then the system message is updated wrongly

    const categoryTaxCode = getCategoryDefaultTaxRate(taxRules, category, policy?.taxRates?.defaultExternalID);

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

    We should use getDefaultTaxCode function that already handled the case foreign currency to get the correct default tax rate.

    const categoryTaxCode = getCategoryDefaultTaxRate(taxRules, category, getDefaultTaxCode(policy, transaction, getCurrency(transaction)));
    

    const categoryTaxCode = getCategoryDefaultTaxRate(taxRules, category, policy?.taxRates?.defaultExternalID);

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We need another test case for getCategoryTaxCodeAndAmount when the transaction currency is different with the policy currency and verify that the default tax rate will be the Foreign tax rate if it exists.

    What alternative solutions did you explore? (Optional)

    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.

  8. bernhardoj commented on Dec 26, 2024

    @bernhardoj
    Contributor

    I'm fixing it here

  9. 9 remaining items

  10. jasperhuangg commented on Dec 27, 2024

    @jasperhuangg
    Contributor

    @MonilBhavsar #54579 (comment) what about this comment? Or is that going to be a separate concern handled elsewhere?

  11. bernhardoj commented on Dec 28, 2024

    @bernhardoj
    Contributor

    @jasperhuangg I think #54513 is the only one that needs a BE fix. This issue is fully FE.

  12. sakluger commented on Jan 2, 2025

    @sakluger
    Contributor

    @bernhardoj, just to confirm, no additional payment is required for this issue, right?

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jan 6, 2025
  14. changed the title [-]Tax rate - System message does not show the correct tax rate when category has tax rate[/-] [+][HOLD for payment 2025-01-13] Tax rate - System message does not show the correct tax rate when category has tax rate[/+] on Jan 6, 2025
  15. melvin-bot commented on Jan 6, 2025

    @melvin-bot

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

  16. melvin-bot commented on Jan 6, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.80-6 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 2025-01-13. 🎊

  17. melvin-bot commented on Jan 6, 2025

    @melvin-bot

    @grgia @sakluger @grgia 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]

  18. bernhardoj commented on Jan 7, 2025

    @bernhardoj
    Contributor

    @sakluger yes, no payment here.

  19. sakluger commented on Jan 8, 2025

    @sakluger
    Contributor

    Perfect, thank you for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions