mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix: BIG-206 Reconcilate credit note and vendor credit with invoices should amount to credit be max the invoice remaining amount.
This commit is contained in:
@@ -66,3 +66,13 @@ export const useReconcileVendorCreditTableColumns = () => {
|
||||
[],
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets max amount credit from purchase due amount.
|
||||
*/
|
||||
export const maxAmountCreditFromRemaining = (entries) => {
|
||||
return entries.map((entry) => ({
|
||||
...entry,
|
||||
amount: entry.amount ? Math.min(entry.due_amount, entry.amount) : '',
|
||||
}));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user