From 0409b5471ac9eef046a02cfc7119bc433c31e481 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 27 Oct 2023 12:33:44 +0700 Subject: [PATCH 1/2] fix: Copy to clipboard paid IOU in IOU page, instead of paid text requested text shown --- src/libs/ReportUtils.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index eb558e7ac066..43a466e83408 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -4064,10 +4064,17 @@ function getIOUReportActionDisplayMessage(reportAction) { const transaction = TransactionUtils.getTransaction(originalMessage.IOUTransactionID); const {amount, currency, comment} = getTransactionDetails(transaction); const formattedAmount = CurrencyUtils.convertToDisplayString(amount, currency); - displayMessage = Localize.translateLocal('iou.requestedAmount', { - formattedAmount, - comment, - }); + const isRequestSettled = isSettled(originalMessage.IOUReportID); + if (!isRequestSettled) { + displayMessage = Localize.translateLocal('iou.requestedAmount', { + formattedAmount, + comment, + }); + } else { + displayMessage = Localize.translateLocal('iou.payerSettled', { + amount: formattedAmount, + }); + } } return displayMessage; } From 233f97a31ffa921a47ec5829fb68015a1a34a772 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 1 Nov 2023 20:43:59 +0700 Subject: [PATCH 2/2] revert the condition --- src/libs/ReportUtils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 6187d0b52fce..f4e50c5e5f2a 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -4063,15 +4063,15 @@ function getIOUReportActionDisplayMessage(reportAction) { const {amount, currency, comment} = getTransactionDetails(transaction); const formattedAmount = CurrencyUtils.convertToDisplayString(amount, currency); const isRequestSettled = isSettled(originalMessage.IOUReportID); - if (!isRequestSettled) { + if (isRequestSettled) { + displayMessage = Localize.translateLocal('iou.payerSettled', { + amount: formattedAmount, + }); + } else { displayMessage = Localize.translateLocal('iou.requestedAmount', { formattedAmount, comment, }); - } else { - displayMessage = Localize.translateLocal('iou.payerSettled', { - amount: formattedAmount, - }); } } return displayMessage;