From 6f5108ca63f80552af7c02486aac1995987b937e Mon Sep 17 00:00:00 2001 From: SJCoetz Date: Tue, 21 Jul 2026 13:26:13 +0200 Subject: [PATCH] fix(pdf): adjust spacing to stop L and Rand text overlapping increase vertical spacing before subtotal line from 6 to 10 points, widen horizontal gap between quantity and pricing text, and add an explanatory comment --- lib/pdf/reports.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pdf/reports.ts b/lib/pdf/reports.ts index c6b8fb3b..ff26ebf0 100644 --- a/lib/pdf/reports.ts +++ b/lib/pdf/reports.ts @@ -108,15 +108,17 @@ async function customerDelivery(ctx: ReportContext): Promise { return r; }); drawTable(pdf, cols, rows); - moveDown(pdf, 6); - // Subtotal on a single line, right-aligned to the last column + moveDown(pdf, 10); + // Subtotal on a single line, right-aligned to the last column. + // The qty and value are separated by a wide gap so the "L" (litres) + // and "R" (Rand) don't visually run into each other. const subtotalRight = 40 + cols.reduce((a, c) => a + c.width, 0); if (ctx.includePricing) { const totalValStr = formatCurrency(totalValue); const valW = pdf.font.widthOfTextAtSize(totalValStr, 10); const subtotalStr = `Subtotal: ${formatNumber(totalQty)} L`; const subW = pdf.font.widthOfTextAtSize(subtotalStr, 10); - drawText(pdf, subtotalStr, { x: subtotalRight - valW - 12 - subW, y: pdf.y, size: 10, bold: true }); + drawText(pdf, subtotalStr, { x: subtotalRight - valW - 32 - subW, y: pdf.y, size: 10, bold: true }); drawText(pdf, totalValStr, { x: subtotalRight - 8 - valW, y: pdf.y, size: 10, bold: true }); } else { const subtotalStr = `Subtotal: ${formatNumber(totalQty)} L`;