[$250] Allow any workspace/payment admin to pay reports
Coming from this Slack thread, @sakluger flagged a classic/NewDot parity gap regarding payments.
Details
- When no bank account is connected to a workspace, any workspace or payment admin already sees the option to pay/mark as paid in NewDot. This part works correctly today and needs no changes.
- Payment Admin is a new Workspace role added here.
- The gap: when a bank account is connected to a workspace, NewDot only shows the pay button to the admin set as the workspace payer. Classic shows it to any workspace admin (and now payment admin).
- Proposal: any workspace (or payment) admin should see the option to pay (via any VBA they have access to) or manually mark as paid, regardless of whether a bank account is connected to the workspace.
- In the event the workspace or Payments Admin doesn't have a VBA, they should be prompted to add one in situ when they try to pay via business account (the existing payment button logic).
- An admin adding/paying with a bank account that's not the current workspace bank account shouldn't change the workspace bank account, same as now.
- We should not actively prompt admins that aren't the workspace payer to pay via badges/GBRs. That stays as-is (per https://github.com/Expensify/Expensify/issues/637864).
- One note: an admin that isn't the workspace payer who tries to pay a report via ACH in Classic sees an error, despite being able to mark as paid. I don't think we should go this direction in NewDot, since we already allow the admin set as the workspace payer to select the bank account to use at the time of payment in both NewDot and Classic. It feels more consistent to also allow the non-payer admin to select the bank account they want to use or mark as paid. Curious if anyone disagrees?
- I don't think this issue should require any backend changes. Let me know if anyone feels differently.
- This issue is only about who can see and use the pay button. It shouldn't change which options appear or how it behaves for a given report (e.g., non-reimbursable-only reports showing "Mark as Paid" only in the report detail view, not the report preview or the Spend page).
Non-payer workspace admin view when workspace has bank account - NewDot
Non-payer workspace admin view when workspace has bank account - OldDot
Non-payer workspace admin view when workspace has no bank account - NewDot
Non-payer workspace admin view when workspace has no bank account - OldDot
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022075307768398315166
- Upwork Job ID: 2075307768398315166
- Last Price Increase: 2026-07-09
Issue Owner
Current Issue Owner: @chuckdries
Triggered auto assignment to Design team member for new feature review - @dannymcclain (NewFeature)
@dannymcclain I don't think we need any mocks here. We're just showing the existing pay button to a broader group of admins. Let me know if you feel differently. Going ahead with soliciting proposals for now. 👍
@MelvinBot please submit a proposal for this issue following Expensify's normal proposal guidelines.
Proposal
What is the root cause of that problem?
The pay button is gated on being the single designated workspace payer, not on being an admin.
In isPayer, once a workspace has a designated reimburser — which is exactly the case when a bank account is connected (policy.achAccount.reimburser) — only that reimburser is treated as a payer. Other admins qualify only if they are a sharee of that specific VBA (auto reimbursement) or not at all (manual):
The designated-payer gate
reimburserEmail = policy.reimburser ?? policy.achAccount?.reimburser ?? …— ReportUtils.ts:2853- Auto (
REIMBURSEMENT_YES):isReimburser || (isAdmin && hasAccessToBankAccount)— ReportUtils.ts:2864-2869 - Manual (
REIMBURSEMENT_MANUAL):isReimburseronly — ReportUtils.ts:2873
There is already a "any admin / Payments Admin can pay" fallback layered on top of isPayer, but it is scoped to REIMBURSEMENT_MANUAL only, so it doesn't cover a bank-connected workspace that reimburses automatically:
The fallback is manual-only in all three pay-button surfaces
canIOUBePaid—isReportPayer || (reimbursementChoice === MANUAL && canMemberWrite(…, WORKFLOWS_PAYMENTS))ReportPreviewActionUtils.ts:130-132— sameMANUAL-only conditionReportPrimaryActionUtils.ts:228-232— same, additionally behind acanNonPayerAdminPayflag- Search/Reports page uses
isPolicyPayer, which also returnstrueonly whencurrentUserLogin === reimburserEmail
Net effect: on a workspace with a bank account connected + automatic reimbursement, a non-payer workspace admin or Payments Admin sees no pay button — the OldDot/NewDot parity gap.
What changes do you think we should make in order to solve the problem?
Separate "who can pay" (button visibility — should be broad) from "who is the designated payer" (prompting — stays narrow).
- Broaden the non-payer-admin fallback in the three pay-button surfaces (
canIOUBePaid,ReportPreviewActionUtils,ReportPrimaryActionUtils) so it applies whenever payments are enabled, not just manual reimbursement — i.e. gate onarePaymentsEnabled(policy)instead ofreimbursementChoice === REIMBURSEMENT_MANUAL. Any workspace admin or Payments Admin (canMemberWrite(policy, login, WORKFLOWS_PAYMENTS)) then sees the pay button regardless of being the designated payer or a VBA sharee. - Mirror the same broadening in
isPolicyPayerso the Search/Reports-page pay button matches. - Leave
isPayeritself unchanged. It also feeds the PAY badge (getBadgeFromIOUReport) and next-step/GBR messaging (NextStepUtils). Keeping it gated on the designated payer ensures non-payer admins still see the button but are not actively prompted via badges/GBRs — matching the issue requirement and Expensify/Expensify#637864.
No backend changes needed. A non-payer admin without a VBA who taps "pay via business account" hits the existing add-bank-account flow in situ; "mark as paid" already works via the pay-elsewhere path.
What alternative solutions did you explore? (Optional)
Broadening isPayer directly (one edit) — rejected, because it is shared by the badge/GBR/next-step logic, so it would start actively prompting non-payer admins to pay, which the issue explicitly rules out.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/95750) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Opening up to other proposals now so C+ can decide between Melvin and others.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On NewDot Web, when a workspace has a connected business bank account, the pay/mark-as-paid button is only shown to the admin designated as the workspace payer (reimburser). Classic shows it to any workspace admin — and now, with the newly added Payments Admin role (PR #94018), any Payments Admin should also see it. Expected: any workspace admin or payments admin can see and use the pay button (choosing a VBA they have access to, being prompted to add one, or marking as paid), regardless of whether the workspace has a bank account connected.
What is the root cause of that problem?
isPayer in src/libs/ReportUtils.ts:2820 defines isAdmin as policy?.role === CONST.POLICY.ROLE.ADMIN (line 2835), which excludes the new PAYMENTS_ADMIN role added in PR #94018. Additionally, in the auto-reimbursement branch (lines 2864–2869), the function returns isReimburser || (isAdmin && hasAccessToBankAccount) — so a non-reimburser workspace/payments admin who isn't on the connected bank account's sharees list returns false, hiding the pay button. Classic instead lets any admin see the button and pick a VBA (or be prompted to add one) at pay time.
What changes do you think we should make in order to solve the problem?
- src/libs/ReportUtils.ts:2835 — broaden
isAdminto also treatCONST.POLICY.ROLE.PAYMENTS_ADMINas an admin for payment authorization (e.g.[ROLE.ADMIN, ROLE.PAYMENTS_ADMIN].includes(policy?.role)when policy type isn't PERSONAL). - src/libs/ReportUtils.ts:2864-2869 (auto-reimbursement branch) — allow any workspace/payments admin to see the button even without bank-account sharee access; drop the
hasAccessToBankAccountgate here so the return becomesisReimburser || isAdmin. The in-situ VBA prompt / bank-picker at pay time handles the "no access to current VBA" case per the issue. - src/libs/ReportUtils.ts:2872-2873 (manual-reimbursement branch) — same relaxation: return
trueforisAdminin addition toisReimburser, so any admin can mark-as-paid or pay through their accessible VBA. - Verify downstream consumers (
PayPrimaryAction.tsx,PayActionButton.tsx,PayActionCell.tsx,MoneyReportHeaderSecondaryActions.tsx,MoneyReportHeaderSelectionDropdown.tsx,SearchUIUtils.ts,useSearchBulkActions.ts,useSelectionModeReportActions.ts,AnimatedSettlementButton.tsx,MoneyReportHeaderModals.tsx,actions/IOU/ReportWorkflow.ts) pass the current user's policy throughisPayerunchanged — no per-call-site changes needed since the gate lives in one function. - Keep GBR/badge prompting logic untouched (issue explicitly excludes it) — this change only affects who sees/uses the pay button, matching Classic parity.
What alternative solutions did you explore? (Optional)
Proposal
What is the root cause of that problem?
The pay-button gates already have an escape that lets any admin/payments admin pay when they aren't the designated payer, but it's hard-coded to manual reimbursement only. Connecting a bank account flips the policy's reimbursementChoice to reimburseYes and sets achAccount.reimburser (the workspace payer), which kills both paths at once:
isPayerin its auto-reimbursement branch only returns true for the designated reimburser, or an admin who is a sharee of the workspace's exact bank account:
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/ReportUtils.ts#L2863-L2873
- The non-payer-admin escape in
canIOUBePaidrequiresreimbursementChoice === REIMBURSEMENT_MANUAL, which is no longer true once a bank account is connected:
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/actions/IOU/ReportWorkflow.ts#L223-L226
The same manual-only escape is duplicated in the primary-action and report-preview gates:
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/ReportPrimaryActionUtils.ts#L227-L232
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/ReportPreviewActionUtils.ts#L129-L132
So: bank account connected → choice becomes reimburseYes → the manual-only escape stops applying → only isPayer gates the button → only the workspace payer (or a bank-account sharee) sees Pay. Classic shows it to any workspace/payments admin. Note this isn't a regression from PR #94018 — that PR only added the Payments Admin role/UI; the manual-only restriction predates it, and payments admins already satisfy the escape's canMemberWrite(..., WORKFLOWS_PAYMENTS) check via their permission bundle.
What changes do you think we should make in order to solve the problem?
Broaden the non-payer-admin escape so it applies whenever reimbursement is enabled (manual or direct), instead of manual only. Since the identical expression is duplicated in three places, extract it into a shared helper in PolicyUtils (next to isPolicyPayer), roughly:
function canAdminPayReport(policy, currentUserLogin) {
const isReimbursementEnabled =
policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL ||
policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES;
return isReimbursementEnabled && canMemberWrite(policy, currentUserLogin, CONST.POLICY.POLICY_FEATURE.WORKFLOWS_PAYMENTS);
}
and use it in the three gates above (canIOUBePaid, isPrimaryPayAction, and the report-preview canPay) in place of the inline manual-only check. canMemberWrite(..., WORKFLOWS_PAYMENTS) is write-all for admins and explicitly granted to payments admins, so both roles are covered.
Deliberately do not change isPayer (or isPolicyPayer). Those still drive the LHN Pay badge, GBR (hasOutstandingChildRequest), next-step copy, and Search pay suggestions — e.g. the badge separately requires isReportPayer before calling canIOUBePaid:
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/actions/IOU/ReportWorkflow.ts#L303-L306
so non-payer admins get the button but are not actively prompted via badges/GBRs, as the issue requires. Payment itself needs no changes: the settlement button already lists only bank accounts the user has access to, prompts them to add a VBA (KYC wall) if they have none, and paying from a different VBA doesn't change the workspace bank account.
What alternative solutions did you explore? (Optional)
Making isPayer's auto-reimbursement branch return true for any admin/payments admin (canPayOnPolicy). Rejected because isPayer also feeds badges, GBRs, and next-step messaging, which must stay payer-only per the issue.
Proposal
What is the root cause of that problem?
When a workspace has a business bank account (VBA) connected, a workspace admin or the new payment admin who is not the designated workspace payer does not see the Pay button on the report preview, MoneyReportHeader, or Spend page in NewDot. Classic shows it to any admin.
The pay button visibility is gated by ReportUtils.isPayer, which is consumed by canIOUBePaid in IOU.ts. isPayer treats the user as a valid payer only when they are a policy admin AND either there is no reimburser/bank account set, or their email matches the designated reimburser on the policy (policy.achAccount?.reimburser / policy.reimburserEmail). So once a VBA is connected and a reimburser is designated, every non-payer admin fails this check and the button is hidden.
ReportUtils.isPayer (the deepest gate):
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/ReportUtils.ts
Consumed by canIOUBePaid, which decides whether pay options render:
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/actions/IOU.ts
This is the parity gap: the reimburser-match condition wrongly restricts the button to the single workspace payer instead of allowing any workspace/payment admin.
What changes do you think we should make in order to solve the problem?
- In
ReportUtils.ts, relaxisPayerso that any policy admin (checked viaPolicyUtils.isPolicyAdmin) or payment admin returnstrue, regardless of whether a reimburser/VBA is designated. Remove the branch that requiressession.email === policy.achAccount?.reimburserfor admins to be considered payers.
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/ReportUtils.ts
const isAdmin = PolicyUtils.isPolicyAdmin(policy, session?.email);
const isPaymentAdmin = PolicyUtils.isPaymentsAdmin(policy, session?.accountID);
if (isAdmin || isPaymentAdmin) {
return true;
}
This lets any workspace or payment admin see the Pay option whether or not a bank account is connected, matching Classic.
- Keep
canIOUBePaidinIOU.tsunchanged in behavior beyond theisPayerresult, so the set of payment options (business account vs mark as paid) and per-report rules (for example non-reimbursable-only reports) stay identical.
https://github.com/Expensify/App/blob/b794ad367958627ccecd86681ff19ac7deba8596/src/libs/actions/IOU.ts
-
When a non-payer admin chooses to pay via business account without a VBA, reuse the existing add-bank-account flow triggered from the pay button (
KYCWall/ add bank account prompt), so they are prompted to add one in situ. No new prompting logic is needed. -
Do not change badge/GBR prompting. That logic (which only nudges the designated payer) is separate from
isPayerand should remain, per the linked requirement.
No backend changes are required, since this only affects who sees and can trigger the existing client-side pay actions.
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.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External)
Job added to Upwork: https://www.upwork.com/jobs/~022075307768398315166
Proposal
Please re-state the problem that we are trying to solve in this issue.
On NewDot, when a workspace has a business bank account connected, only the admin designated as the workspace payer sees the pay / mark-as-paid button on the report preview, MoneyReportHeader, and the Spend page. Classic shows it to any workspace admin — and now to the new Payments Admin role too. We want any workspace or payments admin to see and use the pay button regardless of whether a bank account is connected, without actively prompting non-payer admins via badges/GBRs.
What is the root cause of that problem?
The pay button on every surface is isPayer(...) || <non-payer-admin fallback>. isPayer intentionally stays payer-only (it also feeds badges/GBRs/next-steps), so the fallback is what's supposed to open the button up to other admins. On current main that fallback is broken in two independent ways.
1. It's gated on manual reimbursement only. Connecting a bank account flips policy.reimbursementChoice from reimburseManual to reimburseYes, so the === REIMBURSEMENT_MANUAL fallback stops applying and only isPayer remains — which returns true only for the designated reimburser (or an admin who is a sharee of that exact VBA):
canIOUBePaid— ReportWorkflow.ts#L223-L224getReportPreviewAction— ReportPreviewActionUtils.ts#L129-L130isPrimaryPayAction— ReportPrimaryActionUtils.ts#L226-L228isPayer's auto branch returnsisReimburser || (isAdmin && hasAccessToBankAccount)— ReportUtils.ts#L2860-L2872
2. The fallback uses isPolicyAdmin(policy), which excludes the Payments Admin role. isPolicyAdmin is strictly role === ROLE.ADMIN (PolicyUtils.ts#L137-L138), so a Payments Admin fails the fallback even for a manual workspace — even though their permission bundle grants WORKFLOWS_PAYMENTS: WRITE (PolicyUtils.ts#L176-L181).
There is also a plumbing wrinkle: isPrimaryPayAction's fallback is additionally gated on a canNonPayerAdminPay flag that is only passed true from the primary-action resolver (ReportPrimaryActionUtils.ts#L547). The secondary-action call site passes isSecondaryAction: true but not the flag (ReportSecondaryActionUtils.ts#L956-L967), so the fallback is dead there — a non-payer admin would still miss PAY as a secondary action even after fixing (1) and (2).
What changes do you think we should make in order to solve the problem?
Fix the fallback in one place and reuse it. The correct predicate is "payments are enabled and the user can write payments" — which covers both admin (write-all) and payments admin, for both manual and direct reimbursement. Add a helper next to arePaymentsEnabled in PolicyUtils:
function canNonPayerAdminPayReport(policy: OnyxEntry<Policy>, currentUserLogin: string | undefined): boolean {
return arePaymentsEnabled(policy) && !!currentUserLogin && canMemberWrite(policy, currentUserLogin, CONST.POLICY.POLICY_FEATURE.WORKFLOWS_PAYMENTS);
}
arePaymentsEnabled is reimbursementChoice !== REIMBURSEMENT_NO (PolicyUtils.ts#L1484-L1486), so it's true for both reimburseManual and reimburseYes (fixes #1), and canMemberWrite(..., WORKFLOWS_PAYMENTS) is true for admins and payments admins (fixes #2).
Then replace the inline reimbursementChoice === REIMBURSEMENT_MANUAL && isPolicyAdmin(policy) fallback with canNonPayerAdminPayReport(policy, currentUserLogin) in canIOUBePaid, getReportPreviewAction, and isPrimaryPayAction. Since the helper now fully encodes the intended behavior, drop the extra canNonPayerAdminPay flag from isPrimaryPayAction (or, minimally, also pass canNonPayerAdminPay: true at the secondary call site) so PAY appears as both a primary and secondary action.
Deliberately leave isPayer and isPolicyPayer untouched. isPayer still drives the LHN pay badge and GBR/next-step copy, and isPolicyPayer's only consumer is isEligibleForPaySuggestion — the Search "to-do" pay suggestion (SearchUIUtils.ts#L1089-L1108). Both are active prompting, which the issue says must stay payer-only (Expensify#637864). The Spend-page pay button is separate — it flows through canIOUBePaid in getActions (SearchUIUtils.ts#L2435) — so fixing the three gates covers the Spend page automatically, with no change to the suggestion logic.
No backend changes. A non-payer admin without a VBA who taps "pay via business account" hits the existing add-bank-account (KYC) flow in situ; the settlement button only lists VBAs the user can access, and paying from a different VBA doesn't change the workspace bank account.
What alternative solutions did you explore? (Optional)
- Broaden
isPayerdirectly (relax its auto/manual branches to returntruefor any admin). Rejected:isPayerfeeds badges/GBRs/next-steps, so this would start actively prompting non-payer admins — exactly what the issue rules out. - Also mirror the change into
isPolicyPayer. Rejected: its sole consumer is the Search pay suggestion, so broadening it would surface pay to-do suggestions for non-payer admins. The Spend-page button already routes throughcanIOUBePaid, so no change is needed there.
⚠️ @dilshodmackbook-sketch 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.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-09 20:21:27 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a workspace has a bank account connected, NewDot only shows the pay / mark-as-paid button to the admin designated as the workspace payer (the reimburser). Classic shows it to any workspace admin (and, now, any Payments Admin). We want any workspace or payment admin to see the pay option regardless of whether a bank account is connected — while not actively prompting non-payer admins (no badges/GBRs), which must stay as-is.
What is the root cause of that problem?
Each pay-button surface already layers a "any admin / payment admin can pay" fallback on top of isPayer, but that fallback is gated on REIMBURSEMENT_MANUAL only. So on a bank-connected workspace using automatic reimbursement, a non-payer admin falls through to isPayer, which — once a reimburser is designated — returns true only for the reimburser (or, for auto, an admin who is a sharee of that specific VBA). Result: the pay button is hidden from non-payer admins.
The identical manual-only condition appears in all three surfaces:
https://github.com/Expensify/App/blob/d8ec440b03bc1fd03b6b01124beec247c9b5c963/src/libs/actions/IOU/ReportWorkflow.ts#L223-L226
https://github.com/Expensify/App/blob/d8ec440b03bc1fd03b6b01124beec247c9b5c963/src/libs/ReportPreviewActionUtils.ts#L129-L132
https://github.com/Expensify/App/blob/d8ec440b03bc1fd03b6b01124beec247c9b5c963/src/libs/ReportPrimaryActionUtils.ts#L227-L232
And the Search/Reports-page surface goes through isPolicyPayer, which is also narrow — canPayOnPolicy && currentUserLogin === reimburserEmail:
https://github.com/Expensify/App/blob/d8ec440b03bc1fd03b6b01124beec247c9b5c963/src/libs/PolicyUtils.ts#L670-L693
The important constraint: isPayer itself must stay narrow, because it also feeds the PAY badge and next-step / GBR messaging — the exact "prompting" the issue says must not change:
- PAY badge → GBR/attention: https://github.com/Expensify/App/blob/d8ec440b03bc1fd03b6b01124beec247c9b5c963/src/libs/actions/IOU/ReportWorkflow.ts#L303-L305
- "Waiting to pay" next step: https://github.com/Expensify/App/blob/d8ec440b03bc1fd03b6b01124beec247c9b5c963/src/libs/NextStepUtils.ts#L255-L255
So the fix belongs in the button-visibility fallback (broaden it), not in isPayer (which would wrongly start prompting non-payer admins via badges/GBRs — explicitly ruled out by the issue and Expensify/Expensify#637864).
What changes do you think we should make in order to solve the problem?
Broaden the non-payer-admin fallback so it applies whenever payments are enabled — not just manual reimbursement — and leave isPayer untouched.
1. canIOUBePaid — ReportWorkflow.ts:224-226:
const canPay =
isReportPayer ||
(arePaymentsEnabled(policy) && canMemberWrite(policy, currentUserLogin, CONST.POLICY.POLICY_FEATURE.WORKFLOWS_PAYMENTS));
2. ReportPreviewActionUtils — L130-132: same broadening (arePaymentsEnabled is already imported/used a couple lines below).
3. ReportPrimaryActionUtils — L228-232: same broadening; keep the existing canNonPayerAdminPay guard, just swap the manual-only clause for arePaymentsEnabled(policy).
4. isPolicyPayer (Search/Reports surface) — PolicyUtils.ts:670-693: return canPayOnPolicy when payments are enabled, not only when currentUserLogin === reimburserEmail, so the Reports-page pay button matches the other surfaces.
canMemberWrite(policy, login, WORKFLOWS_PAYMENTS) already grants both a workspace Admin and a Payments Admin (the PAYMENTS_ADMIN role has WORKFLOWS_PAYMENTS: WRITE in POLICY_ROLES — PolicyUtils.ts:176-180), so no separate role check is needed and non-admin members are not affected.
Behavior after the change: any workspace/payment admin sees the pay button whether or not a bank account is connected. An admin without a VBA who taps "pay via business account" hits the existing add-bank-account-in-situ flow; "mark as paid" already works via the pay-elsewhere path. Because isPayer is unchanged, non-payer admins still are not prompted via badges/GBRs.
What alternative solutions did you explore?
Broaden isPayer directly (one edit). Rejected: isPayer is shared by the PAY badge (getBadgeFromIOUReport) and next-step/GBR messaging (NextStepUtils), so broadening it would start actively prompting non-payer admins to pay — which the issue explicitly forbids.
Add PAYMENTS_ADMIN to the role checks explicitly. Unnecessary: canMemberWrite(…, WORKFLOWS_PAYMENTS) already resolves the Payments Admin role, so gating the fallback on it covers both admin types without new role branching.
Proposal Updated
I reworked my proposal. On current main the non-payer-admin fallback is actually broken two ways, not one: it is manual-only (so it dies the moment a bank account connects and reimbursement flips to reimburseYes), and it uses isPolicyAdmin which is ADMIN-only and never matches the new Payments Admin role. I moved the fix into a single canNonPayerAdminPayReport helper gated on arePaymentsEnabled + canMemberWrite(WORKFLOWS_PAYMENTS), which covers both roles and both reimbursement modes, and I left isPayer/isPolicyPayer alone so badges and the Search pay suggestion stay payer-only. I also flagged that the secondary PAY action never receives the canNonPayerAdminPay flag, so the button would still be missing there without that fix.
I don't think we need any mocks here. We're just showing the existing pay button to a broader group of admins. Let me know if you feel differently. Going ahead with soliciting proposals for now. 👍
Totally agree 🚀
🚨 Edited by proposal-police: This proposal was edited at 2026-07-10 00:18:28 UTC.
aswin-s's approach: edit isPayer in ReportUtils.ts directly — broaden isAdmin to include PAYMENTS_ADMIN, and drop the hasAccessToBankAccount requirement in the auto-reimbursement branch. That changes the one shared function.
My approach (and what's actually in your local code): leave isPayer completely untouched, and instead widen the separate fallback check that already exists in the three pay-button surfaces (isPrimaryPayAction, ReportPreviewActionUtils.canPay, ReportWorkflow.canIOUBePaid) so it applies to automatic reimbursement too, not just manual.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a workspace has automatic (ACH/business bank account) reimbursement enabled, NewDot only shows the Pay button to the one admin who is either the workspace's designated payer or already has personal access to that connected bank account. Classic shows Pay/Mark as Paid to any workspace Admin (and, now that the Payments Admin role exists, any Payments Admin too), regardless of whether a bank account is connected.
We want to close this NewDot/Classic parity gap so any workspace Admin or Payments Admin can see and use Pay (via any business bank account they have access to, or by marking the report as paid) the same way they already can when no bank account is connected. This is scoped purely to who can see/use the Pay action - it shouldn't change which reports show Pay, how paying behaves once clicked, or which admin gets nudged to pay via GBRs/next-step badges.
What is the root cause of that problem?
The permission check that decides "can this user pay" is isPayer in ReportUtils. When the workspace uses automatic reimbursement and has a connected bank account (achAccount.reimburser is set), it only returns true for that exact reimburser email, or for an admin who is personally a "sharee" on that specific bank account. Any other Admin, and any Payments Admin, is excluded here - this is the root of the parity gap.
https://github.com/Expensify/App/blob/c49419ea18c80d2a03bdb5c073d14d23b9b751e6/src/libs/ReportUtils.ts#L2820-L2861
function isPayer(
currentAccountID: number | undefined,
currentUserEmailParam: string | undefined,
iouReport: OnyxEntry<Report>,
bankAccountList: OnyxEntry<BankAccountList>,
reportPolicy?: OnyxInputOrEntry<Policy>,
onlyShowPayElsewhere = false,
) {
const policy = reportPolicy ?? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${iouReport?.policyID}`] ?? null;
if (!policy && !isIOUReport(iouReport) && iouReport?.policyID && iouReport.policyID !== CONST.POLICY.ID_FAKE) {
return false;
}
const policyType = policy?.type;
const isAdmin = policyType !== CONST.POLICY.TYPE.PERSONAL && policy?.role === CONST.POLICY.ROLE.ADMIN;
const isManager = iouReport?.managerID === currentAccountID;
const reimbursementChoice = policy?.reimbursementChoice;
if (isPaidGroupPolicy(iouReport)) {
if (reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES) {
if (!policy?.achAccount?.reimburser) {
return isAdmin;
}
// If user is the reimburser, or a policy admin with access to the business bank account via sharees, they can pay.
const isReimburser = currentUserEmailParam === policy?.achAccount?.reimburser;
// Check if the current user has access to the bank account via sharees
const bankAccountID = policy?.achAccount?.bankAccountID;
const bankAccount = bankAccountID ? bankAccountList?.[bankAccountID] : null;
const hasAccessToBankAccount = currentUserEmailParam && bankAccount?.accountData?.sharees ? bankAccount.accountData.sharees.includes(currentUserEmailParam) : false;
return isReimburser || (isAdmin && hasAccessToBankAccount);
}
if (reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL || onlyShowPayElsewhere) {
return isAdmin;
}
return false;
}
return isAdmin || (isMoneyRequestReport(iouReport) && isManager);
}
That restrictive result then flows unchanged into every surface that decides whether to render the Pay option, with no fallback for a non-designated-payer Admin or a Payments Admin. This is the report header's primary/secondary action logic:
https://github.com/Expensify/App/blob/c49419ea18c80d2a03bdb5c073d14d23b9b751e6/src/libs/ReportPrimaryActionUtils.ts#L218-L241
const isReportPayer = isPayer(currentUserAccountID, currentUserLogin, report, bankAccountList, policy, false);
const arePaymentsEnabled = arePaymentsEnabledUtils(policy);
const isReportApproved = isReportApprovedUtils({report});
const isReportClosed = isClosedReportUtils(report);
const isProcessingReport = isProcessingReportUtils(report);
const isExported = isExportedUtil(reportActions, report);
const hasExportError = hasExportErrorUtil(reportActions, report);
const didExportFail = !isExported && hasExportError;
const isApprovalEnabled = policy ? policy.approvalMode && policy.approvalMode !== CONST.POLICY.APPROVAL_MODE.OPTIONAL : false;
const isSubmittedWithoutApprovalsEnabled = !isApprovalEnabled && isProcessingReport;
const isReportFinished = (isReportApproved && !report.isWaitingOnBankAccount) || isSubmittedWithoutApprovalsEnabled || isReportClosed;
const {reimbursableSpend, nonReimbursableSpend} = getMoneyRequestSpendBreakdown(report);
if (
isReportPayer &&
isExpenseReport &&
arePaymentsEnabled &&
isReportFinished &&
(reimbursableSpend !== 0 || (nonReimbursableSpend !== 0 && hasOnlyNonReimbursableTransactions(report?.reportID, reportTransactions)))
) {
return isSecondaryAction ?? !didExportFail;
}
This is the chat report-preview bubble's pay logic:
https://github.com/Expensify/App/blob/c49419ea18c80d2a03bdb5c073d14d23b9b751e6/src/libs/ReportPreviewActionUtils.ts#L122-L145
const isReportPayer = isPayer(currentUserAccountID, currentUserLogin, report, bankAccountList, policy, false);
const isExpense = isExpenseReport(report);
const isPaymentsEnabled = arePaymentsEnabled(policy);
const isProcessing = isProcessingReport(report);
const isApprovalEnabled = policy ? policy.approvalMode && policy.approvalMode !== CONST.POLICY.APPROVAL_MODE.OPTIONAL : false;
const isSubmittedWithoutApprovalsEnabled = !isApprovalEnabled && isProcessing;
const isApproved = isReportApproved({report}) || isSubmittedWithoutApprovalsEnabled;
const isClosed = isClosedReport(report);
const isReportFinished = (isApproved || isClosed) && !report.isWaitingOnBankAccount;
const {reimbursableSpend, nonReimbursableSpend} = getMoneyRequestSpendBreakdown(report);
const isReimbursed = isSettled(report);
const isExported = report.isExportedToIntegration ?? false;
const hasExportError = hasExportErrorUtil(undefined, report);
const didExportFail = !isExported && hasExportError;
if (
isExpense &&
isReportPayer &&
isPaymentsEnabled &&
isReportFinished &&
(reimbursableSpend !== 0 || (nonReimbursableSpend !== 0 && hasOnlyNonReimbursableTransactions(report?.reportID, transactions)))
) {
return !didExportFail;
}
And this is canIOUBePaid, which the actual Pay/KYC-wall button component reads from directly:
https://github.com/Expensify/App/blob/c49419ea18c80d2a03bdb5c073d14d23b9b751e6/src/libs/actions/IOU/ReportWorkflow.ts#L226-L243
const isPayer = isPayerReportUtils(currentUserAccountID, currentUserLogin, iouReport, bankAccountList, policy, onlyShowPayElsewhere);
const {reimbursableSpend, nonReimbursableSpend} = getMoneyRequestSpendBreakdown(iouReport);
const isAutoReimbursable = policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES ? false : canBeAutoReimbursed(iouReport, policy);
const isPayAtEndExpenseReport = isPayAtEndExpenseReportReportUtils(iouReport ?? undefined, transactions);
const isProcessing = isProcessingReport(iouReport);
const isApprovalEnabled = policy ? policy.approvalMode && policy.approvalMode !== CONST.POLICY.APPROVAL_MODE.OPTIONAL : false;
const isSubmittedWithoutApprovalsEnabled = !isApprovalEnabled && isProcessing;
const isApproved = isReportApproved({report: iouReport}) || isSubmittedWithoutApprovalsEnabled;
const isClosed = isClosedReportUtil(iouReport);
const isReportFinished = (isApproved || isClosed) && !iouReport?.isWaitingOnBankAccount;
const isIOU = isIOUReport(iouReport);
const canShowMarkedAsPaidForNegativeAmount = onlyShowPayElsewhere && reimbursableSpend < 0;
const isOnlyNonReimbursablePayElsewhere = onlyShowPayElsewhere && nonReimbursableSpend !== 0 && hasOnlyNonReimbursableTransactions(iouReport?.reportID, transactions);
if (isIOU && isPayer && !iouSettled && reimbursableSpend > 0) {
return true;
}
(The same isPayer variable also gates this function's final return (...) a bit further down.)
What changes do you think we should make in order to solve the problem?
We shouldn't change isPayer itself, because it's also used by NextStepUtils to decide who the "next step" banner nudges to pay - the issue is explicit that we should not start prompting non-payer Admins/Payments Admins via badges or GBRs, so that narrower meaning of "the one true payer" needs to stay intact there.
Instead, at each of the three spots shown above, we add a Classic-parity fallback: alongside the existing designated-payer check, also allow the action when the policy has reimbursement enabled at all (manual or automatic) and the current user has Workflows → Payments write access - which is true for any Admin, and for a Payments Admin specifically. If that person doesn't have their own connected bank account, the existing "connect a bank account" prompt in the payment flow already handles that case today, so no new UI or backend work is needed.
const isReimbursementEnabled =
policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL || policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES;
const canPayReport = isReportPayer || (isReimbursementEnabled && canMemberWrite(policy, currentUserLogin, CONST.POLICY.POLICY_FEATURE.WORKFLOWS_PAYMENTS));
canPayReport (named canPay in ReportWorkflow.ts, to match that file's existing local variable name) then replaces the bare isReportPayer/isPayer used in the if conditions at each of the three permalinks above - both the primary condition and the report's other return paths further down in the same functions (e.g. the IOU/invoice branches).
What alternative solutions did you explore? (Optional)
We considered keeping the bank-account-ownership requirement and instead adding a "request access" affordance for non-owner Admins/Payments Admins. We didn't go this way because Classic already lets a non-payer Admin freely pick a different bank account or mark the report as paid outright, so simply removing the extra restriction - and letting the existing "connect a bank account" prompt handle the no-VBA case - is simpler and matches Classic's behavior directly without adding new UI.
We also considered centralizing this check by changing isPayer itself instead of touching three call sites. We ruled this out because isPayer is also consumed by NextStepUtils for next-step banner/GBR wording, and the issue explicitly calls for badges/GBRs to keep pointing only at the true designated payer - widening isPayer itself would have leaked the new Pay-button-only exception into that unrelated nudging logic.
⚠️ @abbasifaizan70 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.
Proposal
Please re-state the problem that we are trying to solve in this issue.
In NewDot, when a workspace has a bank account connected, the pay option on an expense report is only offered to the admin who is set as the workspace payer (reimburser). Classic offers it to any workspace admin, and now also to the new Payments Admin role. When the workspace has no bank account connected, NewDot already behaves correctly and shows the pay option to any workspace or payment admin.
We want any workspace admin or payment admin to see the option to pay (via any VBA they have access to) or to manually mark the report as paid, regardless of whether a bank account is connected — without changing which options appear for a given report, and without starting to prompt non-payer admins via badges/GBRs.
What is the root cause of that problem?
The allowance that lets a non-payer admin see the pay button is gated on the workspace being in indirect reimbursement mode. The moment a bank account is connected the workspace switches to direct reimbursement (reimbursementChoice === reimburseYes), the allowance stops applying, and visibility falls back to the payer-only isPayer() check.
That gate lives in two places. In isPrimaryPayAction(), canPayReport only tolerates a non-payer admin when reimbursementChoice is REIMBURSEMENT_MANUAL:
https://github.com/Expensify/App/blob/98130124dd6e9330a0f955cb41beaf08470248e5/src/libs/ReportPrimaryActionUtils.ts#L227-L232
And the report preview action has the identical gate:
https://github.com/Expensify/App/blob/98130124dd6e9330a0f955cb41beaf08470248e5/src/libs/ReportPreviewActionUtils.ts#L129-L132
The canMemberWrite(policy, currentUserLogin, WORKFLOWS_PAYMENTS) half of that condition already encodes the audience we want. ROLE_PERMISSION_BUNDLES grants WORKFLOWS_PAYMENTS write access to ADMIN (via WRITE_ALL_POLICY_FEATURES), to PAYMENTS_ADMIN, and to EDITOR (via EDITOR_POLICY_FEATURES, which grants write on every feature except ASSIGN_ELEVATED_ROLES) — and to no other role. Importantly, that is the same set the allowance already admits on indirect workspaces today, so removing the reimbursement-mode conjunct changes only when the allowance applies, never who canMemberWrite covers:
https://github.com/Expensify/App/blob/98130124dd6e9330a0f955cb41beaf08470248e5/src/libs/PolicyUtils.ts#L156-L182
So the only thing standing between a non-payer admin and the pay button on a workspace with a VBA is the reimbursementChoice === REIMBURSEMENT_MANUAL conjunct.
When that conjunct is false we fall through to isPayer(), whose direct-reimbursement branch requires the user to either be the designated reimburser, or be an admin who is also a sharee of the workspace's specific bank account:
https://github.com/Expensify/App/blob/98130124dd6e9330a0f955cb41beaf08470248e5/src/libs/ReportUtils.ts#L2861-L2870
A workspace admin who is not the reimburser and is not a sharee of that particular VBA therefore gets nothing — which is precisely the screenshot in the issue.
Note that isPayer() is not the right place to fix this. It also feeds hasOutstandingChildRequest():
https://github.com/Expensify/App/blob/98130124dd6e9330a0f955cb41beaf08470248e5/src/libs/ReportUtils.ts#L3055-L3062
and the "waiting for you to pay" next-step copy in NextStepUtils. Widening isPayer() would light up GBRs and next-step prompts for every admin, which the issue explicitly asks us not to do.
What changes do you think we should make in order to solve the problem?
Remove the reimbursementChoice === REIMBURSEMENT_MANUAL conjunct from the non-payer-admin allowance in both action-visibility helpers, so the allowance is simply "the current user has write access to the workspace's payments feature" — i.e. a workspace admin or a payments admin. Concretely, in isPrimaryPayAction() and in the report-preview pay check, canPayReport becomes "is the report payer, or can write WORKFLOWS_PAYMENTS on the policy".
Dropping the conjunct is safe because both call sites already require payments to be enabled on the workspace further down the same condition, via arePaymentsEnabled(policy) — which returns false exactly when reimbursementChoice is REIMBURSEMENT_NO:
https://github.com/Expensify/App/blob/98130124dd6e9330a0f955cb41beaf08470248e5/src/libs/PolicyUtils.ts#L1486-L1488
So a workspace with reimbursement turned off still shows nothing, indirect workspaces keep today's behaviour unchanged, and direct workspaces gain the non-payer admin. The gate we remove was the only thing distinguishing the two.
Because isPrimaryPayAction() already takes a canNonPayerAdminPay flag that only the primary-action resolver passes as true, the flag keeps doing its job of scoping this to the primary pay button, and the secondary-action and Todos call sites continue to opt out. No new parameter is needed.
Deliberately left alone:
isPayer()keeps its current semantics, so badges, GBRs and next-step messages stay pointed at the designated workspace payer only, per the issue.- Which payment options appear for a report — "Pay with Expensify" vs. "Mark as paid" — is decided downstream and is untouched; we are only widening who is allowed to reach that menu. Non-reimbursable-only reports keep showing "Mark as paid" only where they do today.
- The existing payment-method flow already prompts a user with no VBA to add one in situ, so a non-payer admin choosing to pay via business account is routed to the add-bank-account flow with no extra work, and paying from a bank account that is not the workspace's does not rewrite the workspace bank account.
The fix is confined to src/libs/ReportPrimaryActionUtils.ts and src/libs/ReportPreviewActionUtils.ts, needs no backend change, and matches the issue's read that this is purely about pay-button visibility.
Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/95750-non-payer-admin-pay?expand=1
What alternative solutions did you explore? (Optional)
I considered widening isPayer() itself, by returning the already-computed canPayOnPolicy (admin or payments admin) once auto or manual reimbursement is enabled, which would have let both call sites simply use isReportPayer and would have removed the duplicated gate. I rejected it: isPayer() is shared with hasOutstandingChildRequest() and NextStepUtils, so this would have surfaced pay GBRs, LHN badges and "waiting for you to pay" next steps to every workspace admin — the exact behaviour the issue rules out.
I also considered keeping the reimbursementChoice gate and instead relaxing the hasAccessToBankAccount sharee requirement inside isPayer()'s direct-reimbursement branch. That fixes the admin-without-sharee case but still leaves out the payments admin, who is never the reimburser, and it carries the same GBR side effect through hasOutstandingChildRequest().
Proposal updated — added compare branch with implementation.
🎉 Thanks everybody for proposals!
Detailed proposals review
Issue summary
Parity gap: when a workspace has a bank account connected, NewDot only shows the pay/mark-as-paid button to the single designated workspace payer (reimburser). Classic shows it to any workspace admin — and now to the new Payments Admin role. Goal: any workspace/payment admin should see and use the pay button regardless of whether a VBA is connected, without actively prompting non-payer admins via badges/GBRs (that stays payer-only, per Expensify#637864). No backend changes expected.
Key code facts I verified against the working tree
- The three button gates already use canMemberWrite(policy, login, WORKFLOWS_PAYMENTS), not isPolicyAdmin. Confirmed in canIOUBePaid (ReportWorkflow.ts:224-226), ReportPreviewActionUtils.ts:130-132, and ReportPrimaryActionUtils.ts:228-232. Since PAYMENTS_ADMIN has WORKFLOWS_PAYMENTS: WRITE, payments admins are already covered — the only thing gating them out is the reimbursementChoice === REIMBURSEMENT_MANUAL conjunct.
- isPayer feeds active prompting: GBR via hasOutstandingChildRequest (ReportUtils.ts:3055+) and next-step copy (NextStepUtils). So broadening isPayer directly would wrongly start prompting non-payer admins → violates the issue.
- isPolicyPayer's only consumer is isEligibleForPaySuggestion (SearchUIUtils.ts:1089/1108) → the Search "to-do" pay suggestion (active prompting). The Spend-page pay button flows through canIOUBePaid (SearchUIUtils.ts:2435), not isPolicyPayer. → Leaving isPolicyPayer alone is correct; broadening it would surface pay to-do prompts to non-payer admins, contradicting the issue.
- Secondary PAY plumbing gap (dilshod's catch, confirmed): ReportSecondaryActionUtils.ts:957 calls isPrimaryPayAction with isSecondaryAction: true but does not pass canNonPayerAdminPay: true, so the fallback is dead on the secondary path.
Per-proposal assessment
Proposal 1 (MelvinBot) — Correct root cause (manual-only fallback). Correctly broadens the three gates to arePaymentsEnabled(policy) and correctly leaves isPayer alone. Flaw: step 2 broadens isPolicyPayer "so the Search/Reports pay button matches." But isPolicyPayer doesn't drive that button (it drives the pay suggestion). Broadening it would surface pay to-do prompts to non-payer admins — exactly the active prompting the issue forbids. Solid analysis, but this step is a real defect.
Proposal 2 (aswin-s) — Modifies isPayer directly (broadens isAdmin to include PAYMENTS_ADMIN, drops the hasAccessToBankAccount gate). Rejected approach: isPayer feeds GBR/next-step, so this starts actively prompting non-payer admins — the issue's explicit no-go. Aswin's own alternatives section doesn't acknowledge this side effect.
Proposal 3 (lorretheboy) — Correct root cause; explicitly notes this isn't a PR #94018 regression. Broadens the fallback across all three button gates (canIOUBePaid, isPrimaryPayAction, report-preview) via a shared canAdminPayReport helper, and deliberately leaves both isPayer and isPolicyPayer untouched — with correct reasoning that those drive badges/GBR/next-step/Search suggestions. This is the first proposal that is both accurate in root cause and clean/complete in solution. Minor: it writes the reimbursement check out longhand (MANUAL || YES) where arePaymentsEnabled(policy) already exists and reads better; and it doesn't mention the secondary-action flag gap.
Proposal 4 (samranahm) — Same flawed approach as aswin-s: relaxes isPayer to return true for any admin/payment admin. Would trigger badges/GBRs for non-payer admins. Rejected.
Proposal 5 (dilshodmackbook-sketch) — Duplicate-flag verification (required): the bot flagged this as a duplicate of aswin-s (Proposal 2). That is a false positive. aswin-s modifies isPayer; dilshod introduces a canNonPayerAdminPayReport helper and explicitly leaves isPayer/isPolicyPayer untouched — opposite approaches. This proposal is the most thorough on completeness: it's the only one to catch the dead secondary-action fallback (missing canNonPayerAdminPay: true at ReportSecondaryActionUtils.ts:957), which I confirmed is real. However, its root cause has a factual error — it claims the fallback uses isPolicyAdmin(policy) (excluding Payments Admin); the actual code uses canMemberWrite(..., WORKFLOWS_PAYMENTS), which already includes Payments Admin. So its "two independent bugs" framing is half-incorrect (there's really one bug + the secondary-plumbing wrinkle).
Proposal 6 (annaweber830) — Same correct core as Melvin, using arePaymentsEnabled + canMemberWrite. Same flaw: step 4 broadens isPolicyPayer, which would add pay suggestions/prompts for non-payer admins.
Proposal 7 (wildan-m) — Correct approach, leaves isPayer/isPolicyPayer alone. But it only changes two helpers (isPrimaryPayAction, ReportPreviewActionUtils) and does not touch canIOUBePaid — which drives the Spend page button (in scope per the issue). So the Spend-page surface would remain broken. Also doesn't address the secondary-action flag.
Recommendation: Proposal 3 (lorretheboy)
It's the first proposal (ascending order) with an accurate root cause and a correct, clean, complete solution: broaden the fallback across all three button gates behind a shared helper, and deliberately leave isPayer and isPolicyPayer untouched so badges, GBRs, next-steps, and Search pay-suggestions stay payer-only — which is exactly the issue's constraint. Proposal 1 (Melvin) and 6 (annaweber) fail on the isPolicyPayer broadening; Proposals 2 (aswin-s) and 4 (samranahm) fail by mutating isPayer; Proposal 7 (wildan) misses the Spend-page (canIOUBePaid) surface.
Two things the selected contributor should fold into implementation:
- Reuse the existing arePaymentsEnabled(policy) helper for the reimbursement-enabled check rather than spelling out MANUAL || YES (matches the surrounding code).
- Address the secondary PAY action gap that dilshod (dilshodmackbook-sketch) correctly identified — either drop the canNonPayerAdminPay flag or pass canNonPayerAdminPay: true at ReportSecondaryActionUtils.ts:957 — otherwise a non-payer admin still won't get PAY as a secondary action (held-expense / export-fail cases).
Revised count: 8 valid proposals
# |
Author | Approach |
|---|---|---|
| 1 | MelvinBot | broaden 3 gates ✅ + broaden isPolicyPayer ❌ |
| 2 | aswin-s | mutate isPayer ❌ |
| 3 | lorretheboy | broaden 3 gates via helper, leave isPayer/isPolicyPayer alone ✅ |
| 4 | samranahm | mutate isPayer ❌ |
| 5 | dilshodmackbook-sketch | helper on 3 gates + catches secondary-flag gap ✅ (root-cause isPolicyAdmin error) |
| 6 | annaweber830 | broaden 3 gates ✅ + broaden isPolicyPayer ❌ |
| 7 | abbasifaizan70 | broaden 3 gates, leave isPayer alone ✅ (newly valid) |
| 8 | wildan-m | broaden 2 gates ✅ but misses canIOUBePaid/Spend page |
Latest reviewed — Proposal 7 (abbasifaizan70)
Approach is correct: leaves isPayer untouched (with the right reasoning re: NextStepUtils/GBR nudging), and broadens the fallback across all three button surfaces — isPrimaryPayAction, ReportPreviewActionUtils, and canIOUBePaid — gated on isReimbursementEnabled && canMemberWrite(policy, login, WORKFLOWS_PAYMENTS). Because it touches canIOUBePaid, it covers the Spend page (unlike wildan), and it correctly leaves isPolicyPayer alone (by omission), so pay suggestions stay payer-only. Its final solution is essentially the same as lorretheboy's.
Duplicate-flag verification: the bot flagged it as a duplicate ose positive** — the edited proposal literally opens by contrastingitself with aswin-s and takes the opposite approach (leave isPayer alone vs. mutate it). It is, however, near-identical in substance to lorretheboy (Proposal 3), which came earlier.
Weaknesses vs. lorretheboy:
- Stale-code root cause. It references an older commit (
c49419e) and claims these three surfaces have "no fallback for a non-designated-payer Admin." That's inaccurate on currentmain/working tree — a manual-only fallbamaryActionUtils.ts:228-232`, etc.). The real root cause is "theexisting fallback is manual-only," not "there is no fallback." Its fix happens to broaden it correctly anyway, but the narrative misreads the current code. - Doesn't account for the
canNonPayerAdminPayflag guardingi (its referenced code doesn't include it), so "replace the bareisReportPayerwithcanPayReport`" is under-specified for that call site — and it misses the dead secondary-action path that dilshod caught. - Code duplication — inlines the
isReimbursementEnabledcheck racting a helper (lorretheboy extractscanAdminPayReport). - Posts large walls of quoted code, which the proposal guidelines explicitly discourage.
Recommendation — unchanged: Proposal 3 (lorretheboy)
The latest proposal update (abbasifaizan70) doesn't change the initial review outcome. It's a valid, correct-approach proposal, but it lands at #7 (after lorretheboy at #3), duplicates lorretheboy's solution, and is weaker on root-cause accuracy and DRY-ness. lorretheboy's proposal is both accurate in root cause and clean/complete insolution (three gates via a shared helper; isPayer and isPolicyPayer deliberately untouched). Implementation should still fold in the secondary-action-flag fix that dilshod correctly identified.
@lorretheboy's proposal LGTM, see Detailed proposals review above for details on why.
[!important] Two things the selected contributor should fold into implementation:
- Reuse the existing
arePaymentsEnabled(policy)helper for the reimbursement-enabled check rather than spelling outMANUAL || YES(matches the surrounding code).- Address the secondary PAY action gap that dilshodmackbook-sketch correctly identified — either drop the
canNonPayerAdminPayflag or passcanNonPayerAdminPay: trueatReportSecondaryActionUtils.ts:957 — otherwise a non-payer admin still won't get PAY as a secondary action (held-expense / export-fail cases).
🎀👀🎀 C+ reviewed
@joekaufmanexpensify I verified the pay-button gap is purely frontend for workspace Admins, and the proposed fix covers them. But a Payments Admin doesn't receive members' expense chats/reports at all (not in Onyx, not in Search) — the LHN/Search have no client-side admin filter, so this is Auth-side participant visibility that currently keys off role === ADMIN.
The paymentsAdmin portion of this issue needs a backend change to grant that role report visibility; it can't be done in NewDot alone despite the logic already being there for LHN/Search expense display. Here's a video for BE team to understand what's missing on Payments Admin side regarding this NewFeature requirements, showcasing the LHN part (but note the Spend page parts as well despite not being shown in this video):
MacOS: Chrome / Safari
https://github.com/user-attachments/assets/9b39c88c-b104-47af-993c-5f7db920aff0
[!note] We might want to put this on HOLD front-end-wise until we have confirmation from BE about the Payments Admin part required from BE side, otherwise we could move forward with the FE fix which covers both Admin and Payments Admin roles but note the gap in the PRs testing section that the Payments Admin part won't be visible until the BE part is handled.