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
[$250] [Merge] Expense - Tax is shown on merge confirmation page when destination WS has no taxes #83157
Version Number: 9.3.24-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#71244 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: MacBook Air 15.7.3 Chrome, Pixel 5 Android 14 App Component: Money Requests
changed the title [-]Expense - Tax is shown on merge confirmation page when destination WS has no taxes[/-][+][$250] Expense - Tax is shown on merge confirmation page when destination WS has no taxes[/+]on Feb 22, 2026
Please re-state the problem that we are trying to solve in this issue.
When merging two expenses where one comes from a workspace with taxes enabled and the other from a workspace with taxes disabled, the merge confirmation page incorrectly shows "Tax rate" and "Tax amount" fields even when the destination workspace has taxes disabled.
What is the root cause of that problem?
There are two contributing factors:
1. MoneyRequestView.tsx has a short-circuit that bypasses the policy tax check (MoneyRequestView.tsx:417):
The !!transaction?.taxName evaluates to true before isTaxTrackingEnabled can check the destination policy's tax.trackingEnabled setting. In the merge flow, the transaction is overridden by the merged transaction data (MoneyRequestView.tsx:209-211), which always carries taxName from the source transaction.
2. The merge data pipeline never filters out tax fields based on the destination policy's tax settings:
buildMergedTransactionData() unconditionally copies taxValue, taxAmount, taxCode, and taxName into the merged transaction (MergeTransactionUtils.ts:384-387)
Compare with the expense creation flow in MoneyRequestConfirmationList.tsx (line 360) which correctly uses only isTaxTrackingEnabled() without the taxName bypass.
What changes do you think we should make in order to solve the problem?
The fix should be in MoneyRequestView.tsx at the shouldShowTax computation. When the component is rendering a merge confirmation (i.e., mergeTransactionID is provided), the shouldShowTax check should rely on isTaxTrackingEnabled() rather than short-circuiting on !!transaction?.taxName. This ensures the destination policy's tax settings are respected.
Additionally, in MergeTransactionUtils.ts, getMergeFields() should exclude 'taxValue' from MERGE_FIELDS when the destination policy does not have tax tracking enabled (similar to how 'amount' is excluded for distance requests). This prevents the tax field from appearing in the details review step when it's irrelevant to the destination workspace.
What alternative solutions did you explore? (Optional)
An alternative would be to clear tax fields in buildMergedTransactionData() when the target policy has taxes disabled (setting taxName, taxCode, taxValue, taxAmount to empty/zero). However, this would be a downstream fix that masks the real issue — the merge flow should not present tax as a selectable/reviewable field at all when the destination workspace doesn't support taxes.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
Please re-state the problem that we are trying to solve in this issue.
When merging two expenses where the destination workspace has taxes disabled, the merge confirmation page incorrectly shows "Tax rate" and "Tax amount" fields.
What is the root cause of that problem?
buildMergedTransactionData unconditionally copies tax fields from the merge transaction, regardless of the destination workspace's tax settings:
This causes MoneyRequestView to display tax fields because shouldShowTax short-circuits with !!transaction?.taxName before checking the destination policy.
What changes do you think we should make in order to solve the problem?
Primary Solution
Pass the destination policy to buildMergedTransactionData and only include tax fields when taxes are enabled.
If the destination workspace has taxes disabled, the target transaction won't have taxCode, so tax fields won't be included in the merged result. This approach requires no signature changes.
🚨 Edited by proposal-police: This proposal was edited at 2026-02-23 13:15:03 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When merging expenses across workspaces, if the selected destination report belongs to a workspace with taxes disabled, the merge confirmation page still shows Tax rate and Tax amount.
Expected behavior is: tax fields should follow the destination workspace policy, so they should not be shown in this case.
What is the root cause of that problem?
There are 3 connected root causes in the current code:
MoneyRequestView can force tax visibility from transaction.taxName before policy checks.
updatedTransaction replaces transaction in merge flow, and shouldShowTax uses: !!transaction?.taxName || isTaxTrackingEnabled(...) So if merged data carries taxName, UI shows tax even when destination policy has tax disabled.
Confirmation page relies on target policy context, not the selected destination policy context. ConfirmationPage pulls/uses target policy and target report:
diff --git a/src/libs/actions/MergeTransaction.ts b/src/libs/actions/MergeTransaction.ts
index 0159bcb3cd5..b2d5e5d70ed 100644
--- a/src/libs/actions/MergeTransaction.ts+++ b/src/libs/actions/MergeTransaction.ts@@ -16,11 +16,11 @@ import {
} from '@libs/MergeTransactionUtils';
import type {MergeFieldKey, MergeTransactionUpdateValues} from '@libs/MergeTransactionUtils';
import Navigation from '@libs/Navigation/Navigation';
-import {isPaidGroupPolicy, isPolicyAdmin} from '@libs/PolicyUtils';+import {isPaidGroupPolicy, isPolicyAdmin, isTaxTrackingEnabled} from '@libs/PolicyUtils';
import {getIOUActionForReportID, getTrackExpenseActionableWhisper} from '@libs/ReportActionsUtils';
import {getReportOrDraftReport, getReportTransactions, getTransactionDetails, isCurrentUserSubmitter, isMoneyRequestReportEligibleForMerge, isReportManager} from '@libs/ReportUtils';
import CONST from '@src/CONST';
-import {isDistanceRequest, isTransactionPendingDelete} from '@src/libs/TransactionUtils';+import {isDistanceRequest, isPerDiemRequest, isTimeRequest, isTransactionPendingDelete} from '@src/libs/TransactionUtils';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {CardList, MergeTransaction, Policy, PolicyCategories, PolicyTagLists, Report, ReportNextStepDeprecated, Transaction, TransactionViolations} from '@src/types/onyx';
@@ -96,6 +96,7 @@ function setupMergeTransactionDataAndNavigate(
searchReports,
targetTransactionPolicy,
sourceTransactionPolicy,
+ targetTransactionPolicy,
);
if (!conflictFields.length) {
// If there are no conflict fields, we should set mergeable data and navigate to the confirmation page
@@ -223,6 +224,9 @@ function getOnyxTargetTransactionData({
}) {
let data: UpdateMoneyRequestData<UpdateMoneyRequestDataKeys>;
const isUnreportedExpense = !mergeTransaction.reportID || mergeTransaction.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
+ const isTaxSupportedByDestination = !policy+ ? true+ : isTaxTrackingEnabled(true, policy, isDistanceRequest(targetTransaction), isPerDiemRequest(targetTransaction), isTimeRequest(targetTransaction));
// Compare mergeTransaction with targetTransaction and remove fields with same values
const targetTransactionDetails = getTransactionDetails(targetTransaction);
@@ -231,6 +235,9 @@ function getOnyxTargetTransactionData({
if (!(DERIVED_MERGE_FIELDS as readonly string[]).includes(key)) {
return false;
}
+ if (!isTaxSupportedByDestination && (key === 'taxValue' || key === 'taxCode' || key === 'taxAmount')) {+ return false;+ }
const targetValue = getMergeFieldValue(targetTransactionDetails, targetTransaction, key as MergeFieldKey);
@@ -336,6 +343,9 @@ function mergeTransactionRequest({
// For both unreported expenses and expense reports, negate the display amount when storing
// This preserves the user's chosen sign while following the storage convention
const finalAmount = -mergeTransaction.amount;
+ const isTaxSupportedByDestination = !policy+ ? true+ : isTaxTrackingEnabled(true, policy, isDistanceRequest(targetTransaction), isPerDiemRequest(targetTransaction), isTimeRequest(targetTransaction));
// Call the merge transaction action
const params = {
@@ -357,8 +367,12 @@ function mergeTransactionRequest({
billable: mergeTransaction.billable,
reimbursable: mergeTransaction.reimbursable,
tag: mergeTransaction.tag,
- taxCode: mergeTransaction.taxCode,- taxPolicyID: mergeTransaction.taxPolicyID,+ ...(isTaxSupportedByDestination+ ? {+ taxCode: mergeTransaction.taxCode,+ taxPolicyID: mergeTransaction.taxPolicyID,+ }+ : {}),
receiptID: mergeTransaction.receipt?.receiptID,
reportID: mergeTransaction.reportID,
};
Tests will also be added to cover cross-workspace merge where destination workspace has taxes disabled.
Video demo of the fix:
tax-invisible-for-ws-disabled.webm
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Alternative 1:
I explored a minimal strong subset fix that is smaller than the full hardening approach, but still reliably fixes this issue’s repro path. This alternative is different from other proposals that only change MoneyRequestView or only change merged preview data. It fixes all confirmation-path root causes together: destination policy context + merge-specific tax visibility + preview tax gating.
Use destination report/policy from merge selection in useMergeTransactions and expose it to callers.
changed the title [-][Due for payment 2026-04-20] [$250] [Merge] Expense - Tax is shown on merge confirmation page when destination WS has no taxes[/-][+][$250] [Merge] Expense - Tax is shown on merge confirmation page when destination WS has no taxes[/+]on Apr 21, 2026
Activity
melvin-bot commentedon Feb 22, 2026
Triggered auto assignment to @heyjennahay (
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.melvin-bot commentedon Feb 22, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (
External)[-]Expense - Tax is shown on merge confirmation page when destination WS has no taxes[/-][+][$250] Expense - Tax is shown on merge confirmation page when destination WS has no taxes[/+]melvin-bot commentedon Feb 22, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022025522339194621554
MelvinBot commentedon Feb 22, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When merging two expenses where one comes from a workspace with taxes enabled and the other from a workspace with taxes disabled, the merge confirmation page incorrectly shows "Tax rate" and "Tax amount" fields even when the destination workspace has taxes disabled.
What is the root cause of that problem?
There are two contributing factors:
1.
MoneyRequestView.tsxhas a short-circuit that bypasses the policy tax check (MoneyRequestView.tsx:417):The
!!transaction?.taxNameevaluates totruebeforeisTaxTrackingEnabledcan check the destination policy'stax.trackingEnabledsetting. In the merge flow, thetransactionis overridden by the merged transaction data (MoneyRequestView.tsx:209-211), which always carriestaxNamefrom the source transaction.2. The merge data pipeline never filters out tax fields based on the destination policy's tax settings:
MERGE_FIELDSalways includes'taxValue'(MergeTransactionUtils.ts:41) — no policy tax-enablement checkgetMergeFields()only excludes'amount'for distance requests, never tax fields (MergeTransactionUtils.ts:167-176)buildMergedTransactionData()unconditionally copiestaxValue,taxAmount,taxCode, andtaxNameinto the merged transaction (MergeTransactionUtils.ts:384-387)Compare with the expense creation flow in
MoneyRequestConfirmationList.tsx(line 360) which correctly uses onlyisTaxTrackingEnabled()without thetaxNamebypass.What changes do you think we should make in order to solve the problem?
The fix should be in
MoneyRequestView.tsxat theshouldShowTaxcomputation. When the component is rendering a merge confirmation (i.e.,mergeTransactionIDis provided), theshouldShowTaxcheck should rely onisTaxTrackingEnabled()rather than short-circuiting on!!transaction?.taxName. This ensures the destination policy's tax settings are respected.Additionally, in
MergeTransactionUtils.ts,getMergeFields()should exclude'taxValue'fromMERGE_FIELDSwhen the destination policy does not have tax tracking enabled (similar to how'amount'is excluded for distance requests). This prevents the tax field from appearing in the details review step when it's irrelevant to the destination workspace.What alternative solutions did you explore? (Optional)
An alternative would be to clear tax fields in
buildMergedTransactionData()when the target policy has taxes disabled (settingtaxName,taxCode,taxValue,taxAmountto empty/zero). However, this would be a downstream fix that masks the real issue — the merge flow should not present tax as a selectable/reviewable field at all when the destination workspace doesn't support taxes.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.imadirtydog commentedon Feb 22, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When merging two expenses where the destination workspace has taxes disabled, the merge confirmation page incorrectly shows "Tax rate" and "Tax amount" fields.
What is the root cause of that problem?
buildMergedTransactionDataunconditionally copies tax fields from the merge transaction, regardless of the destination workspace's tax settings:App/src/libs/MergeTransactionUtils.ts
Lines 386 to 389 in 97b8ca7
This causes
MoneyRequestViewto display tax fields becauseshouldShowTaxshort-circuits with!!transaction?.taxNamebefore checking the destination policy.What changes do you think we should make in order to solve the problem?
Primary Solution
Pass the destination policy to
buildMergedTransactionDataand only include tax fields when taxes are enabled.1. Update function signature:
App/src/libs/MergeTransactionUtils.ts
Line 357 in 97b8ca7
2. Conditionally include tax fields:
3. Update call site:
App/src/pages/TransactionMerge/ConfirmationPage.tsx
Line 69 in 97b8ca7
Secondary Solution (if changing function signature is not desired)
Only include tax fields if the target transaction already has tax data:
App/src/libs/MergeTransactionUtils.ts
Lines 386 to 389 in 97b8ca7
If the destination workspace has taxes disabled, the target transaction won't have
taxCode, so tax fields won't be included in the merged result. This approach requires no signature changes.marufsharifi commentedon Feb 23, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-02-23 13:15:03 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When merging expenses across workspaces, if the selected destination report belongs to a workspace with taxes disabled, the merge confirmation page still shows
Tax rateandTax amount.Expected behavior is: tax fields should follow the destination workspace policy, so they should not be shown in this case.
What is the root cause of that problem?
There are 3 connected root causes in the current code:
MoneyRequestViewcan force tax visibility fromtransaction.taxNamebefore policy checks.App/src/components/ReportActionItem/MoneyRequestView.tsx
Lines 206 to 211 in 4c3e83e
App/src/components/ReportActionItem/MoneyRequestView.tsx
Line 417 in 4c3e83e
updatedTransactionreplacestransactionin merge flow, andshouldShowTaxuses:!!transaction?.taxName || isTaxTrackingEnabled(...)So if merged data carriestaxName, UI shows tax even when destination policy has tax disabled.ConfirmationPagepulls/uses target policy and target report:App/src/pages/TransactionMerge/ConfirmationPage.tsx
Lines 45 to 51 in 4c3e83e
App/src/pages/TransactionMerge/ConfirmationPage.tsx
Line 46 in 4c3e83e
App/src/pages/TransactionMerge/ConfirmationPage.tsx
Lines 51 to 52 in 4c3e83e
App/src/pages/TransactionMerge/ConfirmationPage.tsx
Lines 69 to 70 in 4c3e83e
App/src/pages/TransactionMerge/ConfirmationPage.tsx
Line 88 in 4c3e83e
MoneyRequestViewgets target policy/report:App/src/pages/TransactionMerge/ConfirmationPage.tsx
Lines 139 to 142 in 0afbe9c
Tax is always part of merge fields and can flow through preview + payload:
MERGE_FIELDSincludestaxValue:App/src/libs/MergeTransactionUtils.ts
Line 41 in 0afbe9c
getMergeFields()only excludesamountfor distance, not tax by destination policy:App/src/libs/MergeTransactionUtils.ts
Lines 167 to 175 in 0afbe9c
buildMergedTransactionData()always copies tax fields:App/src/libs/MergeTransactionUtils.ts
Lines 384 to 387 in 0afbe9c
taxCode/taxPolicyID:App/src/libs/actions/MergeTransaction.ts
Lines 360 to 361 in 0afbe9c
So the issue is not only display logic; the merge flow is not consistently destination-policy-aware for tax behavior.
What changes do you think we should make in order to solve the problem?
App/src/pages/TransactionMerge/ConfirmationPage.tsx
Lines 46 to 52 in d59cda4
taxNameshort-circuit and rely on policy in merge flow.App/src/components/ReportActionItem/MoneyRequestView.tsx
Line 417 in d59cda4
App/src/libs/MergeTransactionUtils.ts
Lines 167 to 175 in d59cda4
App/src/libs/actions/MergeTransaction.ts
Lines 360 to 361 in d59cda4
Video demo of the fix:tax-invisible-for-ws-disabled.webm
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
I explored a minimal strong subset fix that is smaller than the full hardening approach, but still reliably fixes this issue’s repro path. This alternative is different from other proposals that only change
MoneyRequestViewor only change merged preview data. It fixes all confirmation-path root causes together: destination policy context + merge-specific tax visibility + preview tax gating.useMergeTransactionsand expose it to callers.App/src/hooks/useMergeTransactions.ts
Lines 65 to 90 in c1c51b4
ConfirmationPage, switch from target policy/report to destination policy/report for preview and merge request context.App/src/pages/TransactionMerge/ConfirmationPage.tsx
Lines 46 to 52 in 3485850
MoneyRequestView, make tax visibility merge-specific (do not short-circuit ontaxNamein merge flow).App/src/components/ReportActionItem/MoneyRequestView.tsx
Line 417 in b889707
buildMergedTransactionData, gate tax fields by destination policy support.App/src/libs/MergeTransactionUtils.ts
Lines 355 to 387 in 3485850
71 remaining items
melvin-bot commentedon Apr 20, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Apr 20, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
dominictb commentedon Apr 21, 2026
@MelvinBot Can you help to remove "[Due for payment 2026-04-20] " from this issue title?
[-][Due for payment 2026-04-20] [$250] [Merge] Expense - Tax is shown on merge confirmation page when destination WS has no taxes[/-][+][$250] [Merge] Expense - Tax is shown on merge confirmation page when destination WS has no taxes[/+]MelvinBot commentedon Apr 21, 2026
✅ Done — removed
[Due for payment 2026-04-20]from the title.dominictb commentedon Apr 21, 2026
This is completed. There're a few ongoing follow-ups that'd be tracked in the main Merge project tracking issue.