From fc4e215d1bcfdb8daf3ff2f1b18b376645d897df Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 26 Apr 2026 08:30:34 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/cases/collections-tab.tsx | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/cases/collections-tab.tsx b/src/components/cases/collections-tab.tsx index 5062be2..b83d51e 100644 --- a/src/components/cases/collections-tab.tsx +++ b/src/components/cases/collections-tab.tsx @@ -602,18 +602,18 @@ export function CollectionDetail({ const exportStatement = () => { const rows = [ - ["Date", "Description", "Account", "Assess", "Late", "Admin", "Legal", "Viol", "Int", "Bank", "Payment", "Balance"].join(","), + ["Date", "Description", "Account", "Bank", "Int", "Late", "Admin", "Legal", "Viol", "Assess", "Payment", "Balance"].join(","), ...withRunning.map((e: any) => [ e.entry_date, `"${(e.description || "").replace(/"/g, '""')}"`, e.account || e.transaction_type || "", - num(e.assess).toFixed(2), + num(e.bank).toFixed(2), + num(e.interest).toFixed(2), num(e.late).toFixed(2), num(e.admin).toFixed(2), num(e.legal).toFixed(2), num(e.viol).toFixed(2), - num(e.interest).toFixed(2), - num(e.bank).toFixed(2), + num(e.assess).toFixed(2), num(e.payment).toFixed(2), e.runningBalance.toFixed(2), ].join(",")), @@ -676,8 +676,9 @@ export function CollectionDetail({ formatDate(collection.opened_at), "Opening balance", "opening", + "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", opening > 0 ? opening.toFixed(2) : "0.00", - "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", + "0.00", formatCurrency(opening), ]); } @@ -686,33 +687,33 @@ export function CollectionDetail({ formatDate(e.entry_date), e.description || "—", e.account || e.transaction_type || "", - num(e.assess) ? num(e.assess).toFixed(2) : "", + num(e.bank) ? num(e.bank).toFixed(2) : "", + num(e.interest) ? num(e.interest).toFixed(2) : "", num(e.late) ? num(e.late).toFixed(2) : "", num(e.admin) ? num(e.admin).toFixed(2) : "", num(e.legal) ? num(e.legal).toFixed(2) : "", num(e.viol) ? num(e.viol).toFixed(2) : "", - num(e.interest) ? num(e.interest).toFixed(2) : "", - num(e.bank) ? num(e.bank).toFixed(2) : "", + num(e.assess) ? num(e.assess).toFixed(2) : "", num(e.payment) ? num(e.payment).toFixed(2) : "", formatCurrency(e.runningBalance ?? 0), ]); }); body.push([ { content: "Totals", colSpan: 3, styles: { halign: "right", fontStyle: "bold" } }, - totals.assess.toFixed(2), + totals.bank.toFixed(2), + totals.interest.toFixed(2), totals.late.toFixed(2), totals.admin.toFixed(2), totals.legal.toFixed(2), totals.viol.toFixed(2), - totals.interest.toFixed(2), - totals.bank.toFixed(2), + totals.assess.toFixed(2), totals.payment.toFixed(2), formatCurrency(computed.total), ]); autoTable(doc, { startY: startY + 36, - head: [["Date", "Description", "Account", "Assess", "Late", "Admin", "Legal", "Viol", "Int", "Bank", "Payment", "Balance"]], + head: [["Date", "Description", "Account", "Bank", "Int", "Late", "Admin", "Legal", "Viol", "Assess", "Payment", "Balance"]], body, styles: { fontSize: 8, cellPadding: 3 }, headStyles: { fillColor: [40, 40, 40], textColor: 255 },