Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-25 18:52:11 +00:00
co-authored by renee-png
parent 4be52214a2
commit 3684b9fadb
+7 -3
View File
@@ -17,6 +17,8 @@ export interface ExpenseReportRow {
case_label: string;
user_name: string;
description: string;
quantity: number;
unit_price: number;
amount: number;
billable: boolean;
}
@@ -93,20 +95,22 @@ export function generateExpenseReportPdf(opts: BaseOpts & { rows: ExpenseReportR
const totalAmt = opts.rows.reduce((a, r) => a + (r.amount || 0), 0);
autoTable(doc, {
startY: 110,
head: [["Date", "Case", "User", "Description", "Billable", "Amount"]],
head: [["Date", "Case", "User", "Description", "Qty", "Unit", "Billable", "Amount"]],
body: opts.rows.map((r) => [
fmtDate(r.expense_date),
r.case_label,
r.user_name,
r.description,
String(r.quantity ?? 1),
fmtCurrency(r.unit_price ?? r.amount),
r.billable ? "Yes" : "No",
fmtCurrency(r.amount),
]),
foot: [["", "", "", "", "Total", fmtCurrency(totalAmt)]],
foot: [["", "", "", "", "", "", "Total", fmtCurrency(totalAmt)]],
styles: { font: "times", fontSize: 9, cellPadding: 4 },
headStyles: { fillColor: [240, 240, 240], textColor: 20 },
footStyles: { fillColor: [240, 240, 240], textColor: 20, fontStyle: "bold" },
columnStyles: { 5: { halign: "right" } },
columnStyles: { 4: { halign: "right" }, 5: { halign: "right" }, 7: { halign: "right" } },
});
return doc;
}