Skip to content

[Merge Reports] Allow admins to merge approved reports #100399

Closed

Description

@melvin-bot

Follow-up to #92950 (Merge Reports).

Problem

Multiple calls surfaced the same request: an admin has several approved reimbursable reports from the same submitter and wants to reimburse once instead of once per report. Merging is the natural fix, but v1 of Merge Reports only allows merging reports that are in the same pre-approval state.

Today the workaround is:

  1. Unapprove each report (and bypass approval if the admin wasn't the approver)
  2. Merge the reports
  3. Re-approve
  4. Pay

That's a lot of steps, and it can create a duplicate in the accounting system if a report was already exported — the same risk the existing unapprove flow already warns about.

Solution

Allow workspace admins to merge reports in the Approved state.

  • Gated to admins only. Submitters and non-admin approvers keep the v1 behavior.
  • No gating on reimbursement method — this is available whether or not the workspace reimburses via Expensify ACH.
  • No special handling for reimbursable vs. non-reimbursable expenses.
  • Not available on Paid / reimbursed reports.
  • If any selected report has already been exported to a connected accounting integration, show a heads-up warning before confirming (see below). We are deliberately not blocking the merge — start open, and tighten later if we see people creating duplicates.
  • If the selected reports have different report field values, block the merge and show an error (see Scope Fix babel build on master #5). Admins can edit report fields on Approved reports, so they can fix the mismatch without unapproving.

Effectively this lets an admin bulk-reimburse when they don't care about preserving the report structure.

Export warning

Mirror the existing unapprove warning. The risk chain is the same shape:

Unapprove (today) Merge approved (this issue)
1. Approver approves 1. Approver approves
2. Admin exports 2. Admin exports
3. Admin unapproves — we warn here 3. Admin merges — we warn here
4. Admin re-approves + re-exports = duplicate 4. Admin re-exports = duplicate

Reuse the copy pattern from iou.unapproveWithIntegrationWarning in src/hooks/useLifecycleActions.tsx, with merge-specific wording.

Scope

1. FE — relax the eligibility gate

The v1 eligibility helper (specced in #94870) returns false when any report is settled, approved, or closed. Change that to:

  • Allow Approved reports when the current user is an admin of the workspace.
  • Keep rejecting Paid / reimbursed and Closed reports.
  • Keep every other v1 rule unchanged: same ownerAccountID, same policyID, same state across the selection, same managerID, and write access.

Add unit tests for the new branches: admin + all approved (allowed), non-admin + all approved (blocked), mixed approved/processing (blocked), any paid report (blocked).

2. FE — export warning in the merge RHP

3. BE — MergeReports accepts approved reports

The command (MergeReportsParams, mergeReports()) needs to handle approved source and destination reports:

  • Validate server-side that the requester is a workspace admin and that no selected report is paid/reimbursed — don't trust the client.
  • Move transactions out of an approved source report and into the approved destination report, recomputing totals on both.
  • The destination report keeps its Approved state and approval chain, and stays payable without re-approval.
  • Delete emptied source reports as in v1.

4. FE — surface it in the bulk-action menu

No new action needed — the existing Merge bulk action just becomes available for the newly eligible selections.

5. FE — block merges when report fields differ

  • Compare report field values across the selected reports. Skip formula fields, since nobody can edit them.
  • If any value differs, block the merge and show this error. Use it in every case, whether one field or several differ:

These reports have different report field values. To merge them, make the report fields match on each report first.

  • Add unit tests: matching fields (allowed), one differing field (blocked), only a formula field differs (allowed).

Out of scope

  • Merging Paid / reimbursed reports.
  • Blocking merges of already-exported reports (we warn instead — revisit if this causes real reconciliation pain).
  • Cross-workspace and cross-account merges — unchanged from v1.
  • True batch/NACHA-level reimbursements. That's a better long-term answer for the payment case and is tracked separately.

Open questions

  • Should the warning name the connected integration and list which of the selected reports were already exported, or stay generic?
  • Does moving expenses between two approved reports need any special handling for reports that are partially exported (some expenses exported, some not)?

Slack thread: https://expensify.slack.com/archives/C03U7DCU4/p1788522462302919

Issue Owner: @garrettmknight

Issue OwnerCurrent Issue Owner: @situchan

Activity

  1. melvin-bot commented on Sep 4, 2026

    @melvin-bot
    Author

    Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature)

  2. changed the title [-][Merge Reports] Allow admins to merge approved reports[/-] [+][HOLD for #92950 ] [Merge Reports] Allow admins to merge approved reports[/+] on Sep 4, 2026
  3. garrettmknight commented on Sep 14, 2026

    @garrettmknight
    Contributor

    Still held

  4. added
    Skip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.
    on Sep 18, 2026
  5. changed the title [-][HOLD for #92950 ] [Merge Reports] Allow admins to merge approved reports[/-] [+][Merge Reports] Allow admins to merge approved reports[/+] on Sep 24, 2026
  6. 19 remaining items

  7. self-assigned this
    on Oct 8, 2026
  8. ShridharGoel commented on Oct 9, 2026

    @ShridharGoel
    Contributor

    BE changes are on prod

  9. melvin-bot commented on Nov 2, 2026

    @melvin-bot
    Author

    This issue has not been updated in over 15 days. @garrettmknight, @Beamanator, @ShridharGoel, @situchan, @dmkt9 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!

  10. Beamanator commented on Nov 3, 2026

    @Beamanator
    Contributor

    #102712 got to staging yesterday!

  11. melvin-bot commented on Nov 3, 2026

    @melvin-bot
    Author

    @situchan / @dmkt9

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.30-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

  12. melvin-bot commented on Nov 6, 2026

    @melvin-bot
    Author

    @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  13. garrettmknight commented on Nov 10, 2026

    @garrettmknight
    Contributor

    We're on prod!

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

Metadata

Metadata

Labels

DailyKSv2Skip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions