zugferd / zuv Goto Github PK
View Code? Open in Web Editor NEWZUgferd validator using Verapdf
License: Apache License 2.0
ZUgferd validator using Verapdf
License: Apache License 2.0
Since ZF2 has now been officially released we can use it's schematron files.
How you could help:
In the forum https://www.zugferd-community.net/forum/viewtopic.php?f=4&t=51 they say that a basic invoice with typecode 380 (incorrectly) validated as not correct because 751 should only be the only value for minimum, not for basic invoices, which sounds right.
since the xrechnung xsl files are available in their configuration https://github.com/itplr-kosit/validator-configuration-xrechnung/releases one could check if they could be added e.g. on a warning or notice level
e.g. this is currently (E snapshot) considered correct
<?xml version="1.0" encoding="utf-8"?>
<rsm:CrossIndustryDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rsm="urn:ferd:CrossIndustryDocument:invoice:1p0" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15">
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:ferd:CrossIndustryDocument:invoice:1p0:extended</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:CrossIndustryDocument>
despite it does seem to run through the XSLT. I created an automated test which fails.
There should be statistics how many files have been checked and how many of them had been generated e.g. using intarsys, konik or mustangproject
Hallo Jochen Staerk @jstaerk,
ich habe den Validator auf der zugferd-community Seite genutzt.
Und zwar mit einer Rechnung, die als CII xml und als UBL xml verliegt. Die zwei unterschiedlichen Syntaxen sind ja in ZUGFerRD möglich.
Kann es sein, dass ZUV nur CII erwartert?
Gruß EUGen H.
the release 0.8.2 generates error 'Invalid byte 1 of 1-byte UTF-8 sequence.`
java -jar /usr/share/java/ZUV-0.8.2.jar --action validate -f example.pdf
Oct 16, 2019 8:15:25 PM org.mustangproject.ZUGFeRD.ZUGFeRDImporter <init>
SEVERE: null
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.setDocument(ZUGFeRDImporter.java:170)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.setRawXML(ZUGFeRDImporter.java:176)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.extractFiles(ZUGFeRDImporter.java:150)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.extractLowLevel(ZUGFeRDImporter.java:124)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.<init>(ZUGFeRDImporter.java:77)
at ZUV.PDFValidator.validate(PDFValidator.java:143)
at ZUV.ZUGFeRDValidator.validate(ZUGFeRDValidator.java:84)
at ZUV.Main.run(Main.java:81)
at ZUV.Main.main(Main.java:99)
Exception in thread "main" org.mustangproject.ZUGFeRD.ZUGFeRDExportException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.<init>(ZUGFeRDImporter.java:80)
at ZUV.PDFValidator.validate(PDFValidator.java:143)
at ZUV.ZUGFeRDValidator.validate(ZUGFeRDValidator.java:84)
at ZUV.Main.run(Main.java:81)
at ZUV.Main.main(Main.java:99)
Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.setDocument(ZUGFeRDImporter.java:170)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.setRawXML(ZUGFeRDImporter.java:176)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.extractFiles(ZUGFeRDImporter.java:150)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.extractLowLevel(ZUGFeRDImporter.java:124)
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.<init>(ZUGFeRDImporter.java:77)
... 4 more
This happens with the downloaded jar as well as the self compiled jars (openjdk and oracle jdk).
java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
Andreas Starke had already published a way how ZUGFeRD "extensions"/additional data can accomodate special needs of industry branches (http://4s4u.de/additional_data/), e.g. if you need to specify the mileage in a logistics your invoice can say "one washing machne, one dry cleaner" and the additional data can say that the delivery truck transported the washing machine 500km but the dry cleaner only 25 because it was picked up elsewhere. There is a python library and a command line tool to embed/extract this files, the idea is that the mustangproject library and command line tool can do that too and ZUV can validate this additional data.
e.g. https://raw.githubusercontent.com/itplr-kosit/validator-configuration-xrechnung/master/src/test/instances/cii001.xml is a valid xml file which starts with a comment
Zum Einsatz kommt ZUV 0.9.0. Den ZUGFeRDExporter
konfiguriere ich mit zfVersion=2 und ZUGFeRDConformanceLevel.EN16931.
Am Ende der Validierung erhalte folgenden Fehler, den ich mir nicht erklären kann:
Value of '@schemeID' is not allowed.
Herausgefunden habe ich, dass 'schemeID' wie folgt vorkommt:
<ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">
und
<ram:SpecifiedLegalOrganization><ram:ID schemeID='9930'>
Wenn ich die Fehlermeldung "richtig" verstehe, wird in einem oder in beiden Elementen für 'schemeID' kein Wert verlangt.
Kann man den Fehler auf eines oder auf beide Elemente zurückführen !?
Wie kommt der hinterlegte Wert hier zustande?
I'd like to perform the actual validation against the ZUGFeRD
schematron, more precisely against the generated XSL file.
I included ph-schematron as dependency, which will throw me
noClassFound-Runtime exceptions if I only include it in the pom. I tried
to solve that by shading the apparently required classes into the JAR.
The issue is: if I do, I will inevitably run into a Nullpointerexception.
I left one comment in the pom.xml and two in
src/main/java/ZUV/ZUGFeRDExtractor.java in the current master [37794a4]
which, if removed, should perform the validation but previously run into
the NullPointerException at
org.verapdf.processor.FeaturesPluginsLoader.initializeExtractor(FeaturesPluginsLoader.java:132)
.
Can someone please help?
Allegedly the 505 ZF1 sample does not validate on validator.zugferd.org
Betreff: Unklarheit in der Validierung von ZUGFeRD 2.1
Hallo,
ich bin der Entwickler hinter der C#-ZUGFeRD-Bibliothek ZUFeRD-csharp (https://github.com/stephanstapel/ZUGFeRD-csharp).
Im Rahmen der Implementierung der Version 2.1 haben wir das Attribute currencyID wie im Standard vorgesehen so abgebildet, dass es nur im Profil Extended erzeugt wird.
Allerdings ist es so, dass der Validator dann die Summen als nicht korrekt ansieht. Dieser Fehler wurde hier gemeldet:
stephanstapel/ZUGFeRD-csharp#56
Die Fehlermeldung macht deutlich, dass der Selektor für die Validierung offenbar das Attribut currencyID erfordert (obwohl dies nicht vorhanden sein muss):
ram:GrandTotalAmount = round(ram:TaxBasisTotalAmount*100 + ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]*100 +0) div 100) or ((ram:GrandTotalAmount = ram:TaxBasisTotalAmount) and not (ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]))
Habe ich das so richtig verstanden? Und falls ja: wie muss eine Rechnung dann korrekt aufgebaut werden für Formate < Extended?
can not build with version 1.6.1.
if I change 1.6.1 to 1.6.0 in pom it works
Downloading from mavencentral: http://repo.maven.apache.org/maven2/org/mustangproject/ZUGFeRD/mustang/1.6.1/mustang-1.6.1.pom
Downloading from sonatype-oss-public: https://oss.sonatype.org/content/groups/public/org/mustangproject/ZUGFeRD/mustang/1.6.1/mustang-1.6.1.pom
Downloading from mustang-mvn-repo: https://raw.github.com/ZUGFeRD/mustangproject/mvn-repo/org/mustangproject/ZUGFeRD/mustang/1.6.1/mustang-1.6.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/mustangproject/ZUGFeRD/mustang/1.6.1/mustang-1.6.1.pom
[WARNING] The POM for org.mustangproject.ZUGFeRD:mustang:jar:1.6.1 is missing, no dependency information available
Downloading from sonatype-oss-public: https://oss.sonatype.org/content/groups/public/com/sanityinc/jargs/2.0-SNAPSHOT/maven-metadata.xml
Downloading from mavencentral: http://repo.maven.apache.org/maven2/com/sanityinc/jargs/2.0-SNAPSHOT/maven-metadata.xml
Downloading from mustang-mvn-repo: https://raw.github.com/ZUGFeRD/mustangproject/mvn-repo/com/sanityinc/jargs/2.0-SNAPSHOT/maven-metadata.xml
Downloaded from sonatype-oss-public: https://oss.sonatype.org/content/groups/public/com/sanityinc/jargs/2.0-SNAPSHOT/maven-metadata.xml (762 B at 1.2 kB/s)
Downloading from mavencentral: http://repo.maven.apache.org/maven2/org/mustangproject/ZUGFeRD/mustang/1.6.1/mustang-1.6.1.jar
Downloading from sonatype-oss-public: https://oss.sonatype.org/content/groups/public/org/mustangproject/ZUGFeRD/mustang/1.6.1/mustang-1.6.1.jar
Downloading from mustang-mvn-repo: https://raw.github.com/ZUGFeRD/mustangproject/mvn-repo/org/mustangproject/ZUGFeRD/mustang/1.6.1/mustang-1.6.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/mustangproject/ZUGFeRD/mustang/1.6.1/mustang-1.6.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.811 s
[INFO] Finished at: 2019-04-04T13:02:55+02:00
[INFO] Final Memory: 12M/363M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ZUV: Could not resolve dependencies for project org.zugferd:ZUV:jar:0.7.0b-SNAPSHOT: Could not find artifact org.mustangproject.ZUGFeRD:mustang:jar:1.6.1 in mavencentral (http://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Java 1.8 works but java 9 throws
Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:470)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:63)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:128)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:84)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:162)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:92)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:444)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:292)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:139)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1138)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:262)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:249)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:456)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:656)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:599)
at org.verapdf.core.XmlSerialiser.toXml(XmlSerialiser.java:240)
at org.verapdf.processor.AbstractXmlHandler.serialseElement(AbstractXmlHandler.java:64)
at org.verapdf.processor.MrrHandler.addReleaseDetails(MrrHandler.java:115)
at org.verapdf.processor.MrrHandler.handleBatchStart(MrrHandler.java:104)
at org.verapdf.processor.AbstractBatchProcessor.process(AbstractBatchProcessor.java:101)
at ZUV.Main.main(Main.java:111)
Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 26 more
check if FNFE factur-x1.0.05 schematrons are identical, and if not, check if they should be used instead of the zugferd ones
currently the xslt1 based validation takes 10-12 minutes per file, with xslt2 it was 10-20 seconds only
e.g. Facture_DOM_EN16931.pdf reports
<errors><error><criterion>not(ram:GrossPriceProductTradePrice/ram:AppliedTradeAllowanceCharge/ram:CalculationPercent)</criterion><result>[CII-SR-122] - CalculationPercent should not be present</result></error>
<error><criterion>not(ram:GrossPriceProductTradePrice/ram:AppliedTradeAllowanceCharge/ram:BasisAmount)</criterion><result>[CII-SR-123] - BasisAmount should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>not(@currencyID)</criterion><result>[CII-DT-031] - currencyID should not be present</result></error>
<error><criterion>((not(contains(normalize-space(.), ' ')) and contains(' AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BL BJ BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW ', concat(' ', normalize-space(.), ' '))))</criterion><result>[CL-14]-Country codes in an invoice MUST be coded using ISO code list
3166-1</result></error>
<error><criterion>((not(contains(normalize-space(.), ' ')) and contains(' AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BL BJ BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW ', concat(' ', normalize-space(.), ' '))))</criterion><result>[CL-14]-Country codes in an invoice MUST be coded using ISO code list
3166-1</result></error>
</errors>
taxcurrencycode is 0..1 but if it's 1, the validation will fail
in https://www.zugferd-community.net/forum/viewtopic.php?f=4&t=66
this zip contains a "invalid" sample file and a "fixed" one
zi.zip. I checked against the ZF2.1 TA that TaxCurrencyCode is 0..1
apart from xml and pdf the validity of the xmp schema pdfa extension should be checked
The ZF2 schematron displays error messages in german. The file should be translated to show them in english.
How you can help:
get the ZUGFeRD 2 infopaket, translate the german texts in the (assert tags only?) of the xml files SCHEMA/BASIC und MINIMUM/zugferd2p0_basicwl_minimum.sch, SCHEMA/EN16931/zugferd2p0_en16931.sch, and SCHEMA/EXTENDED/zugferd2p0_extended.sch and attach the files to this ticket
I got the following error:
schema validation fails:org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 15; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":Name}'. One of '{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":TypeCode}' is expected.
But ExchangedDocument support ID, Name, TypeCode and IssueDateTime!
Profile: urn:cen.eu:en16931:2017
Despite correct totals entered in SpecifiedTradeSettlementHeaderMonetarySummation trying to validate throws an error referring to BR-CO-15: BT-112 = BT-109 + BT-110
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>21618.00</ram:LineTotalAmount>
<ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>
<ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>
<ram:TaxBasisTotalAmount>21618.00</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount>4107.42</ram:TaxTotalAmount>
<ram:GrandTotalAmount>25725.42</ram:GrandTotalAmount>
<ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount>
<ram:DuePayableAmount>25725.42</ram:DuePayableAmount
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
Currently we only write in the report xml file but for the end user there should be a clear optical indication if the file is ZUGFeRD compliant and if no, why not
ZUGFeRD-invoice_rabatte_4_abschlag_taxbasistotalamount.xml of the post in https://groups.google.com/forum/#!topic/zugferd/5k22Ph0F82g
yields the schematron error
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).
It seems to be a rounding error within the XSLT, Saxon, or both: I reduced the test in the XSLT file to ((ram:TaxBasisTotalAmount = ram:LineTotalAmount - ram:AllowanceTotalAmount) and not (ram:ChargeTotalAmount)) and
added <xsl:value-of select="ram:LineTotalAmount - ram:AllowanceTotalAmount"/> and with
ram:LineTotalAmount of 201.48 and ram:AllowanceTotalAmount 7.05 the result of the XSLT was 194.42999999999998 instead of 194.43, as in the document
Hi,
when validating an BASIC invoice built with konik, the error Element 'ram:AssociatedDocumentLineDocument' must occur exactly 1 times.
is shown. I openend Issue konik-io/konik#89, where the konik team stated that AssociatedDocumentLineDocument should not exist in Basic Profile according to the ZUGFeRD specification.
My XML, the validation report and the specifiation reference are included in this issue.
validating single files is possible with --f, it should alternatively be possible to recursively traverse through directories using --d
this apparently requires a new root node for the output report to remain xml compliant.
As an extra feature there could be nonverbose tabular output (e.g. only filename and validity) and a hit list, i.e. a summary at the end repeating which errors was present how often in the validated files, by error count descending.
The attached factur-x
Facture_F20180027-LE_CLIENT_20181231.pdf
file should work flawlessly, and be included in the automatic tests:
How you can help:
Find out how https://github.com/veraPDF/veraPDF-rest can be used as web interface for ZUV
e.g. the sample from the email of today 14:38h does not
Looks abandoned, is there a newer tool to validate zugferd?
attaching the steps I made to compile it
build.txt
if unitcode from Rec. N°21 is used for quantity code
<ram:IncludedSupplyChainTradeLineItem>
<ram:SpecifiedLineTradeDelivery>
<ram:PackageQuantity unitCode="CT">4.0000</ram:PackageQuantity>
ZUV returns:
<error type="4" location="/*[local-name()='CrossIndustryInvoice']/*[local-name()='SupplyChainTradeTransaction']/*[local-name()='IncludedSupplyChainTradeLineItem'][1]/*[local-name()='SpecifiedLineTradeDelivery']/*[local-name()='PackageQuantity']" criterion="document('zugferd2p0_extended_codedb.xml')//cl[@id=9]/enumeration[@value=$codeValue9]">
> Wert von '@unitCode' ist unzulässig.</error>
Maybe Rec. N°21 isn't implemented?
I used a official example from ZUGFeRD
Reported by Daniel Vinz, zugferd_2p0_EN16931_Einfach.pdf throws
<messages><error type="11">XMP Metadata: ConformanceLevel not found</error>
<error type="13">XMP Metadata: DocumentType not found</error>
<error type="21">XMP Metadata: DocumentFileName not found</error>
<error type="15">XMP Metadata: Version not found</error>
</messages>
Original text:
if a invoice contains both tax currencycode and invoicecurrencycode like the one on https://www.zugferd-community.net/forum/posting.php?mode=reply&f=4&t=57
<ram:ApplicableHeaderTradeSettlement>
<ram:TaxCurrencyCode>EUR</ram:TaxCurrencyCode>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
returns a
<error type="4" location="/*[local-name()='CrossIndustryInvoice']/*[local-name()='SupplyChainTradeTransaction']/*[local-name()='ApplicableHeaderTradeSettlement']/*[local-name()='SpecifiedTradeSettlementHeaderMonetarySummation']" criterion="not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode) or (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode and (ram:TaxTotalAmount/@currencyID = /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode) and not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode = /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode))">
Wenn eine Währung für die Umsatzsteuerabrechnung angegeben wurde, muss der Umsatzsteuergesamtbetrag in der Abrechnungswährung „Invoice total VAT amount in accounting currency“ (BT-111) angegeben werden.</error>
which can be solved if
<ram:TaxCurrencyCode>EUR</ram:TaxCurrencyCode>
is removed, but that does not make sense, maybe wrong brackets in the Schematron?
Original attachment
M1_RE100084.zip
Marcus Hartmann requested that ZUV should also indicate how many and, if meaningful, which Schematron rules were successfully applied.
In der Klasse "Validator" wird in der Methode versucht das Schema zu laden:
protected void validateSchema(byte[] xmlRawData, String schemaPath, int section, EPart part) throws IrrecoverableValidationError { URL schemaFile = ClassLoader.getSystemResource("schema/" + schemaPath);
Was allerdings fehlschlägt und es kommt zu einer NullPointerException. Beim Debuggen kann man zwar feststellen, dass der Pfad zur Datei richtig ist, aber geladen wird die Resource doch nicht.
Festgestellt habe ich eher, dass mit der Anweisung wie
final InputStream is = getClass().getResourceAsStream(resourceFile);
ich Resourcen geladen bekomme. Warum ClassLoader.getSystemResource
das Laden einer
Resource nicht bewerkstelligt bekommt, ist mir noch ein "Rätsel".
Setze ZUV 0.9.0 ein.
When I validate a particular PDF/A-3 B file with a file attachement (I
can send you the file upon request, I just don't want to publish it via
this list), VeraPDF 1.10.6 on a Mac with Java 1.8.0_40 will throw an
exception and report two errors against ISO 19005-3:2012, Clause: 6.1.7.
The report says Exception: Exception caught when extracting features of
item caused by exception: org/junit/rules/ExternalResource caused by
exception: org.junit.rules.ExternalResource
Specification: ISO 19005-3:2012, Clause: 6.1.7, Test number: 1
The value of the Length key specified in the stream dictionary shall
match the number of bytes in the file following the LINE FEED (0Ah)
character after the stream keyword and preceding the EOL marker before
the endstream keyword. Failed
CosStream
isLengthCorrect
root/document[0]/metadata[0](46 0 obj PDMetadata)/stream[0]
root/indirectObjects[9](46 0)/directObject[0]
The stacktrace on the console reads as follows:
{{{
Mär 21, 2018 10:20:15 AM org.verapdf.processor.ProcessorImpl extractFeatures
WARNUNG: Exception caught when extracting features of item
java.lang.NoClassDefFoundError: org/junit/rules/ExternalResource
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
org.verapdf.processor.FeaturesPluginsLoader.loadExtractorByClassNames(FeaturesPluginsLoader.java:177)
at
org.verapdf.processor.FeaturesPluginsLoader.loadExtractor(FeaturesPluginsLoader.java:142)
at
org.verapdf.processor.FeaturesPluginsLoader.getExtractorFromConfig(FeaturesPluginsLoader.java:112)
at
org.verapdf.processor.FeaturesPluginsLoader.getAllExtractors(FeaturesPluginsLoader.java:89)
at
org.verapdf.processor.FeaturesPluginsLoader.loadExtractors(FeaturesPluginsLoader.java:80)
at org.verapdf.processor.ProcessorImpl.getPlugins(ProcessorImpl.java:308)
at
org.verapdf.processor.ProcessorImpl.extractFeatures(ProcessorImpl.java:290)
at org.verapdf.processor.ProcessorImpl.process(ProcessorImpl.java:126)
at
org.verapdf.processor.BatchFileProcessor.processItem(BatchFileProcessor.java:98)
at
org.verapdf.processor.BatchFileProcessor.processList(BatchFileProcessor.java:74)
at
org.verapdf.processor.AbstractBatchProcessor.process(AbstractBatchProcessor.java:102)
at org.verapdf.gui.ValidateWorker.doInBackground(ValidateWorker.java:123)
at org.verapdf.gui.ValidateWorker.doInBackground(ValidateWorker.java:58)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException:
org.junit.rules.ExternalResource
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 30 more
}}}
...
Itext RUPS shows 3546 bytes for Metadata 0 Stream 0. In an editor that
looks like the embedded file starts there, but I guess it's compressed
because when I save it from Adobe Reader it 8235 bytes.
Are the reported errors reliable if an exception is thrown?
https://www.pdf-online.com/osa/validate.aspx signals a valid document.
Clause 6.1.7 is described in https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Parts-2-and-3-rules#rule-617-1 . ZUV is using veraPDF/greenfield but it does not help to switch to veraPDF/PDFbox
I don't know why I get returncode "255". Status is "valid"
`root@VM1:/opt/mydir/errors/gcnqe9ecmg6wkwuzwcz3bsaqaxupqctrknx9t1h7# /opt/system/jdkcorretto-8.212.04.2/jre/bin/java -jar ../../bin/ZUV-0.8.3.jar --action validate -f in.xml
2urn:cen.eu:en16931:20178308528
root@VM1:/opt/mydir/errors/gcnqe9ecmg6wkwuzwcz3bsaqaxupqctrknx9t1h7# echo $?
255`
Am I making a mistake?
since its problematic to display to derive the line number from xpath location (of an error), the eclipse xpath evaluation plugin does not work very well with namespace prefixes and for some reason xmllint
nor xmlstarlet seem to work it might be an idea to have a commandline option to show the results of a xpath on a doc
Find out if anything from the konik.io validator can be used. Find out if that can be done within the APL.
Validierung gegen Schematron Datei FACTUR-X_EXTENDED.scmt die mit der Dokumentation für 2.1 ausgeliefert wurde.
Verstoss gegen Geschäftregel BR-CO-17 wird gemeldet, der wohl auf eineim Rundungproblem mit xsl/xslt beruht.
Regel in der Schematron:
BasisAmount Amount: -7.50
RateApplicablePercent: 19
round(-7.50 * 19) div 100 in XSL = -1.42 während es mathematisch korrekt – 1.43 heissen müsste (wie es auch vom ERP berechnet wurde).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.