From 94d3e0024475bfaab00ca8a292a59260f1c31d18 Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Mon, 16 Sep 2024 14:44:15 +0800 Subject: [PATCH 1/3] Unheld total needs to be multiplied against coefficient as well --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f35ab637aea..81ce57f2d78 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7225,7 +7225,7 @@ function getNonHeldAndFullAmount(iouReport: OnyxEntry, policy: OnyxEntry if (hasUpdatedTotal(iouReport, policy) && hasPendingTransaction) { const unheldTotal = reportTransactions.reduce((currentVal, transaction) => currentVal + (!TransactionUtils.isOnHold(transaction) ? transaction.amount : 0), 0); - return [CurrencyUtils.convertToDisplayString(unheldTotal, iouReport?.currency), CurrencyUtils.convertToDisplayString((iouReport?.total ?? 0) * coefficient, iouReport?.currency)]; + return [CurrencyUtils.convertToDisplayString(unheldTotal * coefficient, iouReport?.currency), CurrencyUtils.convertToDisplayString((iouReport?.total ?? 0) * coefficient, iouReport?.currency)]; } return [ From db3083222f226f66e90ee79112326e121bd2d00d Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Tue, 17 Sep 2024 09:13:25 +0800 Subject: [PATCH 2/3] style --- src/libs/ReportUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 81ce57f2d78..f6010246b06 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7225,7 +7225,10 @@ function getNonHeldAndFullAmount(iouReport: OnyxEntry, policy: OnyxEntry if (hasUpdatedTotal(iouReport, policy) && hasPendingTransaction) { const unheldTotal = reportTransactions.reduce((currentVal, transaction) => currentVal + (!TransactionUtils.isOnHold(transaction) ? transaction.amount : 0), 0); - return [CurrencyUtils.convertToDisplayString(unheldTotal * coefficient, iouReport?.currency), CurrencyUtils.convertToDisplayString((iouReport?.total ?? 0) * coefficient, iouReport?.currency)]; + return [ + CurrencyUtils.convertToDisplayString(unheldTotal * coefficient, iouReport?.currency), + CurrencyUtils.convertToDisplayString((iouReport?.total ?? 0) * coefficient, iouReport?.currency) + ]; } return [ From 4a2ed86789eb9075a8d6d6594927e45b53b10621 Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Tue, 17 Sep 2024 09:32:06 +0800 Subject: [PATCH 3/3] style, --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 71b414aa930..d89f81ee81a 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7223,7 +7223,7 @@ function getNonHeldAndFullAmount(iouReport: OnyxEntry, policy: OnyxEntry return [ CurrencyUtils.convertToDisplayString(unheldTotal * coefficient, iouReport?.currency), - CurrencyUtils.convertToDisplayString((iouReport?.total ?? 0) * coefficient, iouReport?.currency) + CurrencyUtils.convertToDisplayString((iouReport?.total ?? 0) * coefficient, iouReport?.currency), ]; }