Giter VIP home page Giter VIP logo

zuv's People

Contributors

dependabot[bot] avatar jstaerk avatar swsch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zuv's Issues

switch to ZUGFeRD 2 schematron files

Since ZF2 has now been officially released we can use it's schematron files.

How you could help:

  • download zugferd 2 infopaket
  • check if you can find the referenced files (the version from 2019-03-13 e.g. referred to zugferd2p0_en16931_codedb.xml in Schema/EN16931/zugferd2p0_en16931.sch and to zugferd2p0_extended_codedb.xml in Schema/EXTENDED/zugferd2p0_extended.sch): I did not find them, and I upstreamed the request to the same person who had helped me in a similar issue during the public preview
  • merge those files into one schematron each (because we deploy to one jar file and ph-shematron can not load dependencies from resources?). This can be done if you add the file in a namespace, e.g. codes:codedb, add the namespace declaration in schematron root element (xmlns:codes="http://www.mustangproject.org/") and references (e.g. ) and
  • update the reference everywhere the old document(filename) reference used to be and
  • send me a pull request

Current development snapshot does not return ZF1 errors

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.

ZUV works for CII, not for UBL

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.

  • die CII Version wird als valide akzeptiert
  • bei der UBL Variante gibt es lt. Validation-Report eine exception und die xml wird als nicht valide markiert.

Kann es sein, dass ZUV nur CII erwartert?

Gruß EUGen H.

unusable release 0.8.2?

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)

support ZUGFeRD-Extensions a.k.a. additional data

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.

'@schemeID' is not allowed

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?

nullpointerexception in shaded JAR (for schematron)

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?

Issue writing A3

Allegedly the 505 ZF1 sample does not validate on validator.zugferd.org

Attribute currencyID should be optional

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?

ZUGFeRD:mustang:jar:1.6.1 is missing, no dependency information available

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

Does not work w/ Java 9

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

consider french schematrons

check if FNFE factur-x1.0.05 schematrons are identical, and if not, check if they should be used instead of the zugferd ones

performance

currently the xslt1 based validation takes 10-12 minutes per file, with xslt2 it was 10-20 seconds only

Official FNFE Factur-X samples do not validate

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>

validate xmp schema

apart from xml and pdf the validity of the xmp schema pdfa extension should be checked

Translate schematron messages

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

BUG? : ExchangedDocument / Name not supported?!

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!

zugferd_2p1_BASIC_Einfach-factur-x_Result.zip

BR-CO-15 error thrown despite correct totals

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>

better output of the results

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

rounding errors when applying schematron

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

AssociatedDocumentLineDocument is incorrectly expected with BASIC profile

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.

validate directories

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.

Check why files does not validate

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:

  • check if the issue vanishes with the 1.1 release of cen schematron https://github.com/CenPC434/validation/releases
    We deploy in a single jar and the schematron file uses include statements, last time it was sufficient to just copy all included files into one. if that does not help:
  • check if the issue vanishes with the new schematron files (issue #16)
  • add the file to the https://github.com/ZUGFeRD/corpus
  • extract the factur-x.xml and add a automatic test

Build update

Looks abandoned, is there a newer tool to validate zugferd?

attaching the steps I made to compile it
build.txt

Recommendation N°21 not implemented?

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

zugferd_2p0_EXTENDED_Warenrechnung.pdf

ZUGFeRD easy sample does not validate

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>

schematron(?) errors if ram:TaxCurrencyCode is present?

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

Better output of passed XML checks

Marcus Hartmann requested that ZUV should also indicate how many and, if meaningful, which Schematron rules were successfully applied.

Schema kann nicht als Resource geladen werden.

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.

Exception thrown and error reported by VeraPDF

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

ReturnCode 255

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

2urn:cen.eu:en16931:20178308528

root@VM1:/opt/mydir/errors/gcnqe9ecmg6wkwuzwcz3bsaqaxupqctrknx9t1h7# echo $?
255`

Am I making a mistake?

in.txt

commandline to apply xpath

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

Rundungsproblem Geschäftregel BR-CO-17

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).

factur-x_fail.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.