From e97b0fe0edcb12dd97d5cf829f6517a5ffb35695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20Sta=CC=88rk?= Date: Thu, 6 Aug 2020 12:00:12 +0200 Subject: [PATCH] Xrechnung 2.0 validation --- History.md | 1 + .../XR/CII/XRechnung-CII-model.part | 104 +++++++++--------- .../XR/XRechnung-CII-validation.sch | 58 +++++----- .../XR/abstract/XRechnung-model.part | 7 +- .../xslt/XR/XRechnung-CII-validation.xslt | 36 ++++-- 5 files changed, 112 insertions(+), 94 deletions(-) diff --git a/History.md b/History.md index 23062454..3f8d575f 100644 --- a/History.md +++ b/History.md @@ -33,6 +33,7 @@ done - be able to ignore input pdf errors with -i - be able to recursively scan directories using validateExpectValid/validateExpectInvalid - upgraded to verapdf 1.16.1 +- support to validate XRechnung 2.0 - added Ghostscript signature - removal of izugferddate/IZUGFeRDPaymentTerms,IZUGFeRDPaymentDiscountTerms switch diff --git a/validator/src/main/resources/schematron/XR/CII/XRechnung-CII-model.part b/validator/src/main/resources/schematron/XR/CII/XRechnung-CII-model.part index f7bf177c..bae7c60b 100644 --- a/validator/src/main/resources/schematron/XR/CII/XRechnung-CII-model.part +++ b/validator/src/main/resources/schematron/XR/CII/XRechnung-CII-model.part @@ -1,61 +1,61 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - + + + + + - + - + - + - + diff --git a/validator/src/main/resources/schematron/XR/XRechnung-CII-validation.sch b/validator/src/main/resources/schematron/XR/XRechnung-CII-validation.sch index 56465ad8..220b4aa4 100644 --- a/validator/src/main/resources/schematron/XR/XRechnung-CII-validation.sch +++ b/validator/src/main/resources/schematron/XR/XRechnung-CII-validation.sch @@ -1,38 +1,34 @@ - Schematron Version 1.3.0 - XRechnung - 1.2.2 compatible - CII - - - - - - - - - + xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" + xmlns:ccts="urn:un:unece:uncefact:documentation:standard:CoreComponentsTechnicalSpecification:2" + xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" + xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" + xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" + schemaVersion="2.0.0" queryBinding="xslt2"> + Schematron Version @xr-schematron.version.full@ - XRechnung + @xrechnung.version@ compatible - CII + + + + + - - - - - - - - + + + + + + + + + diff --git a/validator/src/main/resources/schematron/XR/abstract/XRechnung-model.part b/validator/src/main/resources/schematron/XR/abstract/XRechnung-model.part index 67651071..f6997680 100644 --- a/validator/src/main/resources/schematron/XR/abstract/XRechnung-model.part +++ b/validator/src/main/resources/schematron/XR/abstract/XRechnung-model.part @@ -11,6 +11,11 @@ [BR-DE-17] Mit dem Element "Invoice type code" (BT-3) sollen ausschließlich folgende Codes aus der Codeliste UNTDID 1001 übermittelt werden: 326 (Partial invoice), 380 (Commercial invoice), 384 (Corrected invoice), 389 (Self-billed invoice) und 381 (Credit note),875 (Partial construction invoice), 876 (Partial final construction invoice), 877 (Final construction invoice). [BR-DE-18] Die Informationen zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen wie folgt im Element "Payment terms" (BT-20) übermittelt werden: Anzugeben ist im ersten Segment "SKONTO" oder "VERZUG", im zweiten "TAGE=n", im dritten "PROZENT=n". Prozentzahlen sind ohne Vorzeichen sowie mit Punkt getrennt von zwei Nachkommastellen anzugeben. Liegt dem zu berechnenden Betrag nicht BT-115, "fälliger Betrag" zugrunde, sondern nur ein Teil des fälligen Betrags der Rechnung, ist der Grundwert zur Berechnung von Skonto oder Verzugszins als viertes Segment "BASISBETRAG=n" gemäß dem semantischen Datentypen Amount anzugeben. Jeder Eintrag beginnt mit einer #, die Segmente sind mit einer # getrennt und eine Zeile schließt mit einer # ab. Am Ende einer vollständigen Skonto oder Verzugsangabe muss ein XML-konformer Zeilenumbruch folgen. Alle Angaben zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen in Großbuchstaben gemacht werden. Zusätzliches Whitespace (Leerzeichen, Tabulatoren oder Zeilenumbrüche) ist nicht zulässig. Andere Zeichen oder Texte als in den oberen Vorgaben genannt sind nicht zulässig. + [BR-DE-22] Not all filename attributes of the embeddedDocumentBinaryObject elements are unique + [BR-DE-11] Das Element "Deliver to post code" (BT-78) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird. - [BR-DE-19] "Payment account identifier" (BT-84) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 58 SEPA als Zahlungsmittel gefordert wird. [BR-DE-20] "Debited account identifier" (BT-91) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 59 SEPA als Zahlungsmittel gefordert wird. diff --git a/validator/src/main/resources/xslt/XR/XRechnung-CII-validation.xslt b/validator/src/main/resources/xslt/XR/XRechnung-CII-validation.xslt index 91b3f2e3..b4748be7 100644 --- a/validator/src/main/resources/xslt/XR/XRechnung-CII-validation.xslt +++ b/validator/src/main/resources/xslt/XR/XRechnung-CII-validation.xslt @@ -153,7 +153,7 @@ - +     @@ -178,8 +178,8 @@ -Schematron Version 1.3.0 - XRechnung - 1.2.2 compatible - CII +Schematron Version @xr-schematron.version.full@ - XRechnung + @xrechnung.version@ compatible - CII @@ -277,6 +277,22 @@ + + + + + + + BR-DE-22 + fatal + + + + [BR-DE-22] Not all filename attributes of the embeddedDocumentBinaryObject elements are unique + + + + @@ -286,9 +302,9 @@ - + - + BR-DE-21 warning @@ -487,11 +503,11 @@ - + - + BR-DE-19 - warning + fatal @@ -502,9 +518,9 @@ - + - + BR-DE-20 warning