WG: ZUGFeRD 2.0: ZUV

130 views
Skip to first unread message

Schulz, Kristina | DATAflor

unread,
Jul 29, 2019, 3:29:45 AM7/29/19
to zug...@googlegroups.com

Hello there!

  Jochen Staerk suggested to post this in the zugferdgroup to make it an official task. So here we go

  Working with ZUGFeRD 2.0 i have encountered 2 files that dont validate with the official https://www.zugferd-community.net/de/dashboard/validation based on https://github.com/ZUGFeRD/ZUV. The files seems to be ok to me and are very similar to some of the offical xml-files that are shipped with the ZUGFeRD2.0 package.

 

 

1.     ZUGFeRD-invoice_rabatte_3_abschlag_duepayableamount.xml

Here we have the GrandTotalAmount of 64.74 and a TotalPrepaidAmount of 50€ that results in a DuePayableAmount of 14.74. But there is an exception from the validator that reads:

 

Das ZUGFeRD-xml ist nicht valide.

Profile: urn:cen.eu:en16931:2017

  • Der Inhalt des Elementes „Amount due for payment“ (BT-115) entspricht dem Inhalt des Elementes „Invoice total VAT amount“ (BT-110) abzüglich dem Inhalt des Elementes „Paid amount“ (BT-113) zuzüglich dem Inhalt des Elementes „Rounding amount“ (BT-114).

Funny thing is that when changing TotalPrepaidAmount to 0.00 and DuePayableAmount to 64.74 it passes.

 

2.     ZUGFeRD-invoice_rabatte_4_abschlag_taxbasistotalamount.xml

Here comes the error with the TaxBasisTotalAmount. Using LineTotalAmount of 201.48 minus AllowanceTotalAmount of 7.05 results in the TaxBasisTotalAmount of 194.43. Seems good to me. But the exception from the validator says

 

Das ZUGFeRD-xml ist nicht valide.

Profile: urn:cen.eu:en16931:2017

  • Der Inhalt des Elementes „Invoice total amount without VAT“ (BT-109) entspricht der Summe aller Inhalte der Elemente „Invoice line net amount“ (BT-131) abzüglich der Summe aller in der Rechnung enthaltenen Nachlässe der Dokumentenebene „Sum of allowances on document level“ (BT-107) zuzüglich der Summe aller in der Rechnung enthaltenen Abgaben der Dokumentenebene „Sum of charges on document level“ (BT-108).

 

Thanks in advance

Kind regards

//Kristina Schulz 

 

 

Herzliche Grüße aus Göttingen

Kristina Schulz
- Forschung, Entwicklung -

 

DATAflor AG

August-Spindler-Str. 20, 37079 Göttingen
Tel +49 (551) 50665-722
Fax +49 (551) 50665-59

ksc...@dataflor.de

www.DATAflor.de

Vorstand: Christoph Honig, Matthias Gehrke
Aufsichtsratsvorsitzender: Adi Drotleff
Amtsgericht Göttingen: HRB 200484; USt.Id.Nr. DE 143581466

Unsere Angaben zu den Informationspflichten laut EU-DSGVO finden Sie auf unserer Webseite.

Vorstand: Christoph Honig, Matthias Gehrke
Aufsichtsratsvorsitzender: Adi Drotleff
Amtsgericht Göttingen: HRB 200484; USt.Id.Nr. DE 143581466

Unsere Angaben zu den Informationspflichten laut EU-DSGVO finden Sie auf unserer Webseite.
ZUGFeRD-invoice_rabatte_3_abschlag_duepayableamount.xml
ZUGFeRD-invoice_rabatte_4_abschlag_taxbasistotalamount.xml

Jochen Stärk

unread,
Aug 2, 2019, 4:15:09 PM8/2/19
to ZUGFeRD
Hi,

It was a hard one but it turns out that at least your second issue is a rounding error in the validation, I created https://github.com/ZUGFeRD/ZUV/issues/22 for that.
The XML is validated with the "official" ZUGFeRD Schematron file, which is based on the official CEN schematron file, which is AFAIK created using Gefeg FX. 
My validator converts into a XSLT transformation. This XSLT is applied using a XSLT processor, Saxon in that case.
It turns out instead of 194.43 it expects 194.42999999999998 as TaxBasisTotalAmount (= ram:LineTotalAmount - ram:AllowanceTotalAmount), which is a) wrong and b) would violate some other constraints.

I'll have a look if I can find a workaround (maybe rounding to two digits in the XSLT, or better the Schematron file), or if there is any known issue or setting regards the precision in Saxon, and how to upstream the findings to Saxon and/or the CEN. This will take some months, I hope I follow up. In any case, I'll let you know if /  when a workaround has been found and if / when the issue has been fixed. 

kind regards
Jochen
Reply all
Reply to author
Forward
0 new messages