From f21052ff23b29094fcfe4c47eccd391da8fa23d1 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Thu, 30 Jan 2025 16:33:20 +0300 Subject: [PATCH 1/2] fix canAddOrDeleteTransactions logic --- src/libs/ReportUtils.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 5e50f69e28fa..028c2087c79e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2007,14 +2007,12 @@ function getChildReportNotificationPreference(reportAction: OnyxInputOrEntry): boolean { + if (moneyRequestReport?.reportID == '4070865872455813') debugger; if (!isMoneyRequestReport(moneyRequestReport) || isArchivedReportWithID(moneyRequestReport?.reportID)) { return false; } const policy = getPolicy(moneyRequestReport?.policyID); - if (isInstantSubmitEnabled(policy) && isSubmitAndClose(policy) && hasOnlyNonReimbursableTransactions(moneyRequestReport?.reportID)) { - return false; - } if (isInstantSubmitEnabled(policy) && isSubmitAndClose(policy) && !arePaymentsEnabled(policy)) { return false; @@ -2047,6 +2045,11 @@ function canAddTransaction(moneyRequestReport: OnyxEntry): boolean { return false; } + const policy = getPolicy(moneyRequestReport?.policyID); + if (isInstantSubmitEnabled(policy) && isSubmitAndClose(policy) && hasOnlyNonReimbursableTransactions(moneyRequestReport?.reportID)) { + return false; + } + return canAddOrDeleteTransactions(moneyRequestReport); } From cc23003a09835e0af5e3ffd50dad645b06703dd6 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Thu, 30 Jan 2025 17:29:52 +0300 Subject: [PATCH 2/2] minor fix --- src/libs/ReportUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 028c2087c79e..ae5fc41c063d 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2007,7 +2007,6 @@ function getChildReportNotificationPreference(reportAction: OnyxInputOrEntry): boolean { - if (moneyRequestReport?.reportID == '4070865872455813') debugger; if (!isMoneyRequestReport(moneyRequestReport) || isArchivedReportWithID(moneyRequestReport?.reportID)) { return false; }