diff --git a/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeader.tsx b/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeader.tsx index 66d1ed48c..8ee7401bd 100644 --- a/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeader.tsx +++ b/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeader.tsx @@ -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 ( { ); // 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(