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
Expense - Tax amount field is not negative when amount is negative #103664
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):jsoidjndoiniodnsjojd@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.
Click + > Create expense > Manual.
Enter negative amount.
Click Tax field and select 5% rate.
Expected Result:
Tax amount field will be negative.
Actual Result:
Tax amount field is not negative when amount is negative.
👋 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, don't revert.Show negative tax amount for negative expenses on the expense details page did not cause this. The create-expense flow has always shown a positive tax for a negative amount, and production behaves the same way. The PR only changed the details page of an existing expense. QA found this gap while testing that PR, which is why it was auto-linked.
Root cause: The manual create flow forces the tax amount positive in several places. None of them changed in this deploy:
What PR #102175 changed. It touched only MoneyRequestView.tsx, ReportUtils.ts, TransactionUtils/index.ts, and tests. It removed Math.abs() from the details-page tax display. In TransactionUtils, it refactored getTaxAmount into normalizeTaxAmountSign without changing behavior: isFromExpenseReport = false still returns Math.abs(...), as before. The create flow calls it with false, so the result is unchanged.
Other PRs on the deploy. I checked every PR on the Deploy Checklist: New Expensify 2026-10-09 that touches tax or confirm-page code. None changes the tax sign in the create flow. TaxFields.tsx and useTaxAmount.ts were last changed in earlier releases already on production.
Why reverting won't help. A revert leaves the create flow unchanged and brings back the details-page inconsistency the PR fixed.
Where to fix it (follow-up). Change these together so the sign is consistent from calculation to display:
useTaxAmount.ts:77 and line 83: use the signed amount for expense reports. Keep Math.abs for IOU/P2P requests.
Please re-state the problem that the issue is addressing
Expense - Tax amount field is not negative when amount is negative during manual expense creation.
What is the root cause of that problem?
In the manual expense creation flow:
In \DynamicIOURequestStepTaxRatePage.tsx:159, when selecting a tax rate, tax calculation calls:
\getTaxAmount(policy, currentTransaction, taxes.code, getAmount(currentTransaction, false, true), decimals)
Passing \isFromTrackedExpense = true\ to \getAmount\ causes \getAmount\ to invert the draft transaction amount (\�mount ? -amount : 0), flipping the user's negative amount -1000\ into +1000. This computes a positive tax amount +48\ which is saved into the draft transaction via \setMoneyRequestTaxRateValues.
In \useTaxAmount.ts:77\ and line 83, \ axableAmount\ and \ axAmount\ use \Math.abs(...)\ unconditionally (\Math.abs(transaction?.amount ?? 0)\ and \Math.abs(transaction?.taxAmount ?? 0)), which forces any computed tax amount to be positive. \TaxController.tsx\ then synchronizes and overwrites \ ransaction.taxAmount\ with this positive value.
In \TaxFields.tsx:70, the displayed tax amount was read via \getTaxAmount(transactionForHelpers, false)\ which calls
ormalizeTaxAmountSign(..., false)\ returning \Math.abs(...), stripping the negative sign from display. Additionally, \NumberWithSymbolForm\ was missing \�llowNegativeInput\ for negative expenses.
In \DynamicIOURequestStepTaxAmountPage.tsx:181, \�mount\ was passed as \Math.abs(transactionDetails?.taxAmount ?? 0), \getTaxAmount\ did not receive \�llowNegative\ and \disableOppositeConversion, and \�llowFlippingAmount\ was not passed to \MoneyRequestAmountForm.
What changes do you think we should make in order to solve the problem?
In \src/components/MoneyRequestConfirmationList/hooks/useTaxAmount.ts:
Preserve the signed amount when computing \ axableAmount\ and \ axAmount\ instead of wrapping with \Math.abs:
\\ ypescript
const taxableAmount = isDistanceRequest ? DistanceRequestUtils.getTaxableAmount(policy, customUnitRateID, taxableDistance) : (transaction?.amount ?? 0);
...
const taxAmount = isMovingTransactionFromTrackExpense && transaction?.taxAmount ? (transaction?.taxAmount ?? 0) : calculateTaxAmount(taxPercentage, taxableAmount, taxDecimals);
\\
In \src/components/MoneyRequestConfirmationList/sections/TaxFields.tsx:
Read \ axAmount\ directly from \ axSlice?.taxAmount ?? 0, and pass \�llowNegativeInput={(taxSlice?.amount ?? 0) < 0}\ to \NumberWithSymbolForm.
In \src/pages/iou/request/step/DynamicIOURequestStepTaxAmountPage.tsx:
Update \getTaxAmount\ to accept \isExpenseReport, \�llowNegative, and \disableOppositeConversion, and pass \�mount={transactionDetails?.taxAmount ?? 0}, the signed \ axAmount, and \�llowFlippingAmount={allowNegative}\ to \MoneyRequestAmountForm.
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/2a79237905f839422234ca59f8ace23e7437aaa78310155c4caf06089c8c3032
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 Investigation
Recommendation: demote, don't revert. Show negative tax amount for negative expenses on the expense details page did not cause this. The create-expense flow has always shown a positive tax for a negative amount, and production behaves the same way. The PR only changed the details page of an existing expense. QA found this gap while testing that PR, which is why it was auto-linked.
Root cause: The manual create flow forces the tax amount positive in several places. None of them changed in this deploy:
getTaxAmount(transaction, false), which returnsMath.abs(...)(TransactionUtils/index.ts:540-542).Math.abs(transaction?.amount).Suggested next step: An internal engineer (for example,
grgia) should confirm and removeDeployBlockerCash. Track the create-flow fix as a follow-up under [Exploratory] Web - Taxes - Inconsistent tax amount display on report with negative expenses.Investigation details
What PR #102175 changed. It touched only
MoneyRequestView.tsx,ReportUtils.ts,TransactionUtils/index.ts, and tests. It removedMath.abs()from the details-page tax display. InTransactionUtils, it refactoredgetTaxAmountintonormalizeTaxAmountSignwithout changing behavior:isFromExpenseReport = falsestill returnsMath.abs(...), as before. The create flow calls it withfalse, so the result is unchanged.Other PRs on the deploy. I checked every PR on the Deploy Checklist: New Expensify 2026-10-09 that touches tax or confirm-page code. None changes the tax sign in the create flow.
TaxFields.tsxanduseTaxAmount.tswere last changed in earlier releases already on production.Why reverting won't help. A revert leaves the create flow unchanged and brings back the details-page inconsistency the PR fixed.
Where to fix it (follow-up). Change these together so the sign is consistent from calculation to display:
Math.absfor IOU/P2P requests.Limits. This is based on code analysis. I did not reproduce it on staging or production.
bernhardoj commentedon Oct 10, 2026
True.
Related to #103663
jloa-dev commentedon Oct 10, 2026
Proposal
Please re-state the problem that the issue is addressing
Expense - Tax amount field is not negative when amount is negative during manual expense creation.
What is the root cause of that problem?
In the manual expense creation flow:
\getTaxAmount(policy, currentTransaction, taxes.code, getAmount(currentTransaction, false, true), decimals)
Passing \isFromTrackedExpense = true\ to \getAmount\ causes \getAmount\ to invert the draft transaction amount (\�mount ? -amount : 0), flipping the user's negative amount -1000\ into +1000. This computes a positive tax amount +48\ which is saved into the draft transaction via \setMoneyRequestTaxRateValues.
ormalizeTaxAmountSign(..., false)\ returning \Math.abs(...), stripping the negative sign from display. Additionally, \NumberWithSymbolForm\ was missing \�llowNegativeInput\ for negative expenses.
What changes do you think we should make in order to solve the problem?
Derive the signed transaction amount respecting negative expenses and the create flow:
\\ ypescript
const isCreateAction = action === CONST.IOU.ACTION.CREATE;
const isSubmitAction = action === CONST.IOU.ACTION.SUBMIT;
const isSubmitType = iouType === CONST.IOU.TYPE.SUBMIT;
const allowNegative = shouldEnableNegative(report, policy, iouType, currentTransaction?.participants);
const disableOppositeConversion = isCreateAction || (isSubmitType && isSubmitAction);
const transactionAmount = getAmount(currentTransaction, isExpenseReport(report), currentTransaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID, allowNegative, disableOppositeConversion);
const taxAmount = getTaxAmount(policy, currentTransaction, taxes.code, transactionAmount, decimals);
\\
Preserve the signed amount when computing \ axableAmount\ and \ axAmount\ instead of wrapping with \Math.abs:
\\ ypescript
const taxableAmount = isDistanceRequest ? DistanceRequestUtils.getTaxableAmount(policy, customUnitRateID, taxableDistance) : (transaction?.amount ?? 0);
...
const taxAmount = isMovingTransactionFromTrackExpense && transaction?.taxAmount ? (transaction?.taxAmount ?? 0) : calculateTaxAmount(taxPercentage, taxableAmount, taxDecimals);
\\
Read \ axAmount\ directly from \ axSlice?.taxAmount ?? 0, and pass \�llowNegativeInput={(taxSlice?.amount ?? 0) < 0}\ to \NumberWithSymbolForm.
Update \getTaxAmount\ to accept \isExpenseReport, \�llowNegative, and \disableOppositeConversion, and pass \�mount={transactionDetails?.taxAmount ?? 0}, the signed \ axAmount, and \�llowFlippingAmount={allowNegative}\ to \MoneyRequestAmountForm.
Tested branch pre-coded with unit test coverage on:
https://github.com/jloa-dev/App/tree/fix/103664-create-negative-tax-amount
jloa-dev commentedon Oct 10, 2026
Contributor details
Your Expensify account email: jloa.dev@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba22190aa
melvin-bot commentedon Oct 10, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
cristipaval commentedon Oct 12, 2026
demoting, per #103664 (comment)
grgia commentedon Oct 15, 2026
Reverted