diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index a62716975c01..33a05bb17615 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1722,12 +1722,13 @@ function isPayer(session: OnyxEntry, iouReport: OnyxEntry, only const policyType = policy?.type; const isAdmin = policyType !== CONST.POLICY.TYPE.PERSONAL && policy?.role === CONST.POLICY.ROLE.ADMIN; const isManager = iouReport?.managerID === session?.accountID; + const reimbursementChoice = policy?.reimbursement?.choice?.reimbursementChoice ?? policy?.reimbursementChoice; if (isPaidGroupPolicy(iouReport)) { - if (policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES) { + if (reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES) { const isReimburser = session?.email === policy?.achAccount?.reimburser; return (!policy?.achAccount?.reimburser || isReimburser) && (isApproved || isManager); } - if (policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL || onlyShowPayElsewhere) { + if (reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL || onlyShowPayElsewhere) { return isAdmin && (isApproved || isManager); } return false; diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index ecc5bd1f6606..48b7b2a3bb55 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -1625,6 +1625,15 @@ type Policy = OnyxCommon.OnyxValueWithOfflineFeedback< /** The reimbursement choice for policy */ reimbursementChoice?: ValueOf; + /** reimbursement options */ + reimbursement?: { + /** The reimbursement choice for policy */ + choice?: { + /** The reimbursement choice for policy */ + reimbursementChoice?: ValueOf; + }; + }; + /** Detailed settings for the autoReimbursement */ autoReimbursement?: OnyxCommon.OnyxValueWithOfflineFeedback< {