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
[$250] Reports - Pay with business account is shown when bulk paying negative expense #75655
Version Number: 9.2.61-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#72936 Email or phone of affected tester (no customers):sdoidjnodsjoidjso@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.5 / Chrome App Component: Search
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create an expense with negative amount.
Open expense report.
Click Submit and Approve.
→ Mark as paid button is shown without Pay with business account button - Expected.
Go to Reports > Reports.
Select the report with negative expense via checkbox.
Click dropdown button > Pay.
Expected Result:
Pay with business account button should not show up for negative expense.
Actual Result:
Pay with business account button is shown for negative expense when bulk paying.
📣 @moneymaker-100xo4! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Please re-state the problem that we are trying to solve in this issue.
When bulk paying reports from the Reports page, the "Pay with business account" button incorrectly appears for reports containing negative expenses. However, when paying a negative expense individually from the expense report page, the button correctly does not appear (only "Mark as paid" is shown).
What is the root cause of that problem?
The root cause is in the useBulkPayOptions hook at line 73. The hook determines whether to show business bank account payment options based on whether it's an expense report and not a personal-only option, but it does not check if the expense has a negative reimbursable spend amount.
The issue occurs because:
Missing negative expense check: The shouldShowBusinessBankAccountOptions variable at line 73 is calculated as isExpenseReport && !isPersonalOnlyOption, which doesn't account for negative expenses. This is different from the individual payment flow in SettlementButton component, which correctly handles negative expenses through the canIOUBePaid function.
Inconsistent logic with individual payment: In the individual payment flow, the canIOUBePaid function in src/libs/actions/IOU.ts at line 10182 checks for negative expenses: const canShowMarkedAsPaidForNegativeAmount = onlyShowPayElsewhere && reimbursableSpend < 0;. This ensures that when reimbursableSpend < 0, only the "Pay elsewhere" (Mark as paid) option is shown, not the business bank account option.
Business bank account option added unconditionally: At line 137-139 and line 152-154, the business bank account payment method is added to the button options when shouldShowBusinessBankAccountOptions is true, without checking if the expense has a negative amount.
When a report has a negative reimbursable spend, it represents a credit or refund scenario where the company owes the employee money, not the other way around. In such cases, the business bank account payment option should not be available because you cannot "pay" a negative amount using a business account - you can only mark it as paid elsewhere.
What changes do you think we should make in order to solve the problem?
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.
changed the title [-]Reports - Pay with business account is shown when bulk paying negative expense[/-][+][$250] Reports - Pay with business account is shown when bulk paying negative expense[/+]on Nov 24, 2025
[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: N/A
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Activity
melvin-bot commentedon Nov 20, 2025
Triggered auto assignment to @RachCHopkins (
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.melvin-bot commentedon Nov 20, 2025
📣 @moneymaker-100xo4! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
abbasifaizan70 commentedon Nov 20, 2025
Proposal:
Please re-state the problem that we are trying to solve in this issue.
When bulk paying reports from the Reports page, the "Pay with business account" button incorrectly appears for reports containing negative expenses. However, when paying a negative expense individually from the expense report page, the button correctly does not appear (only "Mark as paid" is shown).
What is the root cause of that problem?
The root cause is in the
useBulkPayOptionshook at line 73. The hook determines whether to show business bank account payment options based on whether it's an expense report and not a personal-only option, but it does not check if the expense has a negative reimbursable spend amount.The issue occurs because:
Missing negative expense check: The
shouldShowBusinessBankAccountOptionsvariable at line 73 is calculated asisExpenseReport && !isPersonalOnlyOption, which doesn't account for negative expenses. This is different from the individual payment flow inSettlementButtoncomponent, which correctly handles negative expenses through thecanIOUBePaidfunction.Inconsistent logic with individual payment: In the individual payment flow, the
canIOUBePaidfunction insrc/libs/actions/IOU.tsat line 10182 checks for negative expenses:const canShowMarkedAsPaidForNegativeAmount = onlyShowPayElsewhere && reimbursableSpend < 0;. This ensures that whenreimbursableSpend < 0, only the "Pay elsewhere" (Mark as paid) option is shown, not the business bank account option.Business bank account option added unconditionally: At line 137-139 and line 152-154, the business bank account payment method is added to the button options when
shouldShowBusinessBankAccountOptionsis true, without checking if the expense has a negative amount.Missing reimbursable spend calculation: The hook doesn't calculate the
reimbursableSpendusinggetMoneyRequestSpendBreakdownfunction fromsrc/libs/ReportUtils.tsat line 4174, which is needed to determine if the expense is negative.When a report has a negative reimbursable spend, it represents a credit or refund scenario where the company owes the employee money, not the other way around. In such cases, the business bank account payment option should not be available because you cannot "pay" a negative amount using a business account - you can only mark it as paid elsewhere.
What changes do you think we should make in order to solve the problem?
File:
src/hooks/useBulkPayOptions.tsCode Changes:
What alternative solutions did you explore? (Optional)
N/A
nkdengineer commentedon Nov 21, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Pay with business account button is shown for negative expense when bulk paying.
What is the root cause of that problem?
useBulkPayOptionsdoesn't return onlyMark as paidoption ifonlyShowPayElsewhereistruelike we did forusePaymentOptionsApp/src/hooks/useBulkPayOptions.ts
Line 129 in d87daa3
App/src/hooks/usePaymentOptions.ts
Lines 146 to 148 in d87daa3
What changes do you think we should make in order to solve the problem?
We should add
onlyShowPayElsewherecheck touseBulkPayOptionslike we did here, hereApp/src/hooks/useBulkPayOptions.ts
Line 135 in d87daa3
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.
RachCHopkins commentedon Nov 24, 2025
Cool, can repro. Confirming a reimbursable credit should not have a payment via bank account option, only mark as paid.
[-]Reports - Pay with business account is shown when bulk paying negative expense[/-][+][$250] Reports - Pay with business account is shown when bulk paying negative expense[/+]melvin-bot commentedon Nov 24, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021993077525363528392
16 remaining items
nkdengineer commentedon Jan 12, 2026
@RachCHopkins The automation failed, please handle the payment.
hoangzinh commentedon Jan 12, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/70106/files#r2682704915
[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: N/A
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/597060
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-ec08-a796-0ae5-43aa1df15754melvin-bot commentedon Jan 17, 2026
This issue has not been updated in over 15 days. @hoangzinh, @Julesssss, @RachCHopkins, @nkdengineer eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
hoangzinh commentedon Jan 18, 2026
@RachCHopkins this issue is ready for payment
melvin-bot commentedon Feb 3, 2026
@hoangzinh 10 days overdue. Is anyone even seeing these? Hello?
hoangzinh commentedon Feb 4, 2026
Ping @RachCHopkins on Slack https://expensify.slack.com/archives/C01GTK53T8Q/p1770180477468699
RachCHopkins commentedon Feb 4, 2026
Payment Summary:
Upwork job here
RachCHopkins commentedon Feb 4, 2026
No one to pay via Upwork, and the Upwork post has been closed.
🟢 to request payment.
garrettmknight commentedon Feb 10, 2026
$250 approved for @hoangzinh
twisterdotcom commentedon Feb 25, 2026
@nkdengineer has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-7b8a-ac5e-be2d-713118c9ca54