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
[HOLD E/E #601592] Distance - Change waypoint before create expense, Tax amount change to 0 #79861
Version Number: v9.3.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:https://test-management.browserstack.com/projects/2219752/test-runs/TR-3029/folder/13176868/41237331/1131713395 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Win 11/Chrome App Component: Money Requests
Action Performed:
Precondition: Track tax in distance expenses is enabled, set default tax rate is over 0%
Restate the problem this issue is trying to solve.
Changing a distance waypoint before creating the expense recalculates amount/merchant but leaves draft taxAmount stale (often 0), so the created expense is saved with zero tax despite policy distance tax being enabled.
What is the root cause of that problem?
getUpdatedTransaction recalculates distance amount. It does not recalculate tax. The draft tax value stays old. That stale value is sent to the backend.
What changes do you think we should make in order to solve the problem?
Add an invariant.
Distance draft tax must always match the current route distance and policy tax defaults.
Apply it when waypoints change and when mileage rate changes.
Make the change in getUpdatedTransaction.
Use one local helper.
Call it in two places.
Do not change the pending-route path.
File src/libs/TransactionUtils/index.ts in getUpdatedTransaction:
// Add local helper near top of getUpdatedTransactionconstapplyDistanceTax=(txn: Transaction,meters: number,currencyCode: string|undefined)=>{if(!isDistanceRequest(txn)||!policy){return;}constcustomUnitRateID=getRateID(txn);constdefaultTaxCode=getDefaultTaxCode(policy,txn,currencyCode)??'';consttaxCode=txn.taxCode??defaultTaxCode;consttaxableAmount=DistanceRequestUtils.getTaxableAmount(policy,customUnitRateID,meters);consttaxPercentage=getTaxValue(policy,txn,taxCode)??'';consttaxAmount=calculateTaxAmount(taxPercentage,taxableAmount,currencyCode??CONST.CURRENCY.USD);consttaxAmountInSmallestUnits=convertToBackendAmount(Number.parseFloat(taxAmount.toString()));txn.taxAmount=isFromExpenseReport ? -taxAmountInSmallestUnits : taxAmountInSmallestUnits;};
With this frontend PR now deployed, this issue should be fixed. The issue was caused by a mismatch where the frontend set a tax, while the backend set it to zero when no taxClaimablePercentage was provided.
The tax value stays zero throughout, even in production. This is expected behavior with PR, which sets the default value for taxReclaimablePercentage to zero.
Windows 11 / Chrome
v9.3.60-17
can't repro, tax amount displayed $0.0 on confirmation page before and after changing the stop waypoint, and after creating the expense
Activity
melvin-bot commentedon Jan 19, 2026
Triggered auto assignment to @mallenexpensify (
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.yatin-italy commentedon Jan 19, 2026
Proposal
Restate the problem this issue is trying to solve.
Changing a distance waypoint before creating the expense recalculates amount/merchant but leaves draft taxAmount stale (often 0), so the created expense is saved with zero tax despite policy distance tax being enabled.
What is the root cause of that problem?
getUpdatedTransaction recalculates distance amount. It does not recalculate tax. The draft tax value stays old. That stale value is sent to the backend.
What changes do you think we should make in order to solve the problem?
Make the change in getUpdatedTransaction.
File src/libs/TransactionUtils/index.ts in getUpdatedTransaction:
Waypoint change branch.
Mileage rate change branch.
This keeps tax correct for both waypoint edits and rate edits.
What alternative solutions did you explore? (Optional)
-Recomputing tax in UI layers (It spreads logic and breaks the shared invariant).
annaweber830 commentedon Jan 20, 2026
Hi @mallenexpensify, this seems like a backend issue.
mallenexpensify commentedon Jan 21, 2026
Thanks @annaweber830 , checking here
c3024 commentedon Jan 24, 2026
I will address the PR review suggestions on Monday.
17 remaining items
mallenexpensify commentedon Mar 25, 2026
PR in review for issue we're held on
c3024 commentedon Mar 31, 2026
This should still be held on #79867 because the default values for
taxReclaimablePercentageare different on the frontend (1) and the backend (0).We should change the frontend value to 0 which should be handled in the App PR for the issue #79867.
chuckdries commentedon Mar 31, 2026
Backend PR has been released to production! @c3024 could you check and see that it now behaves as you expect?
c3024 commentedon Apr 9, 2026
With this frontend PR now deployed, this issue should be fixed. The issue was caused by a mismatch where the frontend set a tax, while the backend set it to zero when no
taxClaimablePercentagewas provided.I’ve requested QA to retest.
m-natarajan commentedon Apr 9, 2026
Tax amount not changes at all. It stays 0, Chrome / v9.3.55-0
bandicam.2026-04-09.14-21-22-268.mp4
m-natarajan commentedon Apr 9, 2026
Production behavior for this
bandicam.2026-04-09.14-59-00-504.mp4
c3024 commentedon Apr 20, 2026
The tax value stays zero throughout, even in production. This is expected behavior with PR, which sets the default value for
taxReclaimablePercentageto zero.Asked QA to retest.
IuliiaHerets commentedon Apr 20, 2026
Windows 11 / Chrome
v9.3.60-17
can't repro, tax amount displayed $0.0 on confirmation page before and after changing the stop waypoint, and after creating the expense
tax.rate.mp4
can't repro on web v9.3.59-4 Prod
prod.1.mp4
Same on Android and iOS (stg and prod)
Screenrecorder-2026-04-20-10-13-22-638.mp4
prod.ios.MP4
tax.ios.MP4
Screenrecorder-2026-04-20-09-49-50-647.mp4
c3024 commentedon Apr 20, 2026
Closing as QA too confirmed this is not repro.