Skip to content

[Exploratory] Tax rate - Default tax rate of different workspace shown in the other workspace expense #103305

Open

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.4-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #101572
Email or phone of affected tester (no customers): testpayment935@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 11 pro /Chrome
App Component: Money Requests

Action Performed:

Precondition - Have 2 workspace with different tax rate default value

  1. Navigate to staging.new.expensify.com
  2. Create an expense in selfDm
  3. Click submit to my employer
  4. Choose one of the WS and go to tax option ( check by choosing both WS)

Expected Result:

There should be only 1 default tax rate available in each workspace

Actual Result:

The second workspace still show the first workspace tax rate value until selecting the real tax rate value of the expense

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7279566_1791337463956.bandicam_2026-10-07_04-33-10-301.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Nathan Lemma
Bug ID: 7279566

Activity

  1. applause-bot commented on Oct 7, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/4a9f4e474d898ce7da3dd4dc49d358946cf36ab998a54a56b393155cdb53bcc8

  2. added
    Bug
    on Oct 12, 2026
  3. melvin-bot commented on Oct 21, 2026

    @melvin-bot

    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!

  4. cocvn157 commented on Nov 16, 2026

    @cocvn157

    Proposal

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

    When a user has two workspaces (WS1 and WS2) with different default tax rates, creates an expense in selfDM, clicks Submit to my employer, and selects the second workspace (WS2), the expense confirmation page and the Tax Rate picker in WS2 still display the first workspace's (WS1) default tax rate (including its • Default label, resulting in two • Default entries in WS2's tax rate list) until the user manually selects a tax rate in WS2.

    What is the root cause of that problem?

    There are two connected causes in the track-expense creation and move-to-workspace tax resolution flow:

    1. SelfDM track expenses are seeded with policyForMovingExpenses (WS1) default tax, and useTaxAmount holds back WS2's default when moving to WS2:

      • When creating an expense in selfDM, TaxController (src/components/MoneyRequestConfirmationList/TaxController.tsx) and useTaxAmount (src/components/MoneyRequestConfirmationList/hooks/useTaxAmount.ts:80) resolve workspaceDefaultTaxCode from policyForMovingExpenses (WS1) and write WS1's default taxCode and taxValue onto the transaction.
      • When the user clicks Submit to my employer (isMovingTransactionFromTrackExpense === true) and chooses WS2 (policy = WS2, policyForMovingExpenses = WS1), useTaxAmount.ts:136-138 sets:
        const isKeepingArrivedTax = isMovingTransactionFromTrackExpense && !categoryTaxCode;
        const shouldHoldBackDefault = isKeepingArrivedTax && !hasCategoryRuleApplied;
        And if the user switches between WS1 and WS2 during the confirmation flow, TaxController either holds back WS2's default (shouldHoldBackDefault) or retains WS1's default tax rate on the draft transaction.
    2. getTaxRateTitle (src/libs/TransactionUtils/tax.ts:306-328) formats the fallback tax rate against policyForMovingExpenses (WS1), appending WS1's • Default suffix inside WS2's Tax Picker:

      • In src/libs/TransactionUtils/tax.ts:306-328:
        function getTaxRateTitle(
            translate: LocalizedTranslate,
            policy: OnyxEntry<Policy>,
            transaction: OnyxEntry<Transaction>,
            isMovingFromTrackExpense: boolean,
            policyForMovingExpenses?: OnyxEntry<Policy>,
        ): string {
            const currentTaxName = getTaxName(translate, policy, transaction);
        
            if (currentTaxName) {
                // If moving from track expense show the tax name from the moving policy
                if (isMovingFromTrackExpense && !hasTaxRateWithMatchingValue(policy, transaction)) {
                    return getTaxName(translate, policyForMovingExpenses, transaction) ?? '';
                }
                return getTaxName(translate, policy, transaction, true) ?? '';
            }
        
            // If no tax name on current policy but moving from track expense, use the moving policy
            if (isMovingFromTrackExpense) {
                return getTaxName(translate, policyForMovingExpenses, transaction, true) ?? '';
            }
        
            return '';
        }
      • Because transaction.taxCode holds WS1's default tax code (which either doesn't exist in WS2 or has a different value in WS2), getTaxRateTitle falls back to getTaxName(translate, policyForMovingExpenses, transaction, ...).
      • getTaxName calls transformedTaxRates(translate, policyForMovingExpenses, transaction) (src/libs/TransactionUtils/tax.ts:182-196), which appends • Default (${CONST.DOT_SEPARATOR} ${translate('common.default')}) whenever code === defaultTaxCode() on policyForMovingExpenses (WS1)!
      • That string ("<WS1 Tax Name> (<WS1 % >) • Default") is then passed as selectedTaxRate={taxRateTitle} into <TaxPicker> (src/pages/iou/request/step/DynamicIOURequestStepTaxRatePage.tsx:76-94 and src/components/MoneyRequestConfirmationList/sections/TaxFields.tsx:197-286).
      • Inside src/components/TaxPicker/index.tsx:111-128, selectedOptions is built from effectiveSelectedTaxRate ("<WS1 Tax Name> (<WS1 % >) • Default") and passed to getTaxRatesSection (src/libs/TaxOptionsListUtils.ts:242-262). Because that modifiedName does not match any enabled tax rate in WS2, getTaxRatesSection prepends it as a selected row at the top of WS2's list—right above WS2's own <WS2 Tax Name> (<WS2 % >) • Default!

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

    1. Do not append • Default from policyForMovingExpenses when displaying a tax rate under a different destination policy (src/libs/TransactionUtils/tax.ts):
      • In transformedTaxRates / getTaxName (src/libs/TransactionUtils/tax.ts:182-196 and 266-282), only append • Default when the policy being formatted is the active destination policy (or add an optional shouldShowDefaultSuffix = true parameter to getTaxName / transformedTaxRates and pass false when getTaxRateTitle falls back to policyForMovingExpenses while policy && policy.id !== policyForMovingExpenses?.id).
    2. Apply the selected workspace's default tax rate when moving a selfDM expense whose tax was only auto-defaulted from policyForMovingExpenses (or when switching workspaces during the Submit flow):
      • In src/components/MoneyRequestConfirmationList/hooks/useTaxAmount.ts, when isMovingTransactionFromTrackExpense is true and policy?.id !== policyForMovingExpenses?.id, if the transaction's arrived tax is simply the unmodified default tax of policyForMovingExpenses (arrivedTax?.taxCode === getDefaultTaxCode(policyForMovingExpenses, transaction) and arrivedTax?.taxValue === getTaxValue(policyForMovingExpenses, transaction, arrivedTax?.taxCode ?? '')), or when the user switches the target policyID on the confirmation screen, allow TaxController to update the draft/transaction tax to the selected workspace policy's workspaceDefaultTaxCode and defaultTaxValue (and in getTaxRateTitle, resolve against policy when policy?.tax?.trackingEnabled is true).
      • This ensures that choosing WS2 in Submit to my employer immediately shows WS2's default tax rate, and opening the Tax Picker in WS2 shows only WS2's single • Default tax rate.

    What alternative solutions did you explore? (Optional)

    • Filtering out • Default in TaxPicker/index.tsx when building selectedOptions: That would only hide the duplicate • Default badge inside the picker, while TaxFields on the confirmation screen would still show WS1's default tax rate with • Default before opening the picker. Fixing both getTaxRateTitle/getTaxName and the cross-workspace default resolution in useTaxAmount keeps the confirmation row and the picker consistent.
  5. expensify-chore-bot commented on Nov 19, 2026

    @expensify-chore-bot

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

  6. expensify-chore-bot commented on Nov 23, 2026

    @expensify-chore-bot

    Still overdue 6 days?! Let's take care of this!

  7. expensify-chore-bot commented on Nov 25, 2026

    @expensify-chore-bot

    8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  8. expensify-chore-bot commented on Nov 27, 2026

    @expensify-chore-bot

    10 days overdue. I'm getting more depressed than Marvin.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDailyNot a priorityOverdue

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions