Skip to content

Commit

Permalink
Merge pull request #48622 from daledah/fix/47903
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Sep 23, 2024
2 parents c4dde27 + 39b6311 commit 5e106f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import ReceiptEmptyState from '@components/ReceiptEmptyState';
import Switch from '@components/Switch';
import Text from '@components/Text';
import ViolationMessages from '@components/ViolationMessages';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import usePermissions from '@hooks/usePermissions';
Expand Down Expand Up @@ -175,6 +176,10 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals

const isAdmin = policy?.role === 'admin';
const isApprover = ReportUtils.isMoneyRequestReport(moneyRequestReport) && moneyRequestReport?.managerID !== null && session?.accountID === moneyRequestReport?.managerID;

const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const isRequestor = currentUserPersonalDetails.accountID === parentReportAction?.actorAccountID;

// A flag for verifying that the current report is a sub-report of a workspace chat
// if the policy of the report is either Collect or Control, then this report must be tied to workspace chat
const isPolicyExpenseChat = ReportUtils.isReportInGroupPolicy(report);
Expand Down Expand Up @@ -357,7 +362,7 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals

const isReceiptAllowed = !isPaidReport && !isInvoice;
const shouldShowReceiptEmptyState =
isReceiptAllowed && !hasReceipt && !isApproved && !isSettled && (canEditReceipt || isAdmin || isApprover) && (canEditReceipt || ReportUtils.isPaidGroupPolicy(report));
isReceiptAllowed && !hasReceipt && !isApproved && !isSettled && (canEditReceipt || isAdmin || isApprover || isRequestor) && (canEditReceipt || ReportUtils.isPaidGroupPolicy(report));

const [receiptImageViolations, receiptViolations] = useMemo(() => {
const imageViolations = [];
Expand Down

0 comments on commit 5e106f0

Please sign in to comment.