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
202 stars 113 forks source link

Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location #305

Open wq9578 opened 1 year ago

wq9578 commented 1 year ago

After some time of experimenting with the mustang-cli with good results now PDFs are produced (action combine) that do not conform to the standard. Adobe Acrobat (not Adobe Acrobat Reader) reports problems in the preflight despite passing verification checks of other tools. See the screenshots for the detailed error message. Other test files (e.g., from third parties) are not affected. The most similar error reports I found on the internet are: https://www.w3.org/2011/prov/track/issues/480 https://github.com/FriendsOfSymfony/FOSRestBundle/issues/685#issuecomment-35713416 I am using macOS 12.6.2 with the Java provided by homebrew.

Screenshot 1: Screenshot1

Screenshot 2: Screenshot2

jstaerk commented 1 year ago

Hi,

I didn't know Adobe had a ZUGFeRD Validator. Does it pass our validator? --action validate or the online version at zugferd-community...

And could you please send your file? Ideally including the source pdf. If problematic and in particular if you want to anonymize it maybe the XML suffices.

kind regards Jochen

wq9578 ***@***.***> hat am 11.01.2023 02:48 geschrieben:

After some time of experimenting with the mustang-cli with good results now PDFs are produced (action combine) that do not conform to the standard.
Adobe Acrobat (not Adobe Acrobat Reader) reports problems in the preflight despite passing verification checks of other tools.
See the screenshots for the detailed error message.
Other test files (e.g., from third parties) are not affected.
The most similar error reports I found on the internet are:
https://www.w3.org/2011/prov/track/issues/480
FriendsOfSymfony/FOSRestBundle#685 (comment) https://github.com/FriendsOfSymfony/FOSRestBundle/issues/685#issuecomment-35713416
I am using macOS 12.6.2 with the Java provided by homebrew.

Screenshot 1:
[Screenshot1] https://user-images.githubusercontent.com/121522862/211698012-ecc03a68-ced1-4364-a6ad-87ed1b28e5ca.jpg

Screenshot 2:
[Screenshot2] https://user-images.githubusercontent.com/121522862/211698017-8dfcf892-541e-4a30-87bb-b65097efd3a4.jpg

—
Reply to this email directly, view it on GitHub https://github.com/ZUGFeRD/mustangproject/issues/305 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6H3YUQ3SFRH2SXND7ZYRDWRYGMXANCNFSM6AAAAAATXPA2NU .
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
wq9578 commented 1 year ago

Enclosed please find all files for a MWE (producing the same error message). The XML content was taken from https://www.mustangproject.org/files/MustangGnuaccountingBeispielRE-20201121_508.pdf. A direct binary comparison might fail due to different spacing (reformatting).

Results

It passed both checks (CLI and online), see below.

Terminal command: java -jar Mustang-CLI-2.6.0.jar --action validate --source ZUGFeRD.pdf Result: valid

Online at https://www.zugferd-community.net/de/dashboard/validation:

Das ZUGFeRD-PDF ist valide.
Profile: PDF/A-3U validation profile
Statement: PDF file is compliant with Validation Profile requirements.
Signature: Mustang
Passed checks: 3698
Passed rules: 126
Failed checks: 0
Failed rules: 0

Das ZUGFeRD-xml ist valide.
Profile: urn:cen.eu:en16931:2017

Files

Produced PDF (with encapsulated XML): ZUGFeRD.pdf

Source PDF: ZUGFeRD_part.pdf

XML:

