Skip to content

[Due for payment 2026-05-20] [$250] Showing option to pay non-reimbursable on reports list #88549

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.61-2
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: @joekaufmanexpensify
Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Create a report with only non-reimbursable expenses on a workspace with payments enabled
  2. Submit the report and approve it as an admin
  3. Go to the Spend page and tap All reports

Expected Result:

The report action button is View on the report list.
Note: we still want to show the option to Mark as paid these reports inside the report itself or in the report preview, per this PR. They will also remain available in bulk pay.

Actual Result:

The report action button is Pay in the report list.

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Image Image
Recording.2743.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022047046108138402412
  • Upwork Job ID: 2047046108138402412
  • Last Price Increase: 2026-04-22

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 22, 2026
  2. MelvinBot commented on Apr 22, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #87552 changed the logic in SearchUIUtils.ts:getActions() so that shouldOnlyShowElsewhere is no longer filtered out for non-reimbursable-only reports. Previously there was an explicit exclusion (&& !reportHasOnlyNonReimbursableTransactions) on that flag, which prevented PAY from being added as a list-level action for these reports. After the PR simplified this to shouldOnlyShowElsewhere = !canBePaid && canOnlyBePaidElsewhere, non-reimbursable-only approved reports now trigger PAY in the search list because canIOUBePaid returns true when onlyShowPayElsewhere=true via the isOnlyNonReimbursablePayElsewhere condition.

    What changes do you think we should make in order to solve the problem?

    In SearchUIUtils.ts around line 2317, when deciding whether to push PAY into allActions, add a check that excludes reports with only non-reimbursable transactions from showing the Pay button on the list. Specifically, when shouldOnlyShowElsewhere is true but the report has only non-reimbursable transactions (via hasOnlyNonReimbursableTransactions), do not add PAY as an action. This preserves the "Mark as paid" option inside the report detail view and in bulk pay (which use different code paths) while showing "View" on the report list.

    What alternative solutions did you explore?

    An alternative would be to modify canIOUBePaid in ReportWorkflow.ts to accept a context parameter distinguishing list vs detail views. However, this would add complexity to a widely-used utility function. The simpler approach is to filter at the call site in SearchUIUtils.ts since that's the only place where the list-level distinction matters.

    Supporting evidence

    Key code locations:

    Related issue: #87762 ("Pinned pay action in LHN for non-reimbursable report") appears to be the same underlying problem manifesting in the LHN context.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 22, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 22, 2026
  5. melvin-bot commented on Apr 22, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @abzokhattab (External)

  6. wildan-m commented on Apr 22, 2026

    @wildan-m
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    On the Spend page > All reports list, the action button shows Pay for reports that contain only non-reimbursable expenses. The expected button is View, since #87552 intentionally restricts the bulk/listing pay surfaces for non-reimbursable-only reports while keeping Mark as paid available inside the report itself and inside the report preview.

    What is the root cause of that problem?

    The reports list resolves the per-row action via getActions in SearchUIUtils.ts. It evaluates two flavors of canIOUBePaid — one that requires a usable bank account, and a second pay-elsewhere variant that only checks if the offline payer flow is available — and pushes PAY into the row's actions whenever either is satisfied:

    App/src/libs/SearchUIUtils.ts

    Lines 2312 to 2319 in 0a3ec18

    const canBePaid = canIOUBePaid(report, chatReport, policy, bankAccountList, allReportTransactions, false, chatReportRNVP, invoiceReceiverPolicy);
    const canOnlyBePaidElsewhere = canIOUBePaid(report, chatReport, policy, bankAccountList, allReportTransactions, true, chatReportRNVP, invoiceReceiverPolicy);
    const shouldOnlyShowElsewhere = !canBePaid && canOnlyBePaidElsewhere;
    // We're not supporting pay partial amount on search page now.
    if ((canBePaid || shouldOnlyShowElsewhere) && !hasHeldExpenses(report.reportID, allReportTransactions)) {
    allActions.push(CONST.SEARCH.ACTION_TYPES.PAY);
    }

    For a report with only non-reimbursable expenses on a workspace with payments enabled, the first check returns false (no ACH path is offered for non-reimbursable, per #87552), but the pay-elsewhere check still returns true. That makes shouldOnlyShowElsewhere true, the PAY action gets pushed, and the row renders Pay instead of falling through to View.

    This is the same gap that affected the LHN pay badge: the pay-elsewhere fallback fires for non-reimbursable-only reports even though those reports have been removed from the listing/queue surfaces. The LHN side was closed by gating that branch on hasOnlyNonReimbursableTransactions; the reports-list/search-action side was not touched and still leaks the PAY action.

    What changes do you think we should make in order to solve the problem?

    Gate the pay-elsewhere branch in getActions so it does not contribute the PAY action when the report contains only non-reimbursable transactions. Concretely, at the line that currently pushes CONST.SEARCH.ACTION_TYPES.PAY based on (canBePaid || shouldOnlyShowElsewhere), only let shouldOnlyShowElsewhere count when the report has at least one reimbursable transaction.

    The action helper for this check, hasOnlyNonReimbursableTransactions, already exists in ReportUtils.ts and accepts the precomputed transactions array, so the gate can reuse the allReportTransactions already gathered above and avoids any extra Onyx lookup:

    App/src/libs/ReportUtils.ts

    Lines 2555 to 2565 in 0a3ec18

    /**
    * Checks if a report contains only Non-Reimbursable transactions
    */
    function hasOnlyNonReimbursableTransactions(iouReportID: string | undefined, transactionsParam?: Transaction[]): boolean {
    const transactions = transactionsParam ?? getReportTransactions(iouReportID);
    if (!transactions || transactions.length === 0) {
    return false;
    }
    return transactions.every((transaction) => !getReimbursable(transaction));
    }

    After the gate, the allActions array stays empty for non-reimbursable-only reports that have no other applicable action, and the function falls through to its default [CONST.SEARCH.ACTION_TYPES.VIEW] return at the bottom — so the row renders View as expected. The in-report Mark as paid and report preview pay action are unaffected because they live in different code paths (MoneyReportHeader, ReportPreviewActionButton, PayActionButton) and continue to use their own helpers.

    Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/88549-spend-list-pay-nonreimbursable?expand=1

    What alternative solutions did you explore? (Optional)

    Pushing the gate down into canIOUBePaid itself was considered, but canIOUBePaid is intentionally shared by surfaces that still want to offer pay-elsewhere for non-reimbursable (the report header, the report preview, the bulk-pay action) — those callers were preserved on purpose by #87552. Adding the non-reimbursable filter at the call site keeps the helper's contract intact and matches the surgical pattern already used for the LHN badge fix.

  7. changed the title [-]Showing option to pay non-reimbursable on reports list[/-] [+][$250] Showing option to pay non-reimbursable on reports list[/+] on Apr 22, 2026
  8. melvin-bot commented on Apr 22, 2026

    @melvin-bot
  9. MobileMage commented on Apr 22, 2026

    @MobileMage
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  10. github-actions commented on Apr 22, 2026

    @github-actions
    Contributor

    ⚠️ @MobileMage Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  11. wildan-m commented on Apr 22, 2026

    @wildan-m
    Contributor

    Proposal updated — added compare branch with implementation.

  12. 15antonian commented on Apr 22, 2026

    @15antonian

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  13. 33 remaining items

  14. melvin-bot commented on May 20, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2047046108138402412/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. mallenexpensify commented on May 22, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @emkhalid paid $250 via Upwork
    Contributor+: @abzokhattab due $250 via NewDot

    @emkhalid can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022047046108138402412

    @abzokhattab plz complete the BZ checklist and tag me in a post once you have. Thx

  16. emkhalid commented on May 22, 2026

    @emkhalid
    Contributor

    @mallenexpensify accepted the job, thanks

  17. mallenexpensify commented on May 22, 2026

    @mallenexpensify
    Contributor

    @emkhalid paid, summary updated above.

    @abzokhattab plz complete the BZ checklist and tag me in a post once you have. Thx

  18. abzokhattab commented on May 23, 2026

    @abzokhattab
    Contributor

    BugZero Checklist:

    • [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.

      Link to the comment: https://github.com/Expensify/App/pull/87552/changes#r3291800401

    • [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/640776

    Regression Test Proposal

    Precondition:

    • Have a workspace with payments enabled and an approved expense report containing only non-reimbursable expenses

    Test:

    1. Navigate to Spend > All reports
    2. Find the non-reimbursable-only expense report in the list
    3. Verify the row action shows "View" (not "Pay")
    4. Open the report and verify "Mark as paid" is still available inside the report detail view
    5. Verify bulk pay selection still works correctly for reimbursable reports

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-cb5a-ada1-2c30-f4f2929a3154
  19. abzokhattab commented on May 23, 2026

    @abzokhattab
    Contributor
  20. quinthar commented on Jun 29, 2026

    @quinthar
    Contributor

    Approved $250 to @abzokhattab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions