From b0043b5627d77c5076a34ef25ed83732606108ca Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:43:09 +0000 Subject: [PATCH] Revert "Update logic to display pay button in paid policies" --- 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 f1b7e74bbde4..a939f0942839 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1413,9 +1413,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 afdc236ca043..e63e87adfa2a 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;