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>
This commit is contained in:
2026-11-11 18:33:08 +01:00
co-authored by Claude Fable 5.2
parent 4ff994a299
commit fa9eaa4f82
8 changed files with 117 additions and 6 deletions
+2
View File
@@ -6,6 +6,7 @@ tests/fixtures/real/, verify it contains no real-world data, and add a test
here that locks in the correct behavior.
"""
import re
from io import BytesIO
from pathlib import Path
@@ -51,6 +52,7 @@ class TestFcTaxNumberBasisQuantityInvoice:
data = result.xml_data
assert data.invoice_number == "4711"
assert re.fullmatch(r"\d{4}-\d{2}-\d{2}", data.due_date)
assert data.supplier.tax_number == "1112223334444"
assert data.supplier.vat_id is None
assert data.supplier.email == "rechnung@beispielwerkstatt.example"