From ee5d96e43e1c0c7caea8519a29c51abb2c117a42 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 26 Jul 2023 16:21:45 -0600 Subject: [PATCH 1/2] use stateNum to determine report state --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 8b3a0cacffca..982f82dac8ad 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -236,7 +236,7 @@ function canEditReportAction(reportAction) { */ function isSettled(reportID) { const report = lodashGet(allReports, `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {}); - return !_.isEmpty(report) && !report.hasOutstandingIOU && !report.isWaitingOnBankAccount; + return !_.isEmpty(report) && !report.isWaitingOnBankAccount && report.stateNum > CONST.REPORT.STATE_NUM.PROCESSING; } /** From 910b13441784f779b8ccd15490f328838d0e1360 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 27 Jul 2023 12:18:00 -0600 Subject: [PATCH 2/2] update message --- src/libs/ReportUtils.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 982f82dac8ad..85af7984fd58 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1223,14 +1223,12 @@ function getReportPreviewMessage(report, reportAction = {}) { return Localize.translateLocal(translatePhraseKey, {amount: formattedAmount}); } - if (report.hasOutstandingIOU) { - return Localize.translateLocal('iou.payerOwesAmount', {payer: payerName, amount: formattedAmount}); - } - if (report.isWaitingOnBankAccount) { const submitterDisplayName = getDisplayNameForParticipant(report.ownerAccountID, true); return Localize.translateLocal('iou.waitingOnBankAccount', {submitterDisplayName}); } + + return Localize.translateLocal('iou.payerOwesAmount', {payer: payerName, amount: formattedAmount}); } /**