Skip to content

Commit 1d9156f

Browse files
authored
Merge pull request Expensify#65012 from callstack-internal/fix-gbr-showing-for-no-reason
Fix GBR showing for no reason
2 parents 366e024 + b1b64d8 commit 1d9156f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/libs/ReportUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2394,8 +2394,12 @@ function isPayer(session: OnyxEntry<Session>, iouReport: OnyxEntry<Report>, only
23942394
const isManager = iouReport?.managerID === session?.accountID;
23952395
if (isPaidGroupPolicy(iouReport)) {
23962396
if (policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES) {
2397-
// If we get here without a reimburser only show the pay button if we are the admin.
23982397
if (!policy?.achAccount?.reimburser) {
2398+
// If there is a manager assigned, only allow payment if the user is both an admin and the manager.
2399+
// Otherwise, if there is no reimburser and no manager, only allow payment if the user is an admin.
2400+
if (iouReport?.managerID) {
2401+
return isAdmin && isManager;
2402+
}
23992403
return isAdmin;
24002404
}
24012405

0 commit comments

Comments
 (0)