mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
fix: due Amount on edit page is calculated wrong with "Exclusive of Tax" Invoice mode
This commit is contained in:
@@ -8,7 +8,7 @@ import InvoiceFormHeaderFields from './InvoiceFormHeaderFields';
|
||||
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
import { PageFormBigNumber } from '@/components';
|
||||
import { useInvoiceSubtotal } from './utils';
|
||||
import { useInvoiceDueAmount } from './utils';
|
||||
|
||||
/**
|
||||
* Invoice form header section.
|
||||
@@ -32,7 +32,7 @@ function InvoiceFormBigTotal() {
|
||||
} = useFormikContext();
|
||||
|
||||
// Calculate the total due amount of invoice entries.
|
||||
const totalDueAmount = useInvoiceSubtotal();
|
||||
const totalDueAmount = useInvoiceDueAmount();
|
||||
|
||||
return (
|
||||
<PageFormBigNumber
|
||||
|
||||
@@ -302,8 +302,8 @@ export const useInvoiceTotals = () => {
|
||||
);
|
||||
// Retrieves the formatted due total.
|
||||
const dueTotal = React.useMemo(
|
||||
() => total - paymentTotal,
|
||||
[total, paymentTotal],
|
||||
() => total_ - paymentTotal,
|
||||
[total_, paymentTotal],
|
||||
);
|
||||
// Retrieves the formatted due total.
|
||||
const formattedDueTotal = React.useMemo(
|
||||
|
||||
Reference in New Issue
Block a user