Skip to content

Commit

Permalink
fix: due Amount on edit page is calculated wrong with "Exclusive of T…
Browse files Browse the repository at this point in the history
…ax" Invoice mode
  • Loading branch information
mittalsam98 committed Aug 3, 2024
1 parent 940b4f9 commit 8cab012
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -32,7 +32,7 @@ function InvoiceFormBigTotal() {
} = useFormikContext();

// Calculate the total due amount of invoice entries.
const totalDueAmount = useInvoiceSubtotal();
const totalDueAmount = useInvoiceDueAmount();

return (
<PageFormBigNumber
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8cab012

Please sign in to comment.