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
[QA Retest & Close] Expense - Negative tax amount is not retained after unreporting expense #103665
Version Number: 9.5.7-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#102175 Email or phone of affected tester (no customers):sidjosdiojsojo@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Enable Taxes.
Go to staging.new.expensify.com
Go to workspace chat.
Create an expense with negative amount.
Open the report.
Change tax rate to non-zero rate.
Click Report field.
Click Remove from report.
Go to self DM.
Open the expesne.
Expected Result:
Negative tax amount will be retained after unreporting expense.
Actual Result:
Negative tax amount is not retained after unreporting expense.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Recommendation: Demote this issue and fix it forward. Don't revert.
The bug only affects what's displayed. Stored data and totals don't change.
A revert would show a positive tax on the report view again. That removes the PR's fix and makes nothing correct.
Root cause: The expense details page sets the sign of the amount and the tax in different ways (ReportUtils.ts:5643-5650):
The amount gets an "is unreported" flag (reportID === UNREPORTED_REPORT_ID), so getAmount flips the sign and shows a negative value.
The tax goes through getTaxAmount(transaction, isFromExpenseReport) with no such flag. For an unreported expense, isFromExpenseReport is false because there's no report and MoneyRequestView.tsx:347 passes no policy. So normalizeTaxAmountSign returns Math.abs(), which shows a positive value.
Recommended fix:
Add an isFromTrackedExpense parameter to normalizeTaxAmountSign / getTaxAmount (and getConvertedTaxAmount), matching getAmount.
In getTransactionDetails, pass transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID for taxAmount and convertedTaxAmount.
Add a test in tests/ui/MoneyRequestViewTest.tsx for a negative unreported expense with tax.
Investigation details
Unreported expenses store amounts with the flipped sign, just like expense reports. See the comment on getTransactionDisplayAmount. changeTransactionsReport doesn't change amount or taxAmount when an expense is removed from a report.
PR 102175 removed Math.abs() from formattedTaxAmount (MoneyRequestView.tsx:380) and relied on getTaxAmount for the sign. The Math.abs() branch for non-report expenses already existed; the PR only moved it into normalizeTaxAmountSign.
The result is that the tax shows negative on the report, then positive after Remove from report. Before the PR, both screens showed a positive tax.
Other places call getTaxAmount: SplitExpenseItems.ts, SearchUIUtils.ts, and the modified-expense message in ReportUtils.ts. Check them before you change the helper's signature.
Not verified: I didn't test this in a live app. A QA check that the self DM shows a positive tax, the same as production, would confirm this isn't a regression.
Next Steps: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
It implements the proposed fix and also passes the unreported flag to getTaxAmount in getTransactionSortValue, as you asked. I added unit tests for the tax helpers, getTransactionDetails and getTransactionSortValue. The related unit, UI and IOU test suites, typecheck, lint and spell check pass. I didn't test it in the app.
changed the title [-]Expense - Negative tax amount is not retained after unreporting expense[/-][+][$175] Expense - Negative tax amount is not retained after unreporting expense[/+]on Oct 10, 2026
changed the title [-][$175] Expense - Negative tax amount is not retained after unreporting expense[/-][+][QA Retest & Close] Expense - Negative tax amount is not retained after unreporting expense[/+]on Oct 12, 2026
Activity
applause-bot commentedon Oct 9, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/cf9ff3e4eb89caa74bcab8d8d278ce6403a20ed8a7fc49826c87452a95e91194
melvin-bot commentedon Oct 9, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #102175
melvin-bot commentedon Oct 9, 2026
@grgia you have been assigned to this deploy blocker because you reviewed the offending PR: #102175
melvin-bot commentedon Oct 9, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Oct 9, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Oct 9, 2026
Deploy Blocker Analysis
Causing PR: Show negative tax amount for negative expenses on the expense details page. The PR only covered expenses on a report. Unreported (self DM) expenses still show a positive tax, which is also what production shows today.
Recommendation: Demote this issue and fix it forward. Don't revert.
Root cause: The expense details page sets the sign of the amount and the tax in different ways (ReportUtils.ts:5643-5650):
reportID === UNREPORTED_REPORT_ID), sogetAmountflips the sign and shows a negative value.getTaxAmount(transaction, isFromExpenseReport)with no such flag. For an unreported expense,isFromExpenseReportis false because there's no report and MoneyRequestView.tsx:347 passes no policy. SonormalizeTaxAmountSignreturnsMath.abs(), which shows a positive value.Recommended fix:
isFromTrackedExpenseparameter tonormalizeTaxAmountSign/getTaxAmount(andgetConvertedTaxAmount), matchinggetAmount.getTransactionDetails, passtransaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_IDfortaxAmountandconvertedTaxAmount.tests/ui/MoneyRequestViewTest.tsxfor a negative unreported expense with tax.Investigation details
getTransactionDisplayAmount.changeTransactionsReportdoesn't changeamountortaxAmountwhen an expense is removed from a report.Math.abs()fromformattedTaxAmount(MoneyRequestView.tsx:380) and relied ongetTaxAmountfor the sign. TheMath.abs()branch for non-report expenses already existed; the PR only moved it intonormalizeTaxAmountSign.getTaxAmount:SplitExpenseItems.ts,SearchUIUtils.ts, and the modified-expense message inReportUtils.ts. Check them before you change the helper's signature.Next Steps: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.view run
bernhardoj commentedon Oct 10, 2026
@MelvinBot implement this
Also pass it to getTaxAmount in getTransactionSortValue
MelvinBot commentedon Oct 10, 2026
🤖 Draft PR created: Keep the negative tax amount sign for unreported expenses
Please mark it as "Ready for review" or ask me to do that for you when it is ready for review.
It implements the proposed fix and also passes the unreported flag to
getTaxAmountingetTransactionSortValue, as you asked. I added unit tests for the tax helpers,getTransactionDetailsandgetTransactionSortValue. The related unit, UI and IOU test suites, typecheck, lint and spell check pass. I didn't test it in the app.view run
[-]Expense - Negative tax amount is not retained after unreporting expense[/-][+][$175] Expense - Negative tax amount is not retained after unreporting expense[/+]melvin-bot commentedon Oct 10, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022108798321114811700
grgia commentedon Oct 12, 2026
Offending PR reverted
[-][$175] Expense - Negative tax amount is not retained after unreporting expense[/-][+][QA Retest & Close] Expense - Negative tax amount is not retained after unreporting expense[/+]kavimuru commentedon Oct 12, 2026
@cristipaval After changing tax rate, amount in report expense remains positive PR reverted
bandicam.2026-10-12.15-02-49-107.mp4
izarutskaya commentedon Oct 13, 2026
Tax amount is not negative either before and after remove from report
Chrome / v9.5.7-3
Recording.4028.mp4
bandicam.2026-10-13.11-18-51-334.mp4