You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Exploratory] Tax rate - Default tax rate of different workspace shown in the other workspace expense #103305
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
Navigate to staging.new.expensify.com
Create an expense in selfDm
Click submit to my employer
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
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!
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:
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:
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.
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:
functiongetTaxRateTitle(translate: LocalizedTranslate,policy: OnyxEntry<Policy>,transaction: OnyxEntry<Transaction>,isMovingFromTrackExpense: boolean,policyForMovingExpenses?: OnyxEntry<Policy>,): string{constcurrentTaxName=getTaxName(translate,policy,transaction);if(currentTaxName){// If moving from track expense show the tax name from the moving policyif(isMovingFromTrackExpense&&!hasTaxRateWithMatchingValue(policy,transaction)){returngetTaxName(translate,policyForMovingExpenses,transaction)??'';}returngetTaxName(translate,policy,transaction,true)??'';}// If no tax name on current policy but moving from track expense, use the moving policyif(isMovingFromTrackExpense){returngetTaxName(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?
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).
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.
Activity
applause-bot commentedon Oct 7, 2026
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
melvin-bot commentedon Oct 21, 2026
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!
cocvn157 commentedon Nov 16, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user has two workspaces (
WS1andWS2) 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 inWS2still display the first workspace's (WS1) default tax rate (including its• Defaultlabel, resulting in two• Defaultentries inWS2's tax rate list) until the user manually selects a tax rate inWS2.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:
SelfDM track expenses are seeded with
policyForMovingExpenses(WS1) default tax, anduseTaxAmountholds backWS2's default when moving toWS2:TaxController(src/components/MoneyRequestConfirmationList/TaxController.tsx) anduseTaxAmount(src/components/MoneyRequestConfirmationList/hooks/useTaxAmount.ts:80) resolveworkspaceDefaultTaxCodefrompolicyForMovingExpenses(WS1) and writeWS1's defaulttaxCodeandtaxValueonto the transaction.isMovingTransactionFromTrackExpense === true) and choosesWS2(policy = WS2,policyForMovingExpenses = WS1),useTaxAmount.ts:136-138sets:WS1andWS2during the confirmation flow,TaxControllereither holds backWS2's default (shouldHoldBackDefault) or retainsWS1's default tax rate on the draft transaction.getTaxRateTitle(src/libs/TransactionUtils/tax.ts:306-328) formats the fallback tax rate againstpolicyForMovingExpenses(WS1), appendingWS1's• Defaultsuffix insideWS2's Tax Picker:src/libs/TransactionUtils/tax.ts:306-328:transaction.taxCodeholdsWS1's default tax code (which either doesn't exist inWS2or has a different value inWS2),getTaxRateTitlefalls back togetTaxName(translate, policyForMovingExpenses, transaction, ...).getTaxNamecallstransformedTaxRates(translate, policyForMovingExpenses, transaction)(src/libs/TransactionUtils/tax.ts:182-196), which appends• Default(${CONST.DOT_SEPARATOR} ${translate('common.default')}) whenevercode === defaultTaxCode()onpolicyForMovingExpenses(WS1)!"<WS1 Tax Name> (<WS1 % >) • Default") is then passed asselectedTaxRate={taxRateTitle}into<TaxPicker>(src/pages/iou/request/step/DynamicIOURequestStepTaxRatePage.tsx:76-94andsrc/components/MoneyRequestConfirmationList/sections/TaxFields.tsx:197-286).src/components/TaxPicker/index.tsx:111-128,selectedOptionsis built fromeffectiveSelectedTaxRate("<WS1 Tax Name> (<WS1 % >) • Default") and passed togetTaxRatesSection(src/libs/TaxOptionsListUtils.ts:242-262). Because thatmodifiedNamedoes not match any enabled tax rate inWS2,getTaxRatesSectionprepends it as a selected row at the top ofWS2's list—right aboveWS2's own<WS2 Tax Name> (<WS2 % >) • Default!What changes do you think we should make in order to solve the problem?
• DefaultfrompolicyForMovingExpenseswhen displaying a tax rate under a different destinationpolicy(src/libs/TransactionUtils/tax.ts):transformedTaxRates/getTaxName(src/libs/TransactionUtils/tax.ts:182-196and266-282), only append• Defaultwhen the policy being formatted is the active destination policy (or add an optionalshouldShowDefaultSuffix = trueparameter togetTaxName/transformedTaxRatesand passfalsewhengetTaxRateTitlefalls back topolicyForMovingExpenseswhilepolicy && policy.id !== policyForMovingExpenses?.id).policyForMovingExpenses(or when switching workspaces during the Submit flow):src/components/MoneyRequestConfirmationList/hooks/useTaxAmount.ts, whenisMovingTransactionFromTrackExpenseistrueandpolicy?.id !== policyForMovingExpenses?.id, if the transaction's arrived tax is simply the unmodified default tax ofpolicyForMovingExpenses(arrivedTax?.taxCode === getDefaultTaxCode(policyForMovingExpenses, transaction)andarrivedTax?.taxValue === getTaxValue(policyForMovingExpenses, transaction, arrivedTax?.taxCode ?? '')), or when the user switches the targetpolicyIDon the confirmation screen, allowTaxControllerto update the draft/transaction tax to the selected workspacepolicy'sworkspaceDefaultTaxCodeanddefaultTaxValue(and ingetTaxRateTitle, resolve againstpolicywhenpolicy?.tax?.trackingEnabledis true).WS2in Submit to my employer immediately showsWS2's default tax rate, and opening the Tax Picker inWS2shows onlyWS2's single• Defaulttax rate.What alternative solutions did you explore? (Optional)
• DefaultinTaxPicker/index.tsxwhen buildingselectedOptions: That would only hide the duplicate• Defaultbadge inside the picker, whileTaxFieldson the confirmation screen would still showWS1's default tax rate with• Defaultbefore opening the picker. Fixing bothgetTaxRateTitle/getTaxNameand the cross-workspace default resolution inuseTaxAmountkeeps the confirmation row and the picker consistent.expensify-chore-bot commentedon Nov 19, 2026
Whoops! This issue is 2 days overdue. Let's get this updated quick!
expensify-chore-bot commentedon Nov 23, 2026
Still overdue 6 days?! Let's take care of this!
expensify-chore-bot commentedon Nov 25, 2026
8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
expensify-chore-bot commentedon Nov 27, 2026
10 days overdue. I'm getting more depressed than Marvin.