From d7a0a34247818a49eb7d2c46d2ead16b10592e55 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 24 Sep 2024 15:15:02 +0700 Subject: [PATCH 1/3] fix: Edited amount is not updated for hold report --- src/libs/actions/IOU.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index daaa766145ed..7fa5addcacc7 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6450,7 +6450,7 @@ function getReportFromHoldRequestsOnyxData( chatReport.reportID, chatReport.policyID ?? iouReport.policyID ?? '', recipient.accountID ?? 1, - holdTransactions.reduce((acc, transaction) => acc + transaction.amount, 0) * (ReportUtils.isIOUReport(iouReport) ? 1 : -1), + holdTransactions.reduce((acc, transaction) => acc + (transaction?.modifiedAmount ?? transaction.amount), 0) * (ReportUtils.isIOUReport(iouReport) ? 1 : -1), getCurrency(firstHoldTransaction), false, newParentReportActionID, From a17e53fa52e54b124e3b76c3830b31aa5dd4a9ad Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 30 Sep 2024 16:41:51 +0700 Subject: [PATCH 2/3] use utils function --- src/libs/actions/IOU.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 258b5a803900..261a99cdb7ac 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6449,7 +6449,7 @@ function getReportFromHoldRequestsOnyxData( chatReport.reportID, chatReport.policyID ?? iouReport?.policyID ?? '', recipient.accountID ?? 1, - holdTransactions.reduce((acc, transaction) => acc + (transaction?.modifiedAmount ?? transaction.amount), 0) * (ReportUtils.isIOUReport(iouReport) ? 1 : -1), + holdTransactions.reduce((acc, transaction) => acc + TransactionUtils.getAmount(transaction), 0) * (ReportUtils.isIOUReport(iouReport) ? 1 : -1), getCurrency(firstHoldTransaction), false, newParentReportActionID, From 1cf3b6b3ce4e62b625937dd82d175f69abecc293 Mon Sep 17 00:00:00 2001 From: nkdengineer <161821005+nkdengineer@users.noreply.github.com> Date: Fri, 4 Oct 2024 14:55:35 +0700 Subject: [PATCH 3/3] Update src/libs/actions/IOU.ts Co-authored-by: Shubham Agrawal <58412969+shubham1206agra@users.noreply.github.com> --- src/libs/actions/IOU.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 261a99cdb7ac..84208f3545be 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6449,7 +6449,7 @@ function getReportFromHoldRequestsOnyxData( chatReport.reportID, chatReport.policyID ?? iouReport?.policyID ?? '', recipient.accountID ?? 1, - holdTransactions.reduce((acc, transaction) => acc + TransactionUtils.getAmount(transaction), 0) * (ReportUtils.isIOUReport(iouReport) ? 1 : -1), + holdTransactions.reduce((acc, transaction) => acc + TransactionUtils.getAmount(transaction), 0), getCurrency(firstHoldTransaction), false, newParentReportActionID,