Root cause found in read-only sandbox
- What broke
-
Invoice PDFs crash for invoices created before March. The
paid_atcolumn was added later and isnilon older rows. - Where
-
app/pdfs/invoice_pdf.rb:42callspaid_at.strftimewithout a nil check.app/jobs/invoice_pdf_job.rb:18runs it for every invoice. - Fix plan
-
Fall back to
issued_atwhenpaid_atis nil, and add a regression spec for a legacy invoice row. - Risk note
- Scoped to PDF rendering only. No database migration, no billing state changes.