From 56fb305133b58d94b7ad7b66269901dfbec436dc Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Thu, 19 Sep 2024 21:09:25 +0800 Subject: [PATCH 1/3] IOU optimistic amount coefficient --- 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 6f694fd41403..0d27bd4e8241 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6448,7 +6448,7 @@ function getReportFromHoldRequestsOnyxData( chatReport.reportID, chatReport.policyID ?? iouReport.policyID ?? '', recipient.accountID ?? 1, - holdTransactions.reduce((acc, transaction) => acc + transaction.amount, 0) * -1, + holdTransactions.reduce((acc, transaction) => acc + transaction.amount, 0) * (ReportUtils.isExpenseReport(iouReport) ? -1 : 1), getCurrency(firstHoldTransaction), false, newParentReportActionID, From 63d4062ef936ebb5f73cfba7af85712ad7f7d5c7 Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Fri, 20 Sep 2024 13:39:04 +0800 Subject: [PATCH 2/3] check if iou specifically --- 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 0d27bd4e8241..bef7304468a5 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6448,7 +6448,7 @@ function getReportFromHoldRequestsOnyxData( chatReport.reportID, chatReport.policyID ?? iouReport.policyID ?? '', recipient.accountID ?? 1, - holdTransactions.reduce((acc, transaction) => acc + transaction.amount, 0) * (ReportUtils.isExpenseReport(iouReport) ? -1 : 1), + holdTransactions.reduce((acc, transaction) => acc + transaction.amount, 0) * (ReportUtils.isIOU(iouReport) ? 1 : -1), getCurrency(firstHoldTransaction), false, newParentReportActionID, From 3bfa88d8c50fc8485a0fdf57a71a5926ac08edac Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Fri, 20 Sep 2024 13:44:38 +0800 Subject: [PATCH 3/3] Update IOU.ts --- 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 bef7304468a5..fc7c21a4c6a0 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6448,7 +6448,7 @@ function getReportFromHoldRequestsOnyxData( chatReport.reportID, chatReport.policyID ?? iouReport.policyID ?? '', recipient.accountID ?? 1, - holdTransactions.reduce((acc, transaction) => acc + transaction.amount, 0) * (ReportUtils.isIOU(iouReport) ? 1 : -1), + holdTransactions.reduce((acc, transaction) => acc + transaction.amount, 0) * (ReportUtils.isIOUReport(iouReport) ? 1 : -1), getCurrency(firstHoldTransaction), false, newParentReportActionID,