fix(server): match transactions query

This commit is contained in:
Ahmed Bouhuolia
2024-07-06 16:10:34 +02:00
parent 87f60f7461
commit cd9039fe16
21 changed files with 413 additions and 71 deletions

View File

@@ -29,7 +29,9 @@ export const useGetPendingAmountMatched = () => {
},
);
const totalMatchedAmount = matchedItems.reduce(
(total, item) => total + parseFloat(item.amount),
(total, item) =>
total +
(item.transactionNormal === 'debit' ? 1 : -1) * parseFloat(item.amount),
0,
);
const amount = uncategorizedTransaction.amount;