itplr-kosit / validator-configuration-xrechnung

Configuration for validating documents against the German XRechnung standard using the KoSIT validation tool
https://xeinkauf.de/xrechnung/
Apache License 2.0
65 stars 17 forks source link

Issue with rounding: either BR-CO-17 is violated or BR-S-09 #74

Closed webbasan closed 2 years ago

webbasan commented 2 years ago

We encountered a problem when creating a Storno for an invoice:

The correct values (inverse values(!) of the original invoice) are:

This gets reported as violating the following rule: [BR-CO-17]-VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals. Path: /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeSettlement[1]/ram:ApplicableTradeTax[1]

Using the above numbers, the exact value would be: -7612.50 * 0.19 = -1446,375

To get past that issue, we tried to maipulate the value of BT-117:

But this gets reported as violation of another rule: [BR-S-09]-The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "Standard rated" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119). Path: /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeSettlement[1]/ram:ApplicableTradeTax[1]/ram:CategoryCode[1]

So -- how is this supposed to work?

Validationtool 1.4.1 Scenario EN16931 CIUS XRechnung 2.0 (CII)

phax commented 2 years ago

This is a problem in the XRechnung 2.0 Schematrons, because they are based on CEN 1.3.3.

In XRechnung 2.1 the BR-CO-17 slack was added and it should work.

The BR-S-09 missing slack in CII is part of the upcoming CEN 1.3.8 release - dunno when it build be used in XRechnung. This is subject to internal discussion

webbasan commented 2 years ago

Ok, I got back to the problem and I can now confirm that the issue is gone with the current (1.4,2) version of the validator. We also updated to support XRechnung 2.2 that might help as well... ;-)