Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-26 08:30:34 +00:00
co-authored by renee-png
parent c9db366d7d
commit fc4e215d1b
+13 -12
View File
@@ -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 },