Skip to content

Commit

Permalink
Fix unheld total
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjchen committed Sep 13, 2024
1 parent 5c0b724 commit cacbb0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7200,7 +7200,7 @@ function getNonHeldAndFullAmount(iouReport: OnyxEntry<Report>, policy: OnyxEntry
const coefficient = isExpenseReport(iouReport) ? -1 : 1;

if (hasUpdatedTotal(iouReport, policy) && hasPendingTransaction) {
const unheldTotal = reportTransactions.reduce((currentVal, transaction) => currentVal - (!TransactionUtils.isOnHold(transaction) ? transaction.amount : 0), 0);
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)];
}
Expand Down

0 comments on commit cacbb0c

Please sign in to comment.