Skip to content

feat(finance): print-ready statement PDFs (#99 pt.2)#103

Merged
ankitsejwal merged 1 commit into
mainfrom
feat/m3.5-statements-pdf
Jul 16, 2026
Merged

feat(finance): print-ready statement PDFs (#99 pt.2)#103
ankitsejwal merged 1 commit into
mainfrom
feat/m3.5-statements-pdf

Conversation

@ankitsejwal

Copy link
Copy Markdown
Member

M3.5 · Task #99 (part 2) — statement PDFs

Completes #99 acceptance (3): Balance Sheet / I&E / R&P as print-ready PDF.

  • lib/statements-pdf.ts — paginated A4 table renderer (pdf-lib) that turns any report Table into a print-ready PDF: first column left-aligned, numeric columns right-aligned, bold header rule, auto page breaks.
  • ?format=pdf on /reports/{trial-balance,income-expenditure,balance-sheet,receipts-payments} (alongside xlsx|csv).
  • Smoke-tested locally: valid %PDF, reloads in pdf-lib as a paged doc; route tests assert the application/pdf + text/csv content-types.

Notes

  • ₹ glyph: WinAnsi StandardFonts can't encode ₹, so amounts render "Rs" (same documented limitation as the existing invoice PDF). A true ₹ needs a bundled Unicode TTF via fontkit — deliberately not attempted (bundling a font binary into the Worker + no way to verify rendering here).

Suite 361 green. No schema change. This finishes task #99.

- lib/statements-pdf.ts: a paginated A4 table renderer (pdf-lib) that turns any
  report Table into a print-ready PDF — first column left-aligned, numeric
  columns right-aligned, bold header rule. WinAnsi can't encode ₹ so amounts
  render "Rs" (same limitation as the invoice PDF; documented).
- ?format=pdf on /reports/{trial-balance,income-expenditure,balance-sheet,
  receipts-payments} alongside xlsx|csv.
- Smoke-tested: valid %PDF, reloads in pdf-lib; route tests assert the pdf/csv
  content-types. Suite 361 green.

Completes #99 acceptance (3): Balance Sheet / I&E / R&P as print-ready PDF.
The invoice ₹-glyph fix needs a bundled Unicode TTF (fontkit) — left as a known
limitation, not attempted here.
@ankitsejwal
ankitsejwal merged commit f854356 into main Jul 16, 2026
1 check passed
@ankitsejwal
ankitsejwal deleted the feat/m3.5-statements-pdf branch July 16, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant