From e4d34fbe436f66acf31314ef01e3ffb97b2b78f0 Mon Sep 17 00:00:00 2001 From: MelvinBot Date: Fri, 27 Feb 2026 01:01:43 +0000 Subject: [PATCH] Use absolute value for taxable amount when calculating tax on negative expenses Tax amount was calculated using the raw (negative) transaction amount, producing a negative tax value that the backend treated as zero. Wrapping in Math.abs ensures the tax calculation always receives a positive amount. Co-authored-by: Roji Philip --- src/components/MoneyRequestConfirmationList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index 22c6c22be7173..79b88dd5bf3c9 100755 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -547,7 +547,7 @@ function MoneyRequestConfirmationList({ }, [shouldCalculateDistanceAmount, isReadOnly, distanceRequestAmount, transactionID, currency, isTypeSplit, isPolicyExpenseChat, selectedParticipantsProp, transaction]); // Calculate and set tax amount in transaction draft - const taxableAmount = isDistanceRequest ? DistanceRequestUtils.getTaxableAmount(policy, customUnitRateID, distance) : (transaction?.amount ?? 0); + const taxableAmount = isDistanceRequest ? DistanceRequestUtils.getTaxableAmount(policy, customUnitRateID, distance) : Math.abs(transaction?.amount ?? 0); // First we'll try to get the tax value from the chosen policy and if not found, we'll try to get it from the policy for moving expenses (only if the transaction is moving from track expense) const taxPercentage = getTaxValue(policy, transaction, transaction?.taxCode ?? defaultTaxCode) ??