<?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
  <rsm:ExchangedDocumentContext>
    <ram:GuidelineSpecifiedDocumentContextParameter>
      <ram:ID>urn:cen.eu:en16931:2017</ram:ID>
    </ram:GuidelineSpecifiedDocumentContextParameter>
  </rsm:ExchangedDocumentContext>
  <rsm:ExchangedDocument>
    <ram:ID>RE-20201121/508</ram:ID>
    <ram:TypeCode>380</ram:TypeCode>
    <ram:IssueDateTime>
      <udt:DateTimeString format="102">20201121</udt:DateTimeString>
    </ram:IssueDateTime>
  </rsm:ExchangedDocument>
  <rsm:SupplyChainTradeTransaction>
    <ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:LineID>1</ram:LineID>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct>
        <ram:Name>Design (hours)</ram:Name>
        <ram:Description>Of a sample invoice</ram:Description>
      </ram:SpecifiedTradeProduct>
      <ram:SpecifiedLineTradeAgreement>
        <ram:GrossPriceProductTradePrice>
          <ram:ChargeAmount>160.0000</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="HUR">1.0000</ram:BasisQuantity>
        </ram:GrossPriceProductTradePrice>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>160.0000</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="HUR">1.0000</ram:BasisQuantity>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="HUR">1.0000</ram:BilledQuantity>
      </ram:SpecifiedLineTradeDelivery>
      <ram:SpecifiedLineTradeSettlement>
        <ram:ApplicableTradeTax>
          <ram:TypeCode>VAT</ram:TypeCode>
          <ram:CategoryCode>S</ram:CategoryCode>
          <ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>
        </ram:ApplicableTradeTax>
        <ram:SpecifiedTradeSettlementLineMonetarySummation>
          <ram:LineTotalAmount>160.00</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>
    <ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:LineID>2</ram:LineID>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct>
        <ram:Name>Ballons</ram:Name>
        <ram:Description>various colors, ~2000ml</ram:Description>
      </ram:SpecifiedTradeProduct>
      <ram:SpecifiedLineTradeAgreement>
        <ram:GrossPriceProductTradePrice>
          <ram:ChargeAmount>0.7900</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="H87">1.0000</ram:BasisQuantity>
        </ram:GrossPriceProductTradePrice>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>0.7900</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="H87">1.0000</ram:BasisQuantity>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="H87">400.0000</ram:BilledQuantity>
      </ram:SpecifiedLineTradeDelivery>
      <ram:SpecifiedLineTradeSettlement>
        <ram:ApplicableTradeTax>
          <ram:TypeCode>VAT</ram:TypeCode>
          <ram:CategoryCode>S</ram:CategoryCode>
          <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
        </ram:ApplicableTradeTax>
        <ram:SpecifiedTradeSettlementLineMonetarySummation>
          <ram:LineTotalAmount>316.00</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>
    <ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:LineID>3</ram:LineID>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct>
        <ram:Name>Hot air „heiße Luft“ (litres)</ram:Name>
        <ram:Description/>
      </ram:SpecifiedTradeProduct>
      <ram:SpecifiedLineTradeAgreement>
        <ram:GrossPriceProductTradePrice>
          <ram:ChargeAmount>0.0250</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="LTR">1.0000</ram:BasisQuantity>
        </ram:GrossPriceProductTradePrice>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>0.0250</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="LTR">1.0000</ram:BasisQuantity>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="LTR">800.0000</ram:BilledQuantity>
      </ram:SpecifiedLineTradeDelivery>
      <ram:SpecifiedLineTradeSettlement>
        <ram:ApplicableTradeTax>
          <ram:TypeCode>VAT</ram:TypeCode>
          <ram:CategoryCode>S</ram:CategoryCode>
          <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
        </ram:ApplicableTradeTax>
        <ram:SpecifiedTradeSettlementLineMonetarySummation>
          <ram:LineTotalAmount>20.00</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>
    <ram:ApplicableHeaderTradeAgreement>
      <ram:BuyerReference>04011000-1234512345-06</ram:BuyerReference>
      <ram:SellerTradeParty>
        <ram:Name>Bei Spiel GmbH</ram:Name>
        <ram:DefinedTradeContact>
          <ram:PersonName>Herr Müller</ram:PersonName>
          <ram:TelephoneUniversalCommunication>
            <ram:CompleteNumber>+49 30 12345678-90</ram:CompleteNumber>
          </ram:TelephoneUniversalCommunication>
          <ram:EmailURIUniversalCommunication>
            <ram:URIID>sales@beispiel.com</ram:URIID>
          </ram:EmailURIUniversalCommunication>
        </ram:DefinedTradeContact>
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>12345</ram:PostcodeCode>
          <ram:LineOne>Ecke 12</ram:LineOne>
          <ram:CityName>Stadthausen</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
        <ram:SpecifiedTaxRegistration>
          <ram:ID schemeID="VA">DE136695976</ram:ID>
        </ram:SpecifiedTaxRegistration>
      </ram:SellerTradeParty>
      <ram:BuyerTradeParty>
        <ram:ID>2</ram:ID>
        <ram:Name>Theodor Est</ram:Name>
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>88802</ram:PostcodeCode>
          <ram:LineOne>Bahnstr. 42</ram:LineOne>
          <ram:CityName>Spielkreis</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
      </ram:BuyerTradeParty>
    </ram:ApplicableHeaderTradeAgreement>
    <ram:ApplicableHeaderTradeDelivery>
      <ram:ActualDeliverySupplyChainEvent>
        <ram:OccurrenceDateTime>
          <udt:DateTimeString format="102">20201110</udt:DateTimeString>
        </ram:OccurrenceDateTime>
      </ram:ActualDeliverySupplyChainEvent>
    </ram:ApplicableHeaderTradeDelivery>
    <ram:ApplicableHeaderTradeSettlement>
      <ram:PaymentReference>RE-20201121/508</ram:PaymentReference>
      <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
      <ram:SpecifiedTradeSettlementPaymentMeans>
        <ram:TypeCode>42</ram:TypeCode>
        <ram:Information>Bank transfer</ram:Information>
        <ram:PayeePartyCreditorFinancialAccount>
          <ram:IBANID>DE88200800000970375700</ram:IBANID>
          <ram:AccountName>Max Mustermann</ram:AccountName>
        </ram:PayeePartyCreditorFinancialAccount>
        <ram:PayeeSpecifiedCreditorFinancialInstitution>
          <ram:BICID>COBADEFFXXX</ram:BICID>
        </ram:PayeeSpecifiedCreditorFinancialInstitution>
      </ram:SpecifiedTradeSettlementPaymentMeans>
      <ram:ApplicableTradeTax>
        <ram:CalculatedAmount>11.20</ram:CalculatedAmount>
        <ram:TypeCode>VAT</ram:TypeCode>
        <ram:BasisAmount>160.00</ram:BasisAmount>
        <ram:CategoryCode>S</ram:CategoryCode>
        <ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>
      </ram:ApplicableTradeTax>
      <ram:ApplicableTradeTax>
        <ram:CalculatedAmount>63.84</ram:CalculatedAmount>
        <ram:TypeCode>VAT</ram:TypeCode>
        <ram:BasisAmount>336.00</ram:BasisAmount>
        <ram:CategoryCode>S</ram:CategoryCode>
        <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
      </ram:ApplicableTradeTax>
      <ram:SpecifiedTradePaymentTerms>
        <ram:Description>Zahlbar ohne Abzug bis 12.12.2020</ram:Description>
        <ram:DueDateDateTime>
          <udt:DateTimeString format="102">20201212</udt:DateTimeString>
        </ram:DueDateDateTime>
      </ram:SpecifiedTradePaymentTerms>
      <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
        <ram:LineTotalAmount>496.00</ram:LineTotalAmount>
        <ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>
        <ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>
        <ram:TaxBasisTotalAmount>496.00</ram:TaxBasisTotalAmount>
        <ram:TaxTotalAmount currencyID="EUR">75.04</ram:TaxTotalAmount>
        <ram:GrandTotalAmount>571.04</ram:GrandTotalAmount>
        <ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount>
        <ram:DuePayableAmount>571.04</ram:DuePayableAmount>
      </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    </ram:ApplicableHeaderTradeSettlement>
  </rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
jstaerk commented 1 year ago

https://www.zugferd-community.net/de/dashboard/validation is using Mustang. Maybe the Adobe validator is wrong or only supports v1? Does it give any details?