ZUGFeRD / mustangproject

Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
http://www.mustangproject.org
Apache License 2.0
168 stars 99 forks source link

The use of SpecifiedTradeSettlementPaymentMeans several times #385

Open simon-gotomaxx opened 1 month ago

simon-gotomaxx commented 1 month ago

According to the documentation, SpecifiedTradeSettlementPaymentMeans can be used multiple times to specify multiple banks. If I do this, I get an error message when validating:

` schema validation fails:org.xml.sax.SAXParseException; lineNumber: 273; columnNumber: 46; cvc-complex-type.2.4.a: Ungültiger Content wurde beginnend mit Element '{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":SpecifiedTradeSettlementPaymentMeans}' gefunden. '{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":ApplicableTradeTax}' wird erwartet.

Element 'ram:SpecifiedTradeSettlementPaymentMeans' may occur at maximum 1 times. from /xslt/ZF_221/FACTUR-X_EN16931.xslt)` When I check the same XML via the KoSIT Valitator, there are no problems. Here is an excerpt of the corresponding passage from the XML: ```xml . . . Zahlungshinweis 12345 EUR 30 Banküberweisung DE23123812000023423 Mustershop 24 HAP223N23445 30 Banküberweisung DE111111111111 Mustershop 24 HAP323232323 . . . ```
jstaerk commented 1 month ago

If your issue is a question if a mustang generated file is valid(?) please include either the complete source code and/or the complete output so that I can have a look and run it through a validator

simon-gotomaxx commented 1 month ago

I create the ZUGFeRD file in a custom application (Mustang is not used). I use Mustang (Mustang-CLI-2.11.0.jar) for validation and am wondering about the error message. Attached is the XML that produces the above error during validation. factur-x.zip

The error only occurs when I use SpecifiedTradeSettlementPaymentMeans multiple times. This should be possible according to the general ZUGFeRD documentation.

image

IsThatUniqueEnough commented 1 month ago

In the FACTUR-X schemas below the EXTENDED profile the cardinality of SpecifiedTradeSettlementPaymentMeans is [0..1].

simon-gotomaxx commented 1 month ago

Ah ok now I see it. <assert test=‘count(ram:SpecifiedTradeSettlementPaymentMeans)<=1’> Element ‘ram:SpecifiedTradeSettlementPaymentMeans’ may occur a maximum of 1 time.</assert (from the FACTUR-X_EN16931.sch schematron)

It is just a bit confusing as it is described in the documentation and even more so if it is allowed in xRechnung (EN16931).