mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14: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 { CLASSES } from '@/constants/classes';
|
||||||
import { PageFormBigNumber } from '@/components';
|
import { PageFormBigNumber } from '@/components';
|
||||||
import { useInvoiceSubtotal } from './utils';
|
import { useInvoiceDueAmount } from './utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice form header section.
|
* Invoice form header section.
|
||||||
@@ -32,7 +32,7 @@ function InvoiceFormBigTotal() {
|
|||||||
} = useFormikContext();
|
} = useFormikContext();
|
||||||
|
|
||||||
// Calculate the total due amount of invoice entries.
|
// Calculate the total due amount of invoice entries.
|
||||||
const totalDueAmount = useInvoiceSubtotal();
|
const totalDueAmount = useInvoiceDueAmount();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageFormBigNumber
|
<PageFormBigNumber
|
||||||
|
|||||||
@@ -302,8 +302,8 @@ export const useInvoiceTotals = () => {
|
|||||||
);
|
);
|
||||||
// Retrieves the formatted due total.
|
// Retrieves the formatted due total.
|
||||||
const dueTotal = React.useMemo(
|
const dueTotal = React.useMemo(
|
||||||
() => total - paymentTotal,
|
() => total_ - paymentTotal,
|
||||||
[total, paymentTotal],
|
[total_, paymentTotal],
|
||||||
);
|
);
|
||||||
// Retrieves the formatted due total.
|
// Retrieves the formatted due total.
|
||||||
const formattedDueTotal = React.useMemo(
|
const formattedDueTotal = React.useMemo(
|
||||||
|
|||||||
Reference in New Issue
Block a user