Skip to content

Commit

Permalink
Merge pull request Expensify#49875 from codewaseem/47570-hide-hold-fo…
Browse files Browse the repository at this point in the history
…r-invoice

hide hold option for invoices
  • Loading branch information
mjasikowski authored Oct 11, 2024
2 parents fb27356 + 183b8f5 commit abdfb72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3181,6 +3181,13 @@ function canHoldUnholdReportAction(reportAction: OnyxInputOrEntry<ReportAction>)
return {canHoldRequest: false, canUnholdRequest: false};
}

if (isInvoiceReport(moneyRequestReport)) {
return {
canHoldRequest: false,
canUnholdRequest: false,
};
}

const isRequestSettled = isSettled(moneyRequestReport?.reportID);
const isApproved = isReportApproved(moneyRequestReport);
const transactionID = moneyRequestReport ? ReportActionsUtils.getOriginalMessage(reportAction)?.IOUTransactionID : 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ function BaseReportActionContextMenu({
const isMoneyRequest = useMemo(() => ReportUtils.isMoneyRequest(childReport), [childReport]);
const isTrackExpenseReport = ReportUtils.isTrackExpenseReport(childReport);
const isSingleTransactionView = isMoneyRequest || isTrackExpenseReport;
const isMoneyRequestOrReport = isMoneyRequestReport || isInvoiceReport || isSingleTransactionView;
const isMoneyRequestOrReport = isMoneyRequestReport || isSingleTransactionView;

const areHoldRequirementsMet = isMoneyRequestOrReport && !ReportUtils.isArchivedRoom(transactionThreadReportID ? childReport : parentReport, parentReportNameValuePairs);
const areHoldRequirementsMet =
!isInvoiceReport && isMoneyRequestOrReport && !ReportUtils.isArchivedRoom(transactionThreadReportID ? childReport : parentReport, parentReportNameValuePairs);

const originalReportID = useMemo(() => ReportUtils.getOriginalReportID(reportID, reportAction), [reportID, reportAction]);

Expand Down

0 comments on commit abdfb72

Please sign in to comment.