Skip to content

Let modules read invoices and embed XML in invoice PDFs - #15

Merged
gdarko merged 1 commit into
masterfrom
feat/invoice-documents
Oct 24, 2026
Merged

gdarko merged 1 commit into
masterfrom
feat/invoice-documents

Conversation

@gdarko

@gdarko gdarko commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Module API 1.5.0, for the e-invoicing module (and later anything else that turns invoices into other documents).

  • Contracts\Host\InvoiceDocumentReader: invoiceDocument($companyId, $invoiceId) returns an InvoiceDocument (typed, read-only data under src/Documents/Data): seller and buyer with addresses and tax ids, lines with unit codes, document and line taxes with EN 16931 category codes, the related invoice of a credit note, totals in stored hundredths. seller($companyId) for checks before any invoice exists.
  • Contracts\Host\PdfCapabilities::embedsFacturX(): whether invoice PDFs can carry a Factur-X XML (Gotenberg, not dompdf).
  • Pdf\Contracts\InvoicePdfAttachmentProvider + Pdf\Data\FacturXAttachment, registered once per module with Registry::registerInvoicePdfAttachmentProvider($slug, $class). The host embeds the attachment in every invoice PDF it renders; a failing provider falls back to the ordinary PDF.

The host side lands in InvoiceShelf 3.0.0-alpha.13. Tag 3.6.0 after merge.

Module API 1.5.0: InvoiceDocumentReader returns a whole invoice as typed,
read-only data (parties, lines with unit codes, taxes with EN 16931
category codes, the related invoice of a credit note), PdfCapabilities
says whether invoice PDFs can carry a Factur-X XML, and modules register
an InvoicePdfAttachmentProvider whose FacturXAttachment the host embeds.
@gdarko
gdarko merged commit d6a47c2 into master Oct 24, 2026
2 checks passed
@gdarko
gdarko deleted the feat/invoice-documents branch October 24, 2026 09:41
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