From 0f881b0d8be52076cfa30d80d01f17878e7d3bc2 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Tue, 9 Jul 2024 12:32:01 +0300 Subject: [PATCH 1/4] Show unapprove only for expense reports --- src/pages/ReportDetailsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index 530df5fa0532..1dbbff87b319 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -200,7 +200,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const shouldShowDeleteButton = shouldShowTaskDeleteButton || canDeleteRequest; const canUnapproveRequest = - ReportUtils.isMoneyRequestReport(moneyRequestReport) && + ReportUtils.isExpenseReport(moneyRequestReport) && (ReportUtils.isReportManager(moneyRequestReport) || isPolicyAdmin) && (ReportUtils.isReportApproved(moneyRequestReport) || ReportUtils.isReportManuallyReimbursed(moneyRequestReport)); From 37b2fe0148586984253d610cdd68dd3aaacbde9e Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Tue, 9 Jul 2024 12:43:18 +0300 Subject: [PATCH 2/4] Also don't show unapproved for archived rooms duh --- src/pages/ReportDetailsPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index 1dbbff87b319..d26429e47cc5 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -201,6 +201,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const canUnapproveRequest = ReportUtils.isExpenseReport(moneyRequestReport) && + !ReportUtils.isArchivedRoom(moneyRequestReport) && (ReportUtils.isReportManager(moneyRequestReport) || isPolicyAdmin) && (ReportUtils.isReportApproved(moneyRequestReport) || ReportUtils.isReportManuallyReimbursed(moneyRequestReport)); From 8a8e5cdbd85aaa5b114a150f274fdb197229ac0a Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Tue, 9 Jul 2024 12:48:30 +0300 Subject: [PATCH 3/4] Wait that's not necessary --- src/pages/ReportDetailsPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index d26429e47cc5..1dbbff87b319 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -201,7 +201,6 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const canUnapproveRequest = ReportUtils.isExpenseReport(moneyRequestReport) && - !ReportUtils.isArchivedRoom(moneyRequestReport) && (ReportUtils.isReportManager(moneyRequestReport) || isPolicyAdmin) && (ReportUtils.isReportApproved(moneyRequestReport) || ReportUtils.isReportManuallyReimbursed(moneyRequestReport)); From 9fafd6bc3059d74ba41ee8eef768b17b34b49a79 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Tue, 9 Jul 2024 13:06:04 +0300 Subject: [PATCH 4/4] Look at current report, not parent --- src/pages/ReportDetailsPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index 1dbbff87b319..c9440ee548af 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -200,9 +200,9 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const shouldShowDeleteButton = shouldShowTaskDeleteButton || canDeleteRequest; const canUnapproveRequest = - ReportUtils.isExpenseReport(moneyRequestReport) && - (ReportUtils.isReportManager(moneyRequestReport) || isPolicyAdmin) && - (ReportUtils.isReportApproved(moneyRequestReport) || ReportUtils.isReportManuallyReimbursed(moneyRequestReport)); + ReportUtils.isExpenseReport(report) && + (ReportUtils.isReportManager(report) || isPolicyAdmin) && + (ReportUtils.isReportApproved(report) || ReportUtils.isReportManuallyReimbursed(report)); useEffect(() => { if (canDeleteRequest) {