From 374a1a077cb698a2c41d1266a30338701b560316 Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:05:13 +0000 Subject: [PATCH] Merge pull request #36424 from Expensify/revert-35347-marco-displayPayButtonReimburser [CP Staging] Revert "Update logic to display pay button in paid policies" (cherry picked from commit 6d7d8c07b3fafd72b1231f9a28484f2815329829) --- src/CONST.ts | 6 +++--- src/components/MoneyReportHeader.tsx | 3 +-- src/components/ReportActionItem/ReportPreview.tsx | 3 +-- src/types/onyx/Policy.ts | 3 --- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index eae4b8ec7a2b..89a5d99decd1 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1335,9 +1335,9 @@ const CONST = { OWNER_EMAIL_FAKE: '_FAKE_', OWNER_ACCOUNT_ID_FAKE: 0, REIMBURSEMENT_CHOICES: { - REIMBURSEMENT_YES: 'reimburseYes', // Direct - REIMBURSEMENT_NO: 'reimburseNo', // None - REIMBURSEMENT_MANUAL: 'reimburseManual', // Indirect + REIMBURSEMENT_YES: 'reimburseYes', + REIMBURSEMENT_NO: 'reimburseNo', + REIMBURSEMENT_MANUAL: 'reimburseManual', }, ID_FAKE: '_FAKE_', EMPTY: 'EMPTY', diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index bfe5a7ff2a75..0e08aed214a6 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -57,10 +57,9 @@ function MoneyReportHeader({session, policy, chatReport, nextStep, report: money const isAutoReimbursable = ReportUtils.canBeAutoReimbursed(moneyRequestReport, policy); const isPaidGroupPolicy = ReportUtils.isPaidGroupPolicy(moneyRequestReport); const isManager = ReportUtils.isMoneyRequestReport(moneyRequestReport) && session?.accountID === moneyRequestReport.managerID; - const isReimburser = session?.email === policy?.reimburserEmail; const isPayer = isPaidGroupPolicy ? // In a group policy, the admin approver can pay the report directly by skipping the approval step - isReimburser && (isApproved || isManager) + isPolicyAdmin && (isApproved || isManager) : isPolicyAdmin || (ReportUtils.isMoneyRequestReport(moneyRequestReport) && isManager); const isDraft = ReportUtils.isDraftExpenseReport(moneyRequestReport); const isOnInstantSubmitPolicy = PolicyUtils.isInstantSubmitEnabled(policy); diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 4066776711b1..cfe06b2c0a62 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -122,7 +122,6 @@ function ReportPreview({ const {totalDisplaySpend, reimbursableSpend} = ReportUtils.getMoneyRequestSpendBreakdown(iouReport); const policyType = policy?.type; const isAutoReimbursable = ReportUtils.canBeAutoReimbursed(iouReport, policy); - const isReimburser = session?.email === policy?.reimburserEmail; const iouSettled = ReportUtils.isSettled(iouReportID); const iouCanceled = ReportUtils.isArchivedRoom(chatReport); @@ -213,7 +212,7 @@ function ReportPreview({ const isPolicyAdmin = policyType !== CONST.POLICY.TYPE.PERSONAL && policy?.role === CONST.POLICY.ROLE.ADMIN; const isPayer = isPaidGroupPolicy ? // In a paid group policy, the admin approver can pay the report directly by skipping the approval step - isReimburser && (isApproved || isCurrentUserManager) + isPolicyAdmin && (isApproved || isCurrentUserManager) : isPolicyAdmin || (isMoneyRequestReport && isCurrentUserManager); const isOnInstantSubmitPolicy = PolicyUtils.isInstantSubmitEnabled(policy); const isOnSubmitAndClosePolicy = PolicyUtils.isSubmitAndClose(policy); diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index d5ed5dd36aba..8e2d1d10e55d 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -162,9 +162,6 @@ type Policy = { /** When tax tracking is enabled */ isTaxTrackingEnabled?: boolean; - /** The email of the reimburser set when reimbursement is direct */ - reimburserEmail?: string; - /** ReportID of the admins room for this workspace */ chatReportIDAdmins?: number;