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>
This commit is contained in:
2026-11-11 18:32:46 +01:00
co-authored by Claude Fable 5.2
parent 6126a19bb7
commit 7aa4506dd7
8 changed files with 1229 additions and 42 deletions
+11
View File
@@ -29,6 +29,17 @@ invoice PDFs here.
|-----------|----------|------------|
| extended_fc_steuernummer_basisqty.xml | EXTENDED | FC-only tax registration ignored, unit price with basis quantity 100 misread, spaced VAT ID rejected, contact email dropped (2026-09) |
## Plain XML Invoices - `xml/`
Official KoSIT XRechnung test-suite business case 01.01a, the same invoice
in both syntaxes (source: https://github.com/itplr-kosit/xrechnung-testsuite,
Apache License 2.0).
| Filename | Profile | Syntax |
|-----------|----------|--------|
| xrechnung_01.01a_cii.xml | XRechnung 3.0 | CII |
| xrechnung_01.01a_ubl.xml | XRechnung 3.0 | UBL |
## Profile Coverage
- **MINIMUM**: Not covered (future addition)