Skip to content

EN 16931 e-invoicing: ZUGFeRD / Factur-X hybrid invoice PDFs - #1

Merged
gdarko merged 4 commits into
mainfrom
feat/initial-module
Oct 24, 2026
Merged

gdarko merged 4 commits into
mainfrom
feat/initial-module

Conversation

@gdarko

@gdarko gdarko commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

E-Invoicing 0.1.0: invoice PDFs become ZUGFeRD / Factur-X hybrid e-invoices (EN 16931 CII embedded as factur-x.xml in PDF/A-3b), and the XML downloads on its own.

  • Reads invoices through the host's InvoiceDocumentReader and embeds through InvoicePdfAttachmentProvider (module API 1.5, InvoiceShelf 3.0.0-alpha.13). bundled: horstoeko/zugferd and 12 packages.
  • En16931Mapper builds a syntax-neutral EN 16931 document or names what is missing; CiiWriter writes it. A UBL writer can follow without touching the mapping.
  • Settings page (owners only): switch, IBAN, BIC (validated on the server, mod-97), payment terms, readiness checklist, and a notice when the PDF service cannot embed. Invoice page: status panel and Download XML.
  • Ported from the work of André Kinne and iebl, including their builder tests on the host's worked example. Added: credit notes (381, positive amounts, BG-3 reference, no payment means), payment terms for invoices without a due date (BR-CO-25), reverse charge and intra-community supplies with the buyer VAT ID (BR-AE-02, BR-IC-02/12). Outside the scope (O), Canary Islands (L) and Ceuta/Melilla (M) are reported as unsupported.
  • CI checks every valid scenario against Mustang and the CEN EN 16931 schematron, and that the fixture still matches the host's worked example.

One CI step is temporary: the fixture-drift check reads the host fixture from the #937 branch until InvoiceShelf#937 merges, then from 3.x.

Builds EN 16931 CII XML from the host's invoice document data with a
bundled horstoeko/zugferd and hands it to the host to embed in every
invoice PDF (module API 1.5). An owners-only settings page holds the
switch, IBAN, BIC and payment terms and shows what the company still
lacks; each invoice gets a status panel and a Download XML action.

The mapping, requirements and builder tests are ported from the work of
André Kinne and iebl, with credit notes, payment terms, reverse charge
and intra-community supplies added, and checked against Mustang CLI and
the CEN EN 16931 schematron.
horstoeko/zugferd accepts any symfony/yaml, and with the PHP 8.4.0
platform the resolver settled on 8.0.15, a line the unbounded-recursion
advisory covers entirely. Require ^7.4.18 || ^8.1.6 so the bundle ships a
fixed release (7.4.21), and run CI on the Composer the release workflow
pins.
The SDK is tagged, so CI installs from the lock instead of the branch.
@gdarko
gdarko merged commit e17285a into main Oct 24, 2026
1 check passed
@gdarko
gdarko deleted the feat/initial-module branch October 24, 2026 09:52
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