mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
Merge pull request #593 from bigcapitalhq/fix-round-pending-matching
fix: Rounding the total amount the pending and matched transactions
This commit is contained in:
@@ -64,7 +64,7 @@ export class GetMatchedTransactions {
|
|||||||
.whereIn('id', uncategorizedTransactionIds)
|
.whereIn('id', uncategorizedTransactionIds)
|
||||||
.throwIfNotFound();
|
.throwIfNotFound();
|
||||||
|
|
||||||
const totalPending = Math.abs(sumBy(uncategorizedTransactions, 'amount'));
|
const totalPending = sumBy(uncategorizedTransactions, 'amount');
|
||||||
|
|
||||||
const filtered = filter.transactionType
|
const filtered = filter.transactionType
|
||||||
? this.registered.filter((item) => item.type === filter.transactionType)
|
? this.registered.filter((item) => item.type === filter.transactionType)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import { useMemo } from 'react';
|
||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
|
import { round } from 'lodash';
|
||||||
import { MatchingTransactionFormValues } from './types';
|
import { MatchingTransactionFormValues } from './types';
|
||||||
import { useMatchingTransactionBoot } from './MatchingTransactionBoot';
|
import { useMatchingTransactionBoot } from './MatchingTransactionBoot';
|
||||||
import { useCategorizeTransactionTabsBoot } from './CategorizeTransactionTabsBoot';
|
|
||||||
import { useMemo } from 'react';
|
|
||||||
|
|
||||||
export const transformToReq = (
|
export const transformToReq = (
|
||||||
values: MatchingTransactionFormValues,
|
values: MatchingTransactionFormValues,
|
||||||
@@ -38,7 +38,7 @@ export const useGetPendingAmountMatched = () => {
|
|||||||
);
|
);
|
||||||
const pendingAmount = totalPending - totalMatchedAmount;
|
const pendingAmount = totalPending - totalMatchedAmount;
|
||||||
|
|
||||||
return pendingAmount;
|
return round(pendingAmount, 2);
|
||||||
}, [totalPending, perfectMatches, possibleMatches, values]);
|
}, [totalPending, perfectMatches, possibleMatches, values]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user