2 Commits
Author SHA1 Message Date
m3ta-chironandClaude Fable 5.2 fa9eaa4f82 feat: extract due date and buyer reference, require it on XRechnung
- CII: due_date is read from the payment due date (BT-9) instead of the
  delivery terms description, normalized to YYYY-MM-DD
- new field buyer_reference (BT-10, the Leitweg-ID) for CII and UBL
- /validate accepts an optional profile; on XRECHNUNG_* profiles a
  missing buyer reference is a critical error (BR-DE-15)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 18:33:08 +01:00
m3ta-chironandClaude Fable 5.2 7aa4506dd7 feat(extract): support plain XML invoices and UBL syntax
/extract now accepts all EN 16931 e-invoices, not only ZUGFeRD PDFs:

- plain XML files via the new xml_base64 field; XML sent as pdf_base64
  is detected from the content
- UBL 2.1 Invoice and CreditNote (XRechnung UBL, Peppol BIS Billing) via
  the new src/ubl_parser.py, also when embedded in a PDF
- new response field xml_syntax ("CII" or "UBL")
- CII invoice dates are normalized to YYYY-MM-DD, matching UBL
- XRechnung profiles are detected from the specification identifier,
  independent of the factur-x version (6.x reports them as EN16931)
- untrusted XML is parsed without entity or DTD resolution (XXE)

Fixtures: KoSIT XRechnung test-suite case 01.01a in CII and UBL.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 18:32:46 +01:00