feat(billing): EN16931 + Romanian law PDF compliance (#153)#166
Open
b3lz3but wants to merge 2 commits intocaptainpragmatic:masterfrom
Open
feat(billing): EN16931 + Romanian law PDF compliance (#153)#166b3lz3but wants to merge 2 commits intocaptainpragmatic:masterfrom
b3lz3but wants to merge 2 commits intocaptainpragmatic:masterfrom
Conversation
…ptainpragmatic#153) Enhance the ReportLab PDF generator with EN16931-compliant fields and Romanian legal requirements: - VAT breakdown per rate (not hardcoded 21%) - Full client address with registration number and tax ID - Seller bank details (IBAN, bank name) and registration number - EN16931 line-level fields: domain name, service period, SKU - Reverse charge notation for intra-EU B2B (tax_category_code=AE) - Exchange rate display for non-RON currencies - Updated fiscal disclaimers per Romanian legislation - Dynamic currency codes from invoice model (not hardcoded RON) - Line-level discount rendering - bill_to_registration_number field on Invoice and ProformaInvoice Closes captainpragmatic#153 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ciprian Radulescu <craps2003@gmail.com>
Contributor
Author
|
@mostlyvirtual — requesting review on this EN16931 PDF compliance PR. |
The comprehensive test file asserted old English disclaimer text and
hardcoded RON currency. Updated to match new Romanian-language
disclaimers and dynamic {currency} placeholder in total labels.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Ciprian Radulescu <craps2003@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhances the ReportLab PDF generator for invoices and proformas with EN16931-compliant fields and Romanian legal requirements. No WeasyPrint migration (deferred) — builds on the existing coordinate-based approach.
Closes #153
What changed
Seller section — now renders: registration number (Nr. Reg. Com.), phone, bank name, IBAN. New settings:
COMPANY_REGISTRATION_NUMBER,COMPANY_BANK_NAME,COMPANY_BANK_ACCOUNT.Client section — renders full address:
bill_to_address1,bill_to_address2, city/region/postal/country, CUI/CIF, registration number (newbill_to_registration_numberfield), email. Dynamic y-stepping skips empty fields.Items table — 5 columns (added VAT%). EN16931 sub-lines below each item: domain name, service period (dd.mm.yyyy), SKU/product code. Line-level discounts rendered. Currency code from invoice model, not hardcoded "RON".
Totals section — VAT breakdown per rate (groups lines by
tax_rate). Reverse charge notation ("Taxare inversă — Art. 331 Cod Fiscal") whentax_category_code=AE. Exchange rate line for non-RON invoices frommeta.exchange_rate.Legal disclaimers — Invoice: "Factură fiscală emisă conform art. 319 din Legea nr. 227/2015". Proforma: "Factura proforma nu constituie document fiscal."
Model changes — Added
bill_to_registration_number(CharField, blank) to both Invoice and ProformaInvoice. Migration0025.Files changed
apps/billing/pdf_generators.pyconfig/settings/base.pyapps/billing/invoice_models.pybill_to_registration_numberfieldapps/billing/proforma_models.pybill_to_registration_numberfieldapps/billing/migrations/0025_*tests/billing/test_pdf_generators.pyDeferred to follow-up
Test plan
🤖 Generated with Claude Code