Skip to content

[$250] [Merge] Expense - Tax is shown on merge confirmation page when destination WS has no taxes #83157

Closed

Description

@jponikarchuk

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

Action Performed:

  1. Sign in to ND
  2. Create Workspace 1, enable Taxes, add tax rate 10%
  3. Create Workspace 2, Taxes are disabled
  4. Add Expense 1 in the workspace 1 chat, select tax rate 10%, rename the report for the convenience
  5. Create Expense 2 in the workspace 2 chat
  6. Navigate to the Workspace 1 chat, open Expense 1
  7. Click More - Merge, select Expense 2 from Workspace 2
  8. Select Amount, merchant, category, and report of the Expense 2, click Continue
  9. Observe the confirmation page

Expected Result:

In review details step, Tax field does not show , as it's auto selected depending on destination report (#71244 Test 3 Step 1)

Actual Result:

Tax rate and Tax amount fields are shown on merge confirmation page, when destination WS has no taxes

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022025522339194621554
  • Upwork Job ID: 2025522339194621554
  • Last Price Increase: 2026-02-22

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 22, 2026
  2. melvin-bot commented on Feb 22, 2026

    @melvin-bot

    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.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 22, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 22, 2026
  5. melvin-bot commented on Feb 22, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)

  6. 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
  7. melvin-bot commented on Feb 22, 2026

    @melvin-bot
  8. MelvinBot commented on Feb 22, 2026

    @MelvinBot
    Contributor

    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.tsx has a short-circuit that bypasses the policy tax check (MoneyRequestView.tsx:417):

    shouldShowTax = !!transaction?.taxName || isTaxTrackingEnabled(...)
    

    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:

    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.

  9. imadirtydog commented on Feb 22, 2026

    @imadirtydog

    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?

    buildMergedTransactionData unconditionally copies tax fields from the merge transaction, regardless of the destination workspace's tax settings:

    taxCode: mergeTransaction.taxCode,
    taxName: mergeTransaction.taxName,
    };
    }

    taxValue: mergeTransaction.taxValue,
    taxAmount: mergeTransaction.taxAmount,
    taxCode: mergeTransaction.taxCode,
    taxName: mergeTransaction.taxName,

    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.

    1. Update function signature:

    function buildMergedTransactionData(
        targetTransaction: OnyxEntry<Transaction>,
        mergeTransaction: OnyxEntry<MergeTransaction>,
        targetPolicy?: OnyxEntry<Policy>
    ): Transaction | null {

    2. Conditionally include tax fields:

    const isTaxEnabled = targetPolicy?.tax?.trackingEnabled;
    
    return {
        ...targetTransaction,
        // ... existing fields ...
        taxValue: isTaxEnabled ? mergeTransaction.taxValue : undefined,
        taxAmount: isTaxEnabled ? mergeTransaction.taxAmount : undefined,
        taxCode: isTaxEnabled ? mergeTransaction.taxCode : undefined,
        taxName: isTaxEnabled ? mergeTransaction.taxName : undefined,
    };

    3. Update call site:

    const mergedTransactionData = buildMergedTransactionData(targetTransaction, mergeTransaction);

    const mergedTransactionData = buildMergedTransactionData(targetTransaction, mergeTransaction, targetTransactionPolicy);

    Secondary Solution (if changing function signature is not desired)

    Only include tax fields if the target transaction already has tax data:

    taxCode: mergeTransaction.taxCode,
    taxName: mergeTransaction.taxName,
    };
    }

    taxValue: targetTransaction.taxCode ? mergeTransaction.taxValue : undefined,
    taxAmount: targetTransaction.taxCode ? mergeTransaction.taxAmount : undefined,
    taxCode: targetTransaction.taxCode ? mergeTransaction.taxCode : undefined,
    taxName: targetTransaction.taxCode ? mergeTransaction.taxName : undefined,

    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.

  10. marufsharifi commented on Feb 23, 2026

    @marufsharifi
    Contributor

    🚨 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:

    1. MoneyRequestView can force tax visibility from transaction.taxName before policy checks.
      const isFromMergeTransaction = !!mergeTransactionID;
      const linkedTransactionID = parentReportAction && isMoneyRequestAction(parentReportAction) ? getOriginalMessage(parentReportAction)?.IOUTransactionID : undefined;
      let [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${getNonEmptyStringOnyxID(linkedTransactionID)}`, {canBeMissing: true});
      if (updatedTransaction) {
      transaction = updatedTransaction;
      }

      const shouldShowTax = !!transaction?.taxName || isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest);

      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.
    2. Confirmation page relies on target policy context, not the selected destination policy context.
      ConfirmationPage pulls/uses target policy and target report:
      const [mergeTransaction, mergeTransactionMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.MERGE_TRANSACTION}${getNonEmptyStringOnyxID(transactionID)}`, {canBeMissing: true});
      const {targetTransaction, sourceTransaction, targetTransactionReport, targetTransactionPolicy} = useMergeTransactions({mergeTransaction});
      const [allTransactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {
      canBeMissing: false,
      });
      const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
    3. Merge pipeline does not gate tax fields by destination-tax support.
      Tax is always part of merge fields and can flow through preview + payload:
      • MERGE_FIELDS includes taxValue:
        const MERGE_FIELDS = ['amount', 'merchant', 'created', 'category', 'tag', 'description', 'taxValue', 'reimbursable', 'billable', 'attendees', 'reportID'] as const;
      • getMergeFields() only excludes amount for distance, not tax by destination policy:
        function getMergeFields(targetTransaction: OnyxEntry<Transaction>) {
        const excludeFields: MergeFieldKey[] = [];
        // Distance request's amount/currency/receipt depend on merchant selection
        if (isDistanceRequest(targetTransaction)) {
        excludeFields.push('amount');
        }
        return MERGE_FIELDS.filter((field) => !excludeFields.includes(field));
      • buildMergedTransactionData() always copies tax fields:
        taxValue: mergeTransaction.taxValue,
        taxAmount: mergeTransaction.taxAmount,
        taxCode: mergeTransaction.taxCode,
        taxName: mergeTransaction.taxName,
      • Merge API params always include taxCode/taxPolicyID:
        taxCode: mergeTransaction.taxCode,
        taxPolicyID: mergeTransaction.taxPolicyID,

    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?

    1. For the destination-policy mismatch in merge confirmation, use destination report/policy context (not always target context).
      const {targetTransaction, sourceTransaction, targetTransactionReport, targetTransactionPolicy} = useMergeTransactions({mergeTransaction});
      const [allTransactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {
      canBeMissing: false,
      });
      const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
      const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
    diff --git a/src/hooks/useMergeTransactions.ts b/src/hooks/useMergeTransactions.ts
    index 619132aae3c..b65cce4037b 100644
    --- a/src/hooks/useMergeTransactions.ts
    +++ b/src/hooks/useMergeTransactions.ts
    @@ -3,6 +3,7 @@ import {useSearchContext} from '@components/Search/SearchContext';
     import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
     import {getReportIDForExpense, getTransactionFromMergeTransaction} from '@libs/MergeTransactionUtils';
     import {isExpenseUnreported} from '@libs/TransactionUtils';
    +import CONST from '@src/CONST';
     import ONYXKEYS from '@src/ONYXKEYS';
     import type {MergeTransaction, Policy, Report, SearchResults, Transaction} from '@src/types/onyx';
     import useOnyx from './useOnyx';
    @@ -19,6 +20,8 @@ type UseMergeTransactionsReturn = {
         sourceTransactionReport?: Report;
         targetTransactionPolicy?: Policy;
         sourceTransactionPolicy?: Policy;
    +    destinationTransactionReport?: Report;
    +    destinationTransactionPolicy?: Policy;
     };
    @@ -70,16 +73,33 @@ function useMergeTransactions({mergeTransaction}: UseMergeTransactionsProps): Us
         let [sourceTransactionPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(sourceTransactionPolicyID)}`, {
             canBeMissing: true,
         });
    +    const destinationTransactionReportID = mergeTransaction?.reportID;
    +    let [destinationTransactionReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(destinationTransactionReportID)}`, {
    +        canBeMissing: true,
    +    });
    +    const destinationTransactionPolicyID = mergeTransaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID ? policyForMovingExpensesID : destinationTransactionReport?.policyID;
    +    let [destinationTransactionPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(destinationTransactionPolicyID)}`, {
    +        canBeMissing: true,
    +    });
    
         if (currentSearchHash && currentSearchResults?.data) {
             // If we're on search and main collection reports are not available, get them from the search snapshot
             targetTransactionReport = targetTransactionReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${targetTransactionReportID}`];
             sourceTransactionReport = sourceTransactionReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${sourceTransactionReportID}`];
    +        if (destinationTransactionReportID && destinationTransactionReportID !== CONST.REPORT.UNREPORTED_REPORT_ID) {
    +            destinationTransactionReport = destinationTransactionReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${destinationTransactionReportID}`];
    +        }
             // If we're on search, search snapshot policies are more up to date
             targetTransactionPolicy = currentSearchResults?.data[`${ONYXKEYS.COLLECTION.POLICY}${targetTransactionPolicyID}`];
             sourceTransactionPolicy = currentSearchResults?.data[`${ONYXKEYS.COLLECTION.POLICY}${sourceTransactionPolicyID}`];
    +        if (destinationTransactionPolicyID) {
    +            destinationTransactionPolicy = currentSearchResults?.data[`${ONYXKEYS.COLLECTION.POLICY}${destinationTransactionPolicyID}`];
    +        }
         }
    
    +    const selectedDestinationTransactionReport = destinationTransactionReportID ? destinationTransactionReport : targetTransactionReport;
    +    const selectedDestinationTransactionPolicy = destinationTransactionReportID ? destinationTransactionPolicy : targetTransactionPolicy;
    +
         return {
             targetTransaction,
             sourceTransaction,
    @@ -87,6 +107,8 @@ function useMergeTransactions({mergeTransaction}: UseMergeTransactionsProps): Us
             sourceTransactionReport,
             targetTransactionPolicy,
             sourceTransactionPolicy,
    +        destinationTransactionReport: selectedDestinationTransactionReport,
    +        destinationTransactionPolicy: selectedDestinationTransactionPolicy,
         };
     }
    
    diff --git a/src/pages/TransactionMerge/ConfirmationPage.tsx b/src/pages/TransactionMerge/ConfirmationPage.tsx
    index 832260cf651..92600cf329e 100644
    --- a/src/pages/TransactionMerge/ConfirmationPage.tsx
    +++ b/src/pages/TransactionMerge/ConfirmationPage.tsx
    @@ -42,13 +42,17 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
    
         const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: false});
         const [mergeTransaction, mergeTransactionMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.MERGE_TRANSACTION}${getNonEmptyStringOnyxID(transactionID)}`, {canBeMissing: true});
    -    const {targetTransaction, sourceTransaction, targetTransactionReport, targetTransactionPolicy} = useMergeTransactions({mergeTransaction});
    +    const {targetTransaction, sourceTransaction, targetTransactionReport, targetTransactionPolicy, destinationTransactionReport, destinationTransactionPolicy} = useMergeTransactions({
    +        mergeTransaction,
    +    });
    +    const selectedDestinationTransactionPolicy = destinationTransactionPolicy ?? targetTransactionPolicy;
    +    const selectedDestinationTransactionReport = destinationTransactionReport ?? targetTransactionReport;
         const [allTransactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {
             canBeMissing: false,
         });
    
    -    const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
    -    const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
    +    const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(selectedDestinationTransactionPolicy?.id)}`, {canBeMissing: true});
    +    const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${getNonEmptyStringOnyxID(selectedDestinationTransactionPolicy?.id)}`, {canBeMissing: true});
    
         const currentUserPersonalDetails = useCurrentUserPersonalDetails();
         const currentUserAccountIDParam = currentUserPersonalDetails.accountID;
    @@ -66,7 +70,7 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
         const selfDMReport = useSelfDMReport();
    
         // Build the merged transaction data for display
    -    const mergedTransactionData = buildMergedTransactionData(targetTransaction, mergeTransaction);
    +    const mergedTransactionData = buildMergedTransactionData(targetTransaction, mergeTransaction, selectedDestinationTransactionPolicy);
    
         const handleMergeExpenses = () => {
             if (!targetTransaction || !mergeTransaction || !sourceTransaction) {
    @@ -84,7 +88,7 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
                 targetTransactionThreadParentReport,
                 targetTransactionThreadParentReportNextStep,
                 allTransactionViolations,
    -            policy: targetTransactionPolicy,
    +            policy: selectedDestinationTransactionPolicy,
                 policyTags,
                 policyCategories,
                 currentUserAccountIDParam,
    @@ -137,8 +141,8 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
                         </View>
                         <MoneyRequestView
                             allReports={allReports}
    -                        expensePolicy={targetTransactionPolicy}
    -                        parentReportID={targetTransactionReport?.reportID}
    +                        expensePolicy={selectedDestinationTransactionPolicy}
    +                        parentReportID={selectedDestinationTransactionReport?.reportID}
                             shouldShowAnimatedBackground={false}
                             readonly
                             updatedTransaction={mergedTransactionData as unknown as OnyxEntry<Transaction>}
    

    1. For merge confirmation tax visibility, avoid taxName short-circuit and rely on policy in merge flow.
      const shouldShowTax = !!transaction?.taxName || isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest);
    diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx
    index 2b5dda9f3e3..bb71266e914 100644
    --- a/src/components/ReportActionItem/MoneyRequestView.tsx
    +++ b/src/components/ReportActionItem/MoneyRequestView.tsx
    @@ -414,7 +414,9 @@ function MoneyRequestView({
             canEditFieldOfMoneyRequest(parentReportAction, CONST.EDIT_REQUEST_FIELD.REIMBURSABLE, undefined, isChatReportArchived, undefined, transaction, moneyRequestReport, policy);
         const shouldShowAttendees = shouldShowAttendeesTransactionUtils(iouType, policy);
    
    -    const shouldShowTax = !!transaction?.taxName || isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest);
    +    const shouldShowTax = isFromMergeTransaction
    +        ? isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest)
    +        : !!transaction?.taxName || isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest);
         const tripID = getTripIDFromTransactionParentReportID(parentReport?.parentReportID);
         const shouldShowViewTripDetails = hasReservationList(transaction) && !!tripID;

    1. For merge field/preview generation, make tax handling destination-policy aware.
      function getMergeFields(targetTransaction: OnyxEntry<Transaction>) {
      const excludeFields: MergeFieldKey[] = [];
      // Distance request's amount/currency/receipt depend on merchant selection
      if (isDistanceRequest(targetTransaction)) {
      excludeFields.push('amount');
      }
      return MERGE_FIELDS.filter((field) => !excludeFields.includes(field));
    diff --git a/src/pages/TransactionMerge/DetailsReviewPage.tsx b/src/pages/TransactionMerge/DetailsReviewPage.tsx
    index d7575790f85..e5a751478ff 100644
    --- a/src/pages/TransactionMerge/DetailsReviewPage.tsx
    +++ b/src/pages/TransactionMerge/DetailsReviewPage.tsx
    @@ -44,9 +44,10 @@ function DetailsReviewPage({route}: DetailsReviewPageProps) {
         const {transactionID, isOnSearch, backTo} = route.params;
    
         const [mergeTransaction, mergeTransactionMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.MERGE_TRANSACTION}${getNonEmptyStringOnyxID(transactionID)}`, {canBeMissing: true});
    -    const {targetTransaction, sourceTransaction, targetTransactionReport, sourceTransactionReport, targetTransactionPolicy, sourceTransactionPolicy} = useMergeTransactions({
    -        mergeTransaction,
    -    });
    +    const {targetTransaction, sourceTransaction, targetTransactionReport, sourceTransactionReport, targetTransactionPolicy, sourceTransactionPolicy, destinationTransactionPolicy} =
    +        useMergeTransactions({
    +            mergeTransaction,
    +        });
    
         const [hasErrors, setHasErrors] = useState<Partial<Record<MergeFieldKey, boolean>>>({});
    @@ -62,11 +63,22 @@ function DetailsReviewPage({route}: DetailsReviewPageProps) {
                 [targetTransactionReport, sourceTransactionReport],
                 targetTransactionPolicy,
                 sourceTransactionPolicy,
    +            destinationTransactionPolicy,
             );
    
             setMergeTransactionKey(transactionID, mergeableData);
             return detectedConflictFields as MergeFieldKey[];
    -    }, [targetTransaction, sourceTransaction, transactionID, localeCompare, sourceTransactionReport, targetTransactionReport, targetTransactionPolicy, sourceTransactionPolicy]);
    +    }, [
    +        targetTransaction,
    +        sourceTransaction,
    +        transactionID,
    +        localeCompare,
    +        sourceTransactionReport,
    +        targetTransactionReport,
    +        targetTransactionPolicy,
    +        sourceTransactionPolicy,
    +        destinationTransactionPolicy,
    +    ]);
    
         // Handle selection
         const handleSelect = useCallback(
    
    diff --git a/src/pages/TransactionMerge/ReceiptReviewPage.tsx b/src/pages/TransactionMerge/ReceiptReviewPage.tsx
    index 8c523b894fc..111a2138515 100644
    --- a/src/pages/TransactionMerge/ReceiptReviewPage.tsx
    +++ b/src/pages/TransactionMerge/ReceiptReviewPage.tsx
    @@ -34,7 +34,7 @@ function ReceiptReviewPage({route}: ReceiptReviewPageProps) {
         const {transactionID, isOnSearch, backTo} = route.params;
    
         const [mergeTransaction, mergeTransactionMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.MERGE_TRANSACTION}${getNonEmptyStringOnyxID(transactionID)}`, {canBeMissing: true});
    -    const {targetTransaction, sourceTransaction, targetTransactionPolicy, sourceTransactionPolicy} = useMergeTransactions({mergeTransaction});
    +    const {targetTransaction, sourceTransaction, targetTransactionPolicy, sourceTransactionPolicy, destinationTransactionPolicy} = useMergeTransactions({mergeTransaction});
    
         const transactions = [targetTransaction, sourceTransaction].filter((transaction): transaction is Transaction => !!transaction);
    
    @@ -47,7 +47,15 @@ function ReceiptReviewPage({route}: ReceiptReviewPageProps) {
                 return;
             }
    
    -        const {conflictFields, mergeableData} = getMergeableDataAndConflictFields(targetTransaction, sourceTransaction, localeCompare, [], targetTransactionPolicy, sourceTransactionPolicy);
    +        const {conflictFields, mergeableData} = getMergeableDataAndConflictFields(
    +            targetTransaction,
    +            sourceTransaction,
    +            localeCompare,
    +            [],
    +            targetTransactionPolicy,
    +            sourceTransactionPolicy,
    +            destinationTransactionPolicy,
    +        );
             if (!conflictFields.length) {
                 // If there are no conflict fields, we should set mergeable data and navigate to the confirmation page
                 setMergeTransactionKey(transactionID, mergeableData);
    
    diff --git a/src/libs/MergeTransactionUtils.ts b/src/libs/MergeTransactionUtils.ts
    index 372d7429fa0..9299ee8e2cd 100644
    --- a/src/libs/MergeTransactionUtils.ts
    +++ b/src/libs/MergeTransactionUtils.ts
    @@ -10,7 +10,7 @@ import type {Attendee} from '@src/types/onyx/IOU';
     import SafeString from '@src/utils/SafeString';
     import {convertToBackendAmount, convertToDisplayString, getCurrencyDecimals} from './CurrencyUtils';
     import Parser from './Parser';
    -import {getCommaSeparatedTagNameWithSanitizedColons} from './PolicyUtils';
    +import {getCommaSeparatedTagNameWithSanitizedColons, isTaxTrackingEnabled} from './PolicyUtils';
     import {getIOUActionForReportID} from './ReportActionsUtils';
     import {getReportName} from './ReportNameUtils';
     import {findSelfDMReportID, getReportOrDraftReport, getTransactionDetails, isIOUReport} from './ReportUtils';
    @@ -164,13 +164,33 @@ function getMergeFieldTranslationKey(field: MergeFieldKey) {
         return MERGE_FIELD_TRANSLATION_KEYS[field];
     }
    
    -function getMergeFields(targetTransaction: OnyxEntry<Transaction>) {
    +function getDisabledTaxMergeValues(): Pick<MergeTransactionUpdateValues, 'taxValue' | 'taxAmount' | 'taxCode' | 'taxName' | 'taxPolicyID'> {
    +    return {
    +        taxValue: null,
    +        taxAmount: null,
    +        taxCode: null,
    +        taxName: null,
    +        taxPolicyID: null,
    +    };
    +}
    +
    +function isTaxSupportedForMergeDestination(transaction: OnyxEntry<Transaction>, destinationTransactionPolicy?: OnyxEntry<Policy>) {
    +    if (!destinationTransactionPolicy) {
    +        return true;
    +    }
    +    return isTaxTrackingEnabled(true, destinationTransactionPolicy, isDistanceRequest(transaction), isPerDiemRequest(transaction), isTimeRequest(transaction));
    +}
    +
    +function getMergeFields(targetTransaction: OnyxEntry<Transaction>, destinationTransactionPolicy?: OnyxEntry<Policy>) {
         const excludeFields: MergeFieldKey[] = [];
    
         // Distance request's amount/currency/receipt depend on merchant selection
         if (isDistanceRequest(targetTransaction)) {
             excludeFields.push('amount');
         }
    +    if (!isTaxSupportedForMergeDestination(targetTransaction, destinationTransactionPolicy)) {
    +        excludeFields.push('taxValue');
    +    }
    
         return MERGE_FIELDS.filter((field) => !excludeFields.includes(field));
     }
    @@ -214,14 +234,19 @@ function getMergeableDataAndConflictFields(
         searchReports: Array<OnyxEntry<Report>> = [],
         targetTransactionPolicy?: OnyxEntry<Policy>,
         sourceTransactionPolicy?: OnyxEntry<Policy>,
    +    destinationTransactionPolicy?: OnyxEntry<Policy>,
     ) {
         const conflictFields: string[] = [];
         const mergeableData: Record<string, unknown> = {};
    +    const isTaxSupportedByDestination = isTaxSupportedForMergeDestination(targetTransaction, destinationTransactionPolicy ?? targetTransactionPolicy);
    +    if (!isTaxSupportedByDestination) {
    +        Object.assign(mergeableData, getDisabledTaxMergeValues());
    +    }
    
         const targetTransactionDetails = getTransactionDetails(targetTransaction);
         const sourceTransactionDetails = getTransactionDetails(sourceTransaction);
    
    -    for (const field of getMergeFields(targetTransaction)) {
    +    for (const field of getMergeFields(targetTransaction, destinationTransactionPolicy ?? targetTransactionPolicy)) {
             const targetValue = getMergeFieldValue(targetTransactionDetails, targetTransaction, field);
             const sourceValue = getMergeFieldValue(sourceTransactionDetails, sourceTransaction, field);
    @@ -266,7 +291,14 @@ function getMergeableDataAndConflictFields(
             // We allow user to select unreported report
             if (field === 'reportID') {
                 if (targetValue === sourceValue) {
    -                const updatedValues = getMergeFieldUpdatedValues({transaction: targetTransaction, field, fieldValue: SafeString(targetValue), searchReports});
    +                const updatedValues = getMergeFieldUpdatedValues({
    +                    transaction: targetTransaction,
    +                    field,
    +                    fieldValue: SafeString(targetValue),
    +                    mergeTransaction: mergeableData as MergeTransaction,
    +                    searchReports,
    +                    policy: destinationTransactionPolicy ?? targetTransactionPolicy,
    +                });
                     Object.assign(mergeableData, updatedValues);
                 } else {
                     conflictFields.push(field);
    @@ -350,13 +382,20 @@ function getTransactionThreadReportID(transaction: OnyxEntry<Transaction>) {
      * Build the merged transaction data for display by combining target transaction with merge transaction updates
      * @param targetTransaction - The target transaction to merge into
      * @param mergeTransaction - The merge transaction containing the updates
    + * @param destinationTransactionPolicy - The destination policy that determines whether tax is supported
      * @returns The merged transaction data or null if required data is missing
      */
    -function buildMergedTransactionData(targetTransaction: OnyxEntry<Transaction>, mergeTransaction: OnyxEntry<MergeTransaction>): Transaction | null {
    +function buildMergedTransactionData(
    +    targetTransaction: OnyxEntry<Transaction>,
    +    mergeTransaction: OnyxEntry<MergeTransaction>,
    +    destinationTransactionPolicy?: OnyxEntry<Policy>,
    +): Transaction | null {
         if (!targetTransaction || !mergeTransaction) {
             return null;
         }
    
    +    const isTaxSupportedByDestination = isTaxSupportedForMergeDestination(targetTransaction, destinationTransactionPolicy);
    +
         return {
             ...targetTransaction,
             amount: mergeTransaction.amount,
    @@ -381,10 +420,10 @@ function buildMergedTransactionData(targetTransaction: OnyxEntry<Transaction>, m
             reportID: mergeTransaction.reportID,
             reportName: mergeTransaction.reportName,
             routes: mergeTransaction.routes,
    -        taxValue: mergeTransaction.taxValue,
    -        taxAmount: mergeTransaction.taxAmount,
    -        taxCode: mergeTransaction.taxCode,
    -        taxName: mergeTransaction.taxName,
    +        taxValue: isTaxSupportedByDestination ? mergeTransaction.taxValue : undefined,
    +        taxAmount: isTaxSupportedByDestination ? mergeTransaction.taxAmount : undefined,
    +        taxCode: isTaxSupportedByDestination ? mergeTransaction.taxCode : undefined,
    +        taxName: isTaxSupportedByDestination ? mergeTransaction.taxName : undefined,
         };
     }
    @@ -610,6 +649,9 @@ function getMergeFieldUpdatedValues<K extends MergeFieldKey>({
         if (field === 'reportID') {
             const reportName = transaction?.reportName?.length ? transaction?.reportName : getReportName(getReportOrDraftReport(getReportIDForExpense(transaction), searchReports));
             updatedValues.reportName = reportName.length ? reportName : null;
    +        if (!isTaxSupportedForMergeDestination(transaction, policy)) {
    +            Object.assign(updatedValues, getDisabledTaxMergeValues());
    +        }
         }
    
         if (field === 'merchant' && isDistanceRequest(transaction)) {
    
    

    1. For merge request/optimistic updates, omit tax fields when destination policy does not support tax.
      taxCode: mergeTransaction.taxCode,
      taxPolicyID: mergeTransaction.taxPolicyID,
    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,
         };
    

    1. 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)

    1. 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.
        const targetTransactionPolicyID = isExpenseUnreported(targetTransaction) ? policyForMovingExpensesID : targetTransactionReport?.policyID;
        const sourceTransactionPolicyID = isExpenseUnreported(sourceTransaction) ? policyForMovingExpensesID : sourceTransactionReport?.policyID;
        let [targetTransactionPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(targetTransactionPolicyID)}`, {
        canBeMissing: true,
        });
        let [sourceTransactionPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(sourceTransactionPolicyID)}`, {
        canBeMissing: true,
        });
        if (currentSearchHash && currentSearchResults?.data) {
        // If we're on search and main collection reports are not available, get them from the search snapshot
        targetTransactionReport = targetTransactionReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${targetTransactionReportID}`];
        sourceTransactionReport = sourceTransactionReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${sourceTransactionReportID}`];
        // If we're on search, search snapshot policies are more up to date
        targetTransactionPolicy = currentSearchResults?.data[`${ONYXKEYS.COLLECTION.POLICY}${targetTransactionPolicyID}`];
        sourceTransactionPolicy = currentSearchResults?.data[`${ONYXKEYS.COLLECTION.POLICY}${sourceTransactionPolicyID}`];
        }
        return {
        targetTransaction,
        sourceTransaction,
        targetTransactionReport,
        sourceTransactionReport,
        targetTransactionPolicy,
        sourceTransactionPolicy,
        };
    diff --git a/src/hooks/useMergeTransactions.ts b/src/hooks/useMergeTransactions.ts
    index 619132aae3c..2c3620774eb 100644
    --- a/src/hooks/useMergeTransactions.ts
    +++ b/src/hooks/useMergeTransactions.ts
    @@ -3,6 +3,7 @@ import {useSearchContext} from '@components/Search/SearchContext';
     import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
     import {getReportIDForExpense, getTransactionFromMergeTransaction} from '@libs/MergeTransactionUtils';
     import {isExpenseUnreported} from '@libs/TransactionUtils';
    +import CONST from '@src/CONST';
     import ONYXKEYS from '@src/ONYXKEYS';
     import type {MergeTransaction, Policy, Report, SearchResults, Transaction} from '@src/types/onyx';
     import useOnyx from './useOnyx';
    @@ -19,6 +20,8 @@ type UseMergeTransactionsReturn = {
         sourceTransactionReport?: Report;
         targetTransactionPolicy?: Policy;
         sourceTransactionPolicy?: Policy;
    +    destinationTransactionReport?: Report;
    +    destinationTransactionPolicy?: Policy;
     };
    @@ -70,16 +73,33 @@ function useMergeTransactions({mergeTransaction}: UseMergeTransactionsProps): Us
         let [sourceTransactionPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(sourceTransactionPolicyID)}`, {
             canBeMissing: true,
         });
    +    const destinationTransactionReportID = mergeTransaction?.reportID;
    +    let [destinationTransactionReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(destinationTransactionReportID)}`, {
    +        canBeMissing: true,
    +    });
    +    const destinationTransactionPolicyID = mergeTransaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID ? policyForMovingExpensesID : destinationTransactionReport?.policyID;
    +    let [destinationTransactionPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(destinationTransactionPolicyID)}`, {
    +        canBeMissing: true,
    +    });
     
         if (currentSearchHash && currentSearchResults?.data) {
             // If we're on search and main collection reports are not available, get them from the search snapshot
             targetTransactionReport = targetTransactionReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${targetTransactionReportID}`];
             sourceTransactionReport = sourceTransactionReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${sourceTransactionReportID}`];
    +        if (destinationTransactionReportID && destinationTransactionReportID !== CONST.REPORT.UNREPORTED_REPORT_ID) {
    +            destinationTransactionReport = destinationTransactionReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${destinationTransactionReportID}`];
    +        }
             // If we're on search, search snapshot policies are more up to date
             targetTransactionPolicy = currentSearchResults?.data[`${ONYXKEYS.COLLECTION.POLICY}${targetTransactionPolicyID}`];
             sourceTransactionPolicy = currentSearchResults?.data[`${ONYXKEYS.COLLECTION.POLICY}${sourceTransactionPolicyID}`];
    +        if (destinationTransactionPolicyID) {
    +            destinationTransactionPolicy = destinationTransactionPolicy ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.POLICY}${destinationTransactionPolicyID}`];
    +        }
         }
     
    +    const selectedDestinationTransactionReport = destinationTransactionReportID ? destinationTransactionReport : targetTransactionReport;
    +    const selectedDestinationTransactionPolicy = destinationTransactionReportID ? destinationTransactionPolicy : targetTransactionPolicy;
    +
         return {
             targetTransaction,
             sourceTransaction,
    @@ -87,6 +107,8 @@ function useMergeTransactions({mergeTransaction}: UseMergeTransactionsProps): Us
             sourceTransactionReport,
             targetTransactionPolicy,
             sourceTransactionPolicy,
    +        destinationTransactionReport: selectedDestinationTransactionReport,
    +        destinationTransactionPolicy: selectedDestinationTransactionPolicy,
         };
     }
    • In ConfirmationPage, switch from target policy/report to destination policy/report for preview and merge request context.
      const {targetTransaction, sourceTransaction, targetTransactionReport, targetTransactionPolicy} = useMergeTransactions({mergeTransaction});
      const [allTransactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {
      canBeMissing: false,
      });
      const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
      const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
    diff --git a/src/pages/TransactionMerge/ConfirmationPage.tsx b/src/pages/TransactionMerge/ConfirmationPage.tsx
    index 832260cf651..4550ab1d219 100644
    --- a/src/pages/TransactionMerge/ConfirmationPage.tsx
    +++ b/src/pages/TransactionMerge/ConfirmationPage.tsx
    @@ -42,13 +42,17 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
     
         const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: false});
         const [mergeTransaction, mergeTransactionMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.MERGE_TRANSACTION}${getNonEmptyStringOnyxID(transactionID)}`, {canBeMissing: true});
    -    const {targetTransaction, sourceTransaction, targetTransactionReport, targetTransactionPolicy} = useMergeTransactions({mergeTransaction});
    +    const {targetTransaction, sourceTransaction, destinationTransactionReport, destinationTransactionPolicy} = useMergeTransactions({
    +        mergeTransaction,
    +    });
    +    const selectedDestinationTransactionPolicy = destinationTransactionPolicy;
    +    const selectedDestinationTransactionReport = destinationTransactionReport;
         const [allTransactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {
             canBeMissing: false,
         });
     
    -    const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
    -    const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${getNonEmptyStringOnyxID(targetTransactionPolicy?.id)}`, {canBeMissing: true});
    +    const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(selectedDestinationTransactionPolicy?.id)}`, {canBeMissing: true});
    +    const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${getNonEmptyStringOnyxID(selectedDestinationTransactionPolicy?.id)}`, {canBeMissing: true});
    @@ -66,7 +70,7 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
         const selfDMReport = useSelfDMReport();
     
         // Build the merged transaction data for display
    -    const mergedTransactionData = buildMergedTransactionData(targetTransaction, mergeTransaction);
    +    const mergedTransactionData = buildMergedTransactionData(targetTransaction, mergeTransaction, selectedDestinationTransactionPolicy);
    @@ -84,7 +88,7 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
                 targetTransactionThreadParentReport,
                 targetTransactionThreadParentReportNextStep,
                 allTransactionViolations,
    -            policy: targetTransactionPolicy,
    +            policy: selectedDestinationTransactionPolicy,
                 policyTags,
                 policyCategories,
                 currentUserAccountIDParam,
    @@ -137,8 +141,8 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
                         </View>
                         <MoneyRequestView
                             allReports={allReports}
    -                        expensePolicy={targetTransactionPolicy}
    -                        parentReportID={targetTransactionReport?.reportID}
    +                        expensePolicy={selectedDestinationTransactionPolicy}
    +                        parentReportID={selectedDestinationTransactionReport?.reportID}
                             shouldShowAnimatedBackground={false}
                             readonly
                             updatedTransaction={mergedTransactionData as unknown as OnyxEntry<Transaction>}
    • In MoneyRequestView, make tax visibility merge-specific (do not short-circuit on taxName in merge flow).
      const shouldShowTax = !!transaction?.taxName || isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest);
    diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx
    index 2b5dda9f3e3..bb71266e914 100644
    --- a/src/components/ReportActionItem/MoneyRequestView.tsx
    +++ b/src/components/ReportActionItem/MoneyRequestView.tsx
    @@ -414,7 +414,9 @@ function MoneyRequestView({
             canEditFieldOfMoneyRequest(parentReportAction, CONST.EDIT_REQUEST_FIELD.REIMBURSABLE, undefined, isChatReportArchived, undefined, transaction, moneyRequestReport, policy);
         const shouldShowAttendees = shouldShowAttendeesTransactionUtils(iouType, policy);
     
    -    const shouldShowTax = !!transaction?.taxName || isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest);
    +    const shouldShowTax = isFromMergeTransaction
    +        ? isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest)
    +        : !!transaction?.taxName || isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, isDistanceRequest, isPerDiemRequest, isTimeRequest);
         const tripID = getTripIDFromTransactionParentReportID(parentReport?.parentReportID);
         const shouldShowViewTripDetails = hasReservationList(transaction) && !!tripID;
    • In buildMergedTransactionData, gate tax fields by destination policy support.
      function buildMergedTransactionData(targetTransaction: OnyxEntry<Transaction>, mergeTransaction: OnyxEntry<MergeTransaction>): Transaction | null {
      if (!targetTransaction || !mergeTransaction) {
      return null;
      }
      return {
      ...targetTransaction,
      amount: mergeTransaction.amount,
      modifiedAmount: mergeTransaction.amount,
      modifiedCurrency: mergeTransaction.currency,
      merchant: mergeTransaction.merchant,
      modifiedMerchant: mergeTransaction.merchant,
      category: mergeTransaction.category,
      tag: mergeTransaction.tag,
      comment: {
      ...targetTransaction.comment,
      comment: mergeTransaction.description,
      customUnit: mergeTransaction.customUnit,
      waypoints: mergeTransaction.waypoints,
      attendees: mergeTransaction.attendees,
      },
      reimbursable: mergeTransaction.reimbursable,
      billable: mergeTransaction.billable,
      receipt: mergeTransaction.receipt,
      created: mergeTransaction.created,
      modifiedCreated: mergeTransaction.created,
      reportID: mergeTransaction.reportID,
      reportName: mergeTransaction.reportName,
      routes: mergeTransaction.routes,
      taxValue: mergeTransaction.taxValue,
      taxAmount: mergeTransaction.taxAmount,
      taxCode: mergeTransaction.taxCode,
      taxName: mergeTransaction.taxName,
    diff --git a/src/libs/MergeTransactionUtils.ts b/src/libs/MergeTransactionUtils.ts
    index 372d7429fa0..7b399ec883d 100644
    --- a/src/libs/MergeTransactionUtils.ts
    +++ b/src/libs/MergeTransactionUtils.ts
    @@ -10,7 +10,7 @@ import type {Attendee} from '@src/types/onyx/IOU';
     import SafeString from '@src/utils/SafeString';
     import {convertToBackendAmount, convertToDisplayString, getCurrencyDecimals} from './CurrencyUtils';
     import Parser from './Parser';
    -import {getCommaSeparatedTagNameWithSanitizedColons} from './PolicyUtils';
    +import {getCommaSeparatedTagNameWithSanitizedColons, isTaxTrackingEnabled} from './PolicyUtils';
     import {getIOUActionForReportID} from './ReportActionsUtils';
     import {getReportName} from './ReportNameUtils';
     import {findSelfDMReportID, getReportOrDraftReport, getTransactionDetails, isIOUReport} from './ReportUtils';
    @@ -346,17 +346,31 @@ function getTransactionThreadReportID(transaction: OnyxEntry<Transaction>) {
         return iouActionOfTargetTransaction?.childReportID;
     }
     
    +function isTaxSupportedForMergeDestination(transaction: OnyxEntry<Transaction>, destinationTransactionPolicy?: OnyxEntry<Policy>) {
    +    if (!destinationTransactionPolicy) {
    +        return true;
    +    }
    +    return isTaxTrackingEnabled(true, destinationTransactionPolicy, isDistanceRequest(transaction), isPerDiemRequest(transaction), isTimeRequest(transaction));
    +}
    +
     /**
      * Build the merged transaction data for display by combining target transaction with merge transaction updates
      * @param targetTransaction - The target transaction to merge into
      * @param mergeTransaction - The merge transaction containing the updates
    + * @param destinationTransactionPolicy - The destination policy of the selected report
      * @returns The merged transaction data or null if required data is missing
      */
    -function buildMergedTransactionData(targetTransaction: OnyxEntry<Transaction>, mergeTransaction: OnyxEntry<MergeTransaction>): Transaction | null {
    +function buildMergedTransactionData(
    +    targetTransaction: OnyxEntry<Transaction>,
    +    mergeTransaction: OnyxEntry<MergeTransaction>,
    +    destinationTransactionPolicy?: OnyxEntry<Policy>,
    +): Transaction | null {
         if (!targetTransaction || !mergeTransaction) {
             return null;
         }
     
    +    const isTaxSupportedByDestination = isTaxSupportedForMergeDestination(targetTransaction, destinationTransactionPolicy);
    +
         return {
             ...targetTransaction,
             amount: mergeTransaction.amount,
    @@ -381,10 +395,10 @@ function buildMergedTransactionData(targetTransaction: OnyxEntry<Transaction>, m
             reportID: mergeTransaction.reportID,
             reportName: mergeTransaction.reportName,
             routes: mergeTransaction.routes,
    -        taxValue: mergeTransaction.taxValue,
    -        taxAmount: mergeTransaction.taxAmount,
    -        taxCode: mergeTransaction.taxCode,
    -        taxName: mergeTransaction.taxName,
    +        taxValue: isTaxSupportedByDestination ? mergeTransaction.taxValue : undefined,
    +        taxAmount: isTaxSupportedByDestination ? mergeTransaction.taxAmount : undefined,
    +        taxCode: isTaxSupportedByDestination ? mergeTransaction.taxCode : undefined,
    +        taxName: isTaxSupportedByDestination ? mergeTransaction.taxName : undefined,
         };
     }
  11. 71 remaining items

  12. removed
    Awaiting PaymentAuto-added when associated PR is deployed to production
    on Apr 20, 2026
  13. melvin-bot commented on Apr 20, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Apr 20, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    • Reviewer: @hoangzinh owed $250 via NewDot
    • Contributor: @dominictb does not require payment (Contractor)

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2025522339194621554/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. dominictb commented on Apr 21, 2026

    @dominictb
    Contributor

    @MelvinBot Can you help to remove "[Due for payment 2026-04-20] " from this issue title?

  16. 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
  17. MelvinBot commented on Apr 21, 2026

    @MelvinBot
    Contributor

    ✅ Done — removed [Due for payment 2026-04-20] from the title.

  18. dominictb commented on Apr 21, 2026

    @dominictb
    Contributor

    This is completed. There're a few ongoing follow-ups that'd be tracked in the main Merge project tracking issue.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions