Right-align FX rate and Amount labels in PDF to sit above their values

Labels were left-aligned at c4 while values were flush-right, causing
them to not line up. Labels now share the same right edge as their values.

https://claude.ai/code/session_01MbwfxnjLA9KdFTrfzB55HM
This commit is contained in:
Claude 2026-05-24 16:42:53 +00:00
parent eeed56ca89
commit e08ffbf333
No known key found for this signature in database

View file

@ -773,7 +773,7 @@ async function generatePDF() {
pg.drawText('Date', {x:M.left+c1, y, size:szSm-1, font:fontBold, color:gray});
pg.drawText('Vendor', {x:M.left+c2, y, size:szSm-1, font:fontBold, color:gray});
pg.drawText('Currency', {x:M.left+c3, y, size:szSm-1, font:fontBold, color:gray});
pg.drawText('FX rate', {x:M.left+c4, y, size:szSm-1, font:fontBold, color:gray});
const fxLbl = 'FX rate'; pg.drawText(fxLbl, {x:M.left+W-fontBold.widthOfTextAtSize(fxLbl,szSm-1), y, size:szSm-1, font:fontBold, color:gray});
y -= lh;
// Row 1 values
const dateInPeriod = isDateInPeriod(ln.date);
@ -789,7 +789,7 @@ async function generatePDF() {
// Row 2 labels: Description | Receipt | Amount
pg.drawText('Description', {x:M.left, y, size:szSm-1, font:fontBold, color:gray});
pg.drawText('Receipt', {x:M.left+c3, y, size:szSm-1, font:fontBold, color:gray});
pg.drawText('Amount', {x:M.left+c4, y, size:szSm-1, font:fontBold, color:gray});
const amtLbl = 'Amount'; pg.drawText(amtLbl, {x:M.left+W-fontBold.widthOfTextAtSize(amtLbl,szSm-1), y, size:szSm-1, font:fontBold, color:gray});
y -= lh;
// Row 2 values
pg.drawText(truncate(ln.description, fontBody, sz, (c3)-8), {x:M.left, y, size:sz, font:fontBody, color:black});