Skip to content

Commit 6d7d8c0

Browse files
authored
Merge pull request #36424 from Expensify/revert-35347-marco-displayPayButtonReimburser
[CP Staging] Revert "Update logic to display pay button in paid policies"
2 parents 1bf483d + 73ec68a commit 6d7d8c0

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

src/CONST.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,9 +1413,9 @@ const CONST = {
14131413
OWNER_EMAIL_FAKE: '_FAKE_',
14141414
OWNER_ACCOUNT_ID_FAKE: 0,
14151415
REIMBURSEMENT_CHOICES: {
1416-
REIMBURSEMENT_YES: 'reimburseYes', // Direct
1417-
REIMBURSEMENT_NO: 'reimburseNo', // None
1418-
REIMBURSEMENT_MANUAL: 'reimburseManual', // Indirect
1416+
REIMBURSEMENT_YES: 'reimburseYes',
1417+
REIMBURSEMENT_NO: 'reimburseNo',
1418+
REIMBURSEMENT_MANUAL: 'reimburseManual',
14191419
},
14201420
ID_FAKE: '_FAKE_',
14211421
EMPTY: 'EMPTY',

src/components/MoneyReportHeader.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ function MoneyReportHeader({session, policy, chatReport, nextStep, report: money
5757
const isAutoReimbursable = ReportUtils.canBeAutoReimbursed(moneyRequestReport, policy);
5858
const isPaidGroupPolicy = ReportUtils.isPaidGroupPolicy(moneyRequestReport);
5959
const isManager = ReportUtils.isMoneyRequestReport(moneyRequestReport) && session?.accountID === moneyRequestReport.managerID;
60-
const isReimburser = session?.email === policy?.reimburserEmail;
6160
const isPayer = isPaidGroupPolicy
6261
? // In a group policy, the admin approver can pay the report directly by skipping the approval step
63-
isReimburser && (isApproved || isManager)
62+
isPolicyAdmin && (isApproved || isManager)
6463
: isPolicyAdmin || (ReportUtils.isMoneyRequestReport(moneyRequestReport) && isManager);
6564
const isDraft = ReportUtils.isDraftExpenseReport(moneyRequestReport);
6665
const isOnInstantSubmitPolicy = PolicyUtils.isInstantSubmitEnabled(policy);

src/components/ReportActionItem/ReportPreview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ function ReportPreview({
122122
const {totalDisplaySpend, reimbursableSpend} = ReportUtils.getMoneyRequestSpendBreakdown(iouReport);
123123
const policyType = policy?.type;
124124
const isAutoReimbursable = ReportUtils.canBeAutoReimbursed(iouReport, policy);
125-
const isReimburser = session?.email === policy?.reimburserEmail;
126125

127126
const iouSettled = ReportUtils.isSettled(iouReportID);
128127
const iouCanceled = ReportUtils.isArchivedRoom(chatReport);
@@ -213,7 +212,7 @@ function ReportPreview({
213212
const isPolicyAdmin = policyType !== CONST.POLICY.TYPE.PERSONAL && policy?.role === CONST.POLICY.ROLE.ADMIN;
214213
const isPayer = isPaidGroupPolicy
215214
? // In a paid group policy, the admin approver can pay the report directly by skipping the approval step
216-
isReimburser && (isApproved || isCurrentUserManager)
215+
isPolicyAdmin && (isApproved || isCurrentUserManager)
217216
: isPolicyAdmin || (isMoneyRequestReport && isCurrentUserManager);
218217
const isOnInstantSubmitPolicy = PolicyUtils.isInstantSubmitEnabled(policy);
219218
const isOnSubmitAndClosePolicy = PolicyUtils.isSubmitAndClose(policy);

src/types/onyx/Policy.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@ type Policy = {
162162
/** When tax tracking is enabled */
163163
isTaxTrackingEnabled?: boolean;
164164

165-
/** The email of the reimburser set when reimbursement is direct */
166-
reimburserEmail?: string;
167-
168165
/** ReportID of the admins room for this workspace */
169166
chatReportIDAdmins?: number;
170167

0 commit comments

Comments
 (0)