diff --git a/src/components/cases/collections-tab.tsx b/src/components/cases/collections-tab.tsx index 06cac6d..5062be2 100644 --- a/src/components/cases/collections-tab.tsx +++ b/src/components/cases/collections-tab.tsx @@ -57,7 +57,7 @@ import { BUCKET_LABEL, computeBucketBalances, num, - withRunningBalance, + withAllocations, } from "@/lib/ledger"; import { DndContext, @@ -533,7 +533,7 @@ export function CollectionDetail({ [entries, opening], ); const withRunning = useMemo( - () => withRunningBalance(entries as any, opening), + () => withAllocations(entries as any, opening), [entries, opening], ); @@ -972,13 +972,13 @@ export function CollectionDetail({ Date Description Account - Assess ($) + Bank ($) + Int ($) Late ($) Admin ($) Legal ($) Viol ($) - Int ($) - Bank ($) + Assess ($) Pay (AR) Balance @@ -1000,8 +1000,9 @@ export function CollectionDetail({ {formatDate(collection.opened_at)} Opening balance opening + 0.00 {opening > 0 ? opening.toFixed(2) : "0.00"} - 0.00 + 0.00 {formatCurrency(opening)} @@ -1019,13 +1020,13 @@ export function CollectionDetail({ ))} Totals: - {formatCurrency(totals.assess)} + {formatCurrency(totals.bank)} + {formatCurrency(totals.interest)} {formatCurrency(totals.late)} {formatCurrency(totals.admin)} {formatCurrency(totals.legal)} {formatCurrency(totals.viol)} - {formatCurrency(totals.interest)} - {formatCurrency(totals.bank)} + {formatCurrency(totals.assess)} {formatCurrency(totals.payment)} {formatCurrency(computed.total)}