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
[Due for payment 2026-05-07] [$500] Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty #79867
Please re-state the problem that we are trying to solve in this issue.
Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty
What is the root cause of that problem?
When "Tax reclaimable on" is empty, taxClaimablePercentage is undefined. In getTaxableAmount(), when taxClaimablePercentage is undefined, it defaults to 1 (100%), so tax is calculated on the full amount instead of 0
This causes the confirm page to show a non-zero tax amount. After creation, the backend sets taxAmount to 0, which is why it shows correctly in the transaction thread
What changes do you think we should make in order to solve the problem?
Change the default value from 1 to 0 in getTaxableAmount() when taxClaimablePercentage is undefined, so when "Tax reclaimable on" is empty, the taxable amount is 0 and the tax amount is 0
Please re-state the problem that we are trying to solve in this issue.
Tax amount field is not zero on confirm page when tax reclaimable on is empty
What is the root cause of that problem?
In getTaxableAmount function we fallback to "1" when taxClaimablePercentage is undefined. And tax amount will be caculated based on the full distance expense amount
We can return "0" when taxRateExternalID doesn't exist. This means we return 0 taxable amount when there is no tax associated with the distance rate
if (!distanceUnit?.customUnitID || !customUnitRate || !customUnitRate?.attributes?.taxRateExternalID) {
return 0;
}
Or
2. We can set the distances rate's customUnitRate.attributes property of the distance rate to empty array from backend, optimistically too when the user deletes a tax rate associated with distance rate.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
What alternative solutions did you explore? (Optional)
Add a fallback in DistanceRequestUtils.getTaxableAmount. Not chosen. It is late in the flow and duplicates logic.The shared data contract would still be wrong.
changed the title [-]Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty[/-][+][$250] Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty[/+]on Jan 23, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ZhenjaHorbach@mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
changed the title [-][Due for payment 2026-05-07] [$250] Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty[/-][+][Due for payment 2026-05-07] [$500] Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty[/+]on May 4, 2026
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Precondition:
Distance rates and Taxes are enabled.
Track tax is enabled in Distance rates settings.
Open App
Go to workspace settings > Distance rates.
Open the default rate.
Click Tax rate.
Select Tax rate 5% (can be any rate as long as it is not 0%).
Leave Tax reclaimable on empty.
Go to workspace chat.
Click + > Track distance > Manual.
Enter amount > Next.
Verify that Tax amount field is zero on confirmation page
Click Create expense.
Open the distance expense.
Verify that Tax amount field is 0.00
Precondition:
For Taxes,
Set Set Workspace currency default and Foreign currency default to 5% tax rate.
Create 5%, 10% and 15% tax rate.
For Distance rates,
Enable Track tax, and then
Create 2 more rates in addition to the default rate - 0.70, 1.00 and 2.00
For each distance rate, configure tax rate and tax reclaimable as below:
Distance rate 0.70:
Tax rate: 5%
Tax reclaimable amount: any amount
Distance rate 1.00:
Tax rate: 10%
Tax reclaimable amount: DO NOT enter amount
Distance rate 2.00:
Tax rate: 15%
Tax reclaimable amount: any amount.
Test 1
Open App
Go to workspace settings > Taxes.
Delete Tax rate 15%.
Go to workspace chat.
Click + > Track distance > Manual.
Enter amount > Next.
Click Rate.
Select Distance rate 1.00.
Click Rate.
Select Distance rate 2.00.
Verify that tax rate is the workspace currency default tax rate (5%)
Test 2
Open App
Go to workspace settings > Taxes.
Delete Tax rate 15%.
Go to workspace chat.
Click + > Track distance > Manual.
Enter amount > Next.
Click Rate.
Select Distance rate 1.00.
Create the expense
Open the expense
Click on Rate
Select Distance rate 2.00
Verify that tax rate is the workspace currency default tax rate (5%)
Activity
melvin-bot commentedon Jan 19, 2026
Triggered auto assignment to @CortneyOfstad (
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.nyomanjyotisa commentedon Jan 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty
What is the root cause of that problem?
When "Tax reclaimable on" is empty,
taxClaimablePercentageisundefined. IngetTaxableAmount(), whentaxClaimablePercentageisundefined, it defaults to1(100%), so tax is calculated on the full amount instead of 0App/src/libs/DistanceRequestUtils.ts
Line 345 in eafbcff
This causes the confirm page to show a non-zero tax amount. After creation, the backend sets
taxAmountto 0, which is why it shows correctly in the transaction threadWhat changes do you think we should make in order to solve the problem?
Change the default value from
1to0ingetTaxableAmount()whentaxClaimablePercentageisundefined, so when "Tax reclaimable on" is empty, the taxable amount is 0 and the tax amount is 0App/src/libs/DistanceRequestUtils.ts
Line 345 in eafbcff
What alternative solutions did you explore? (Optional)
None
etCoderDysto commentedon Jan 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tax amount field is not zero on confirm page when tax reclaimable on is empty
What is the root cause of that problem?
In getTaxableAmount function we fallback to "1" when taxClaimablePercentage is undefined. And tax amount will be caculated based on the full distance expense amount
App/src/libs/DistanceRequestUtils.ts
Lines 336 to 345 in eafbcff
What changes do you think we should make in order to solve the problem?
we should fall back to CONST.DEFAULT_NUMBER_ID (0) when taxClaimablePercentage is undefined
Note:
The issue was introduced by this PR. One of the issues it was trying to solve is this issue. We have to fix this issue too.
To fix issue
taxRateExternalIDdoesn't exist. This means we return 0 taxable amount when there is no tax associated with the distance rateOr
2. We can set the distances rate's customUnitRate.attributes property of the distance rate to empty array from backend, optimistically too when the user deletes a tax rate associated with distance rate.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
yatin-italy commentedon Jan 19, 2026
Proposal
Restate the problem this issue is trying to solve.
What is the root cause of that problem?
taxClaimablePercentage.What changes do you think we should make in order to solve the problem?
taxClaimablePercentage.File:
src/libs/PolicyUtils.tsFunction:
getDistanceRateCustomUnitRateCode delta (apply verbatim):
What alternative solutions did you explore? (Optional)
Add a fallback in
DistanceRequestUtils.getTaxableAmount. Not chosen. It is late in the flow and duplicates logic.The shared data contract would still be wrong.melvin-bot commentedon Jan 23, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022014773705505397202
[-]Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty[/-][+][$250] Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty[/+]melvin-bot commentedon Jan 23, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (
External)81 remaining items
melvin-bot commentedon Apr 30, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 30, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-05-07. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 30, 2026
@ZhenjaHorbach @mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
ZhenjaHorbach commentedon May 4, 2026
Can we increase the bounty for this issue?
Since we cover 2 unrelated issues for this flow
Plus, we fixed these issues without any regressions
Proposed amount to increase the price to
$500
Multiple PRs - Link to all PRs
#87911
#81805
@chuckdries
Can you share your thoughts, please?
chuckdries commentedon May 4, 2026
Sounds reasonable to me! This one was tricky. Approved.
[-][Due for payment 2026-05-07] [$250] Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty[/-][+][Due for payment 2026-05-07] [$500] Distance - Tax amount field is not zero on confirm page when tax reclaimable on is empty[/+]melvin-bot commentedon May 4, 2026
Upwork job price has been updated to $500
melvin-bot commentedon May 6, 2026
Current assignee @mallenexpensify is eligible for the Awaiting Payment assigner, not assigning anyone new.
ZhenjaHorbach commentedon May 7, 2026
BugZero Checklist:
https://github.com/Expensify/App/pull/76384/changes#r3200720331
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Precondition:
Precondition:
For Taxes,
Enable Track tax, and then
Test 1
Test 2
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-656a-a720-a3a2-8e33fdd23eb4mallenexpensify commentedon May 8, 2026
Payment Summary
Contributor: @etCoderDysto paid $500 via Upwork ($250 + $250 bonus)
Contributor+: @ZhenjaHorbach due $500 via NewDot
^ Test case created
garrettmknight commentedon May 10, 2026
$500 approved for @ZhenjaHorbach