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`;