Summary
The PDF generation for invoices and proformas (via ReportLab in pdf_generators.py) needs EN16931 and Romanian legal compliance upgrades. Currently it generates basic coordinate-based PDFs without embedded XML, full Romanian fields, or structured tax breakdowns.
Current State
The PDF generator (RomanianDocumentPDFGenerator in services/platform/apps/billing/pdf_generators.py) uses ReportLab with manual coordinate-based text placement. It includes basic company info, client info, items table, and totals.
Missing for EN16931 Compliance
Missing for Romanian Law
Technical Notes
- Current implementation: services/platform/apps/billing/pdf_generators.py (ReportLab)
- PDF views: services/platform/apps/billing/views.py (invoice_pdf ~line 1220, proforma_pdf ~line 1126)
- Consider migrating to WeasyPrint or xhtml2pdf for HTML-based PDF templates (easier to maintain than coordinate-based ReportLab)
- For PDF/A-3 with embedded XML, consider using pikepdf or pdfrw to attach the UBL XML after generation
- EN16931 line-level fields (domain_name, seller_item_id, period) already exist on the models — just need to be rendered in PDF
Related
- EN16931 field additions implemented in the codebase (domain_name, seller_item_id, period_start/end on InvoiceLine/ProformaLine)
- XML builder (efactura/xml_builder.py) already generates compliant UBL XML — needs to be embedded in PDF
Summary
The PDF generation for invoices and proformas (via ReportLab in pdf_generators.py) needs EN16931 and Romanian legal compliance upgrades. Currently it generates basic coordinate-based PDFs without embedded XML, full Romanian fields, or structured tax breakdowns.
Current State
The PDF generator (RomanianDocumentPDFGenerator in services/platform/apps/billing/pdf_generators.py) uses ReportLab with manual coordinate-based text placement. It includes basic company info, client info, items table, and totals.
Missing for EN16931 Compliance
Missing for Romanian Law
Technical Notes
Related