Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-19 20:10:01 +00:00
co-authored by renee-png
parent a803bb5e3e
commit e92c677976
+3 -4
View File
@@ -403,15 +403,14 @@ export async function downloadInvoicePdf(input: InvoicePdfInput, filename: strin
const descMaxW = colQtyR - colDescX - 14;
const descLines = wrap(pdf, item.description || (item.kind === "expense" ? "Expense" : ""), descMaxW);
const lineHeight = 12;
const blockH = Math.max(lineHeight * descLines.length + 14, item.user_name ? 32 : 26);
const blockH = Math.max(lineHeight * descLines.length + 14, item.user_initials ? 32 : 26);
ensure(blockH + 4);
setFont(pdf, { size: 9, color: TEXT });
pdf.text(fmtDateShort(item.work_date), colDateX, y + 12);
if (item.user_name) {
if (item.user_initials) {
setFont(pdf, { size: 7.5, color: MUTED });
const nameLines = wrap(pdf, item.user_name, colKindX - colDateX - 4);
pdf.text(nameLines[0], colDateX, y + 23);
pdf.text(item.user_initials, colDateX, y + 23);
}
setFont(pdf, { size: 9, color: MUTED });