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-09-04] Negative expenses don't appear in the "Add Expenses" field on draft reports #98425
Version Number: 9.4.52-9 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@Justin-Hayes-PH Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Have negative expense in Unreported status (Create negative expense in Self DM)
Navigate to Spend > Expenses > +Create > Create Report
Add Expenses > Existing Expenses
Expected Result:
All Unreported expenses show here
Actual Result:
Only expenses with a positive value appear there, expenses that are negative are excluded.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Select the officially supported platforms where the issue was reproduced:
Only block negative amounts for unreported expenses.
// Only block negative amounts for unreported expenses.if(transactionAmount<0&&isUnreported){returnfalse;}
Because the negative expense created in the Self DM is unreported (isUnreported === true) and its amount is negative, it is dropped before the list is rendered — so only positive-value unreported expenses appear. This matches the reported symptom exactly.
Note the guard applies to every target report type. The very next line already restricts the zero-amount exclusion to IOU reports only (isIOU && transactionAmount === 0), but the negative-amount exclusion is not scoped that way, so it also removes negative expenses when the target is a regular expense report (the flow in this issue: Spend → Expenses → +Create → Create Report). Negative expenses (credits/refunds) are legitimate on expense reports; they are only invalid on IOU/money-request reports.
Why this is the right code path & related sign nuance
What changes do you think we should make in order to solve the problem?
Scope the negative-amount exclusion to IOU reports only, mirroring the existing zero-amount rule, so negative unreported expenses remain selectable when the target is an expense report.
In src/pages/AddExistingExpense.tsx:124-132, replace the separate "negative when unreported" and "zero when IOU" guards with a single guard that blocks amounts <= 0only for IOU reports (isIOU). This keeps negative amounts out of money-request/IOU reports (where they are invalid) while allowing them into expense reports.
What alternative solutions did you explore? (Optional)
Remove the negative guard entirely — not recommended, since negative amounts should still be blocked for IOU reports.
Fix by amount sign only — insufficient, because the intent is report-type-dependent (allowed on expense reports, not on IOU).
Confidence: Medium — root cause is pinned to a specific return false in the eligibility filter with clear code evidence; the exact scoping of the fix (IOU-only) should be confirmed against the original intent of the guard by a reviewer familiar with the Add-Existing-Expense flow.
Related issue:#98268 — negative amounts rendering as positive in the same RHP (sign-handling in this area).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/blob/ed3f5b11eddf68f52130fcade87d47f826bf5467/src/pages/AddExistingExpense.tsx#L124-L127) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
@nyomanjyotisa can you help me understand why we added this condition in your PR? #89357
It's a valid business case for a user to have negative unreported expenses (i.e a chargeback or something) and need to add that to their report. I totally agree we don't want to extend that to expenses on IOUReports used for P2P, but this doesn't seem right.
@trjExpensify You’re right. The original issue behind #72552 was specifically about preventing negative expenses from being added to IOU reports. In #89357, I preserved #72552’s broader implementation and test and overlooked that original scope and the later clarification. Negative expenses should be allowed on expense reports and blocked only on IOU reports. Sorry for the oversight.
wow... this one is a lil confusing cuz the second PR was linked in the OP to the first PR. I think I the payment above is correct. Think we're good to close, comment or reopen if you disagree.
Activity
MelvinBot commentedon Aug 12, 2026
Proposal
What is the root cause of that problem?
The "Add Expenses → Existing Expenses" list explicitly filters out any unreported expense whose amount is negative.
In
src/pages/AddExistingExpense.tsx:124-127, the eligibility filter has this rule:Because the negative expense created in the Self DM is unreported (
isUnreported === true) and its amount is negative, it is dropped before the list is rendered — so only positive-value unreported expenses appear. This matches the reported symptom exactly.Note the guard applies to every target report type. The very next line already restricts the zero-amount exclusion to IOU reports only (
isIOU && transactionAmount === 0), but the negative-amount exclusion is not scoped that way, so it also removes negative expenses when the target is a regular expense report (the flow in this issue: Spend → Expenses → +Create → Create Report). Negative expenses (credits/refunds) are legitimate on expense reports; they are only invalid on IOU/money-request reports.Why this is the right code path & related sign nuance
reportIDis the sentinel unreported id or empty (isUnreportedTransaction, AddExistingExpense.tsx:60-62).transactionAmountcomes fromgetTransactionDetails(...).amount, which applies opposite-sign conversion for unreported/expense-report transactions (getAmount, TransactionUtils/index.ts:1010-1036). The sign handling in this same RHP is itself inconsistent, which is tracked separately in [Exploratory] Expense - Negative amount show as positive on Add existing expense RHP #98268 ("Negative amount show as positive on Add existing expense RHP") — that explains why some negatives leak through displayed as positive while others get filtered out here.What changes do you think we should make in order to solve the problem?
Scope the negative-amount exclusion to IOU reports only, mirroring the existing zero-amount rule, so negative unreported expenses remain selectable when the target is an expense report.
In
src/pages/AddExistingExpense.tsx:124-132, replace the separate "negative when unreported" and "zero when IOU" guards with a single guard that blocks amounts<= 0only for IOU reports (isIOU). This keeps negative amounts out of money-request/IOU reports (where they are invalid) while allowing them into expense reports.What alternative solutions did you explore? (Optional)
Confidence: Medium — root cause is pinned to a specific
return falsein the eligibility filter with clear code evidence; the exact scoping of the fix (IOU-only) should be confirmed against the original intent of the guard by a reviewer familiar with the Add-Existing-Expense flow.Related issue: #98268 — negative amounts rendering as positive in the same RHP (sign-handling in this area).
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/blob/ed3f5b11eddf68f52130fcade87d47f826bf5467/src/pages/AddExistingExpense.tsx#L124-L127)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
j3ffffff commentedon Aug 12, 2026
melvin-bot commentedon Aug 12, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @FitseTLT (
External)melvin-bot commentedon Aug 12, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022087532873830434568
trjExpensify commentedon Aug 12, 2026
@nyomanjyotisa can you help me understand why we added this condition in your PR? #89357
It's a valid business case for a user to have negative unreported expenses (i.e a chargeback or something) and need to add that to their report. I totally agree we don't want to extend that to expenses on IOUReports used for P2P, but this doesn't seem right.
nyomanjyotisa commentedon Aug 13, 2026
@trjExpensify You’re right. The original issue behind #72552 was specifically about preventing negative expenses from being added to IOU reports. In #89357, I preserved #72552’s broader implementation and test and overlooked that original scope and the later clarification. Negative expenses should be allowed on expense reports and blocked only on IOU reports. Sorry for the oversight.
trjExpensify commentedon Aug 13, 2026
Do you mind working on a PR to rectify this?
nyomanjyotisa commentedon Aug 13, 2026
Sure, I’ll work on a PR.
19 remaining items
FitseTLT commentedon Sep 3, 2026
@mallenexpensify Pls also consider the extra bug I fixed here confirmed and fixed in pr. Thx
madmax330 commentedon Sep 7, 2026
Not overdue, waiting on payment
melvin-bot commentedon Sep 8, 2026
@mallenexpensify Huh... This is 4 days overdue. Who can take care of this?
mallenexpensify commentedon Sep 8, 2026
Payment Summary
Contributor: @nyomanjyotisa due $250 via NewDot
Contributor+: @FitseTLT due $375 via NewDot
@FitseTLT $125 on the followup PR cuz no tests needed.
mallenexpensify commentedon Sep 8, 2026
@nyomanjyotisa are you due payment too? I couldn't quite tell cuz it looked like this came from a PR you worked on, per
nyomanjyotisa commentedon Sep 9, 2026
@mallenexpensify I believe so. I authored #98627 after Tom asked me to fix it. #89357 was deployed on May 4, and #98425 was reported on August 12, outside the seven-day regression period.
mallenexpensify commentedon Sep 9, 2026
wow... this one is a lil confusing cuz the second PR was linked in the OP to the first PR. I think I the payment above is correct. Think we're good to close, comment or reopen if you disagree.
trjExpensify commentedon Sep 10, 2026
approved $250 for @nyomanjyotisa
flaviadefaria commentedon Sep 11, 2026
Approved: @FitseTLT due $375 via NewDot