atgp / factur-x

PHP library to manage your Factur-X / ZUGFeRD 2.0 PDF invoices files
MIT License
87 stars 22 forks source link

Valid example Xml files #19

Closed thierryler closed 1 year ago

thierryler commented 1 year ago

Can you provide valid example xml files for each profile? Maybe in the "test" folder.

lucas-gp commented 1 year ago

Hello @thierryler , You can find every examples needed here : https://fnfe-mpe.org/factur-x/ Maybe should I add it to readme ?

thierryler commented 1 year ago

Actually, i've used one from there but it seems not valid in the lib.

lucas-gp commented 1 year ago

Could you give me an example of invalid XML with the lib please ?

thierryler commented 1 year ago

Here is the file I use. I've got it from a zip file on the website you proposed.

<?xml version='1.0' encoding='UTF-8' ?>
            <!-- THIERRY -->
<!-- English disclaimer below.-->
<!--Nutzungsrechte 
ZUGFeRD Datenformat Version 2.2.0, 14.02.2022
Beispiel Version 14.02.2022

Zweck des Forums elektronisch Rechnung Deutschland, welches am 31. März 2010 unter der Arbeitsgemeinschaft für 
wirtschaftliche Verwaltung e. V. gegründet wurde, ist u. a. die Schaffung und Spezifizierung eines offenen Datenformats 
für strukturierten elektronischen Datenaustausch auf der Grundlage offener und nicht diskriminierender, standardisierter 
Technologien („ZUGFeRD Datenformat“).

Das ZUGFeRD Datenformat wird nach Maßgabe des FeRD sowohl Unternehmen als auch der öffentlichen Verwaltung 
frei zugänglich gemacht. Hierfür bietet FeRD allen Unternehmen und Organisationen der öffentlichen Verwaltung eine 
Lizenz für die Nutzung des urheberrechtlich geschützten ZUGFeRD-Datenformats zu fairen, sachgerechten und nicht 
diskriminierenden Bedingungen an.

Die Spezifikation des FeRD zur Implementierung des ZUGFeRD Datenformats ist in ihrer jeweils geltenden Fassung 
abrufbar unter www.ferd-net.de.

Im Einzelnen schließt die Nutzungsgewährung ein: 
=====================================

FeRD räumt eine Lizenz für die Nutzung des urheberrechtlich geschützten ZUGFeRD Datenformats in der jeweils 
geltenden und akzeptierten Fassung (www.ferd-net.de) ein. 
Die Lizenz beinhaltet ein unwiderrufliches Nutzungsrecht einschließlich des Rechts der Weiterentwicklung, 
Weiterbearbeitung und Verbindung mit anderen Produkten.
Die Lizenz gilt insbesondere für die Entwicklung, die Gestaltung, die Herstellung, den Verkauf, die Nutzung oder 
anderweitige Verwendung des ZUGFeRD Datenformats für Hardware- und/oder Softwareprodukte sowie sonstige 
Anwendungen und Dienste. 
Diese Lizenz schließt nicht die wesentlichen Patente der Mitglieder von FeRD ein. Als wesentliche Patente sind Patente 
und Patentanmeldungen weltweit zu verstehen, die einen oder mehrere Patentansprüche beinhalten, bei denen es sich um 
notwendige Ansprüche handelt. Notwendige Ansprüche sind lediglich jene Ansprüche der Wesentlichen Patente, die durch 
die Implementierung des ZUGFeRD Datenformats notwendigerweise verletzt würden. 
Der Lizenznehmer ist berechtigt, seinen jeweiligen Konzerngesellschaften ein unbefristetes, weltweites, nicht übertragbares, 
unwiderrufliches Nutzungsrecht einschließlich des Rechts der Weiterentwicklung, Weiterbearbeitung und Verbindung mit 
anderen Produkten einzuräumen. 

Die Lizenz wird kostenfrei zur Verfügung gestellt. 

Außer im Falle vorsätzlichen Verschuldens oder grober Fahrlässigkeit haftet FeRD weder für Nutzungsausfall, entgangenen 
Gewinn, Datenverlust, Kommunikationsverlust, Einnahmeausfall, Vertragseinbußen, Geschäftsausfall oder für Kosten, 
Schäden, Verluste oder Haftpflichten im Zusammenhang mit einer Unterbrechung der Geschäftstätigkeit, noch für konkrete, 
beiläufig entstandene, mittelbare Schäden, Straf- oder Folgeschäden und zwar auch dann nicht, wenn die Möglichkeit der 
Kosten, Verluste bzw. Schäden hätte normalerweise vorhergesehen werden können.-->

 <!--Right of use 
ZUGFeRD Data format version 2.2.0, February 14th, 2022

The purpose of the Forum elektronische Rechnung Deutschland (FeRD), which was founded on March 31, 2010 under the 
umbrella of Arbeitsgemeinschaft für wirtschaftliche Verwaltung e. V., is, among other things, to create and specify an 
open data format for structured electronic data exchange on the basis of open and non discriminatory, standardised 
technologies ("ZUGFeRD data format").

The ZUGFeRD data format is used by both companies and public administration according to the FeRD 
made freely accessible. For this purpose FeRD offers all companies and organisations of the public administration a 
License to use the copyrighted ZUGFeRD data format in a fair, appropriate and non 
discriminatory conditions.

The specification of the FeRD for the implementation of the ZUGFeRD data format is, in its currently valid version 
available at www.ferd-net.de.

In detail, the grant of use includes 
=====================================

FeRD grants a license for the use of the copyrighted ZUGFeRD data format in the respective 
valid and accepted version (www.ferd-net.de). 
The license includes an irrevocable right of use including the right of further development, 
Further processing and connection with other products.
The license applies in particular to the development, design, production, sale, use or 
other use of the ZUGFeRD data format for hardware and/or software products and other 
applications and services. 
This license does not include the essential patents of the members of FeRD. The essential patents are patents 
and patent applications worldwide which contain one or more claims that are 
necessary claims. Necessary claims are only those claims of the essential patents which are 
the implementation of the ZUGFeRD data format would necessarily be violated. 
The Licensee is entitled to provide its respective group companies with an unlimited, worldwide, non-transferable, 
irrevocable right of use including the right of further development, further processing and connection with 
other products. 

The license is provided free of charge. 

Except in the case of intentional fault or gross negligence, FeRD is not liable for loss of use, loss of 
Profit, loss of data, loss of communication, loss of revenue, loss of contracts, loss of business or for costs 
damages, losses or liabilities in connection with an interruption of business, nor for concrete, 
incidental, indirect, punitive or consequential damages, even if the possibility of 
costs, losses or damages could normally have been foreseen.-->

<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
  <rsm:ExchangedDocumentContext>
    <ram:GuidelineSpecifiedDocumentContextParameter>
      <ram:ID>urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic</ram:ID>
    </ram:GuidelineSpecifiedDocumentContextParameter>
  </rsm:ExchangedDocumentContext>
  <rsm:ExchangedDocument>
    <ram:ID>471102</ram:ID>
    <ram:TypeCode>380</ram:TypeCode>
    <ram:IssueDateTime>
      <udt:DateTimeString format="102">20200305</udt:DateTimeString>
    </ram:IssueDateTime>
    <ram:IncludedNote>
      <ram:Content>Rechnung gemäß Bestellung vom 01.03.2020.</ram:Content>
    </ram:IncludedNote>
    <ram:IncludedNote>
      <ram:Content>Lieferant GmbH               
Lieferantenstraße 20                
80333 München               
Deutschland             
Geschäftsführer: Hans Muster
Handelsregisternummer: H A 123
      </ram:Content>
    </ram:IncludedNote>
    <ram:IncludedNote>
      <ram:Content>Unsere GLN: 4000001123452
Ihre GLN: 4000001987658
Ihre Kundennummer: GE2020211

Zahlbar innerhalb 30 Tagen netto bis 04.04.2020, 3% Skonto innerhalb 10 Tagen bis 15.03.2020.
      </ram:Content>
    </ram:IncludedNote>
  </rsm:ExchangedDocument>
  <rsm:SupplyChainTradeTransaction>
    <ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:LineID>1</ram:LineID>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct>
        <ram:GlobalID schemeID="0160">4012345001235</ram:GlobalID>

        <ram:Name>GTIN: 4012345001235
Unsere Art.-Nr.: TB100A4
Trennblätter A4
        </ram:Name>
      </ram:SpecifiedTradeProduct>
            <ram:SpecifiedLineTradeAgreement>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>9.90</ram:ChargeAmount>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="H87">20.0000</ram:BilledQuantity>
      </ram:SpecifiedLineTradeDelivery>
      <ram:SpecifiedLineTradeSettlement>
       <ram:ApplicableTradeTax>
       <ram:TypeCode>VAT</ram:TypeCode>
       <ram:CategoryCode>S</ram:CategoryCode>
          <ram:RateApplicablePercent>19</ram:RateApplicablePercent>
        </ram:ApplicableTradeTax>
        <ram:SpecifiedTradeSettlementLineMonetarySummation>
          <ram:LineTotalAmount>198.00</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>
    <ram:ApplicableHeaderTradeAgreement>
      <ram:SellerTradeParty>
        <ram:Name>Lieferant GmbH</ram:Name>
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>80333</ram:PostcodeCode>
          <ram:LineOne>Lieferantenstraße 20</ram:LineOne>
          <ram:CityName>München</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
        <ram:SpecifiedTaxRegistration>
          <ram:ID schemeID="FC">201/113/40209</ram:ID>
        </ram:SpecifiedTaxRegistration>
        <ram:SpecifiedTaxRegistration>
          <ram:ID schemeID="VA">DE123456789</ram:ID>
        </ram:SpecifiedTaxRegistration>
      </ram:SellerTradeParty>
      <ram:BuyerTradeParty>
        <ram:Name>Kunden AG Mitte</ram:Name>
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>69876</ram:PostcodeCode>
          <ram:LineOne>Hans Muster</ram:LineOne>
          <ram:LineTwo>Kundenstraße 15</ram:LineTwo>
          <ram:CityName>Frankfurt</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
      </ram:BuyerTradeParty>
    </ram:ApplicableHeaderTradeAgreement>
    <ram:ApplicableHeaderTradeDelivery>
      <ram:ActualDeliverySupplyChainEvent>
        <ram:OccurrenceDateTime>
          <udt:DateTimeString format="102">20200305</udt:DateTimeString>
        </ram:OccurrenceDateTime>
      </ram:ActualDeliverySupplyChainEvent>
    </ram:ApplicableHeaderTradeDelivery>
    <ram:ApplicableHeaderTradeSettlement>
      <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
      <ram:ApplicableTradeTax>
        <ram:CalculatedAmount>37.62</ram:CalculatedAmount>
        <ram:TypeCode>VAT</ram:TypeCode>
        <ram:BasisAmount>198.00</ram:BasisAmount>
        <ram:CategoryCode>S</ram:CategoryCode>
        <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
      </ram:ApplicableTradeTax>
      <ram:SpecifiedTradePaymentTerms>
        <ram:DueDateDateTime>
          <udt:DateTimeString format="102">20200404</udt:DateTimeString>
        </ram:DueDateDateTime>
      </ram:SpecifiedTradePaymentTerms>
      <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
        <ram:LineTotalAmount>198.00</ram:LineTotalAmount>
        <ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>
        <ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>
        <ram:TaxBasisTotalAmount>198.00</ram:TaxBasisTotalAmount>
        <ram:TaxTotalAmount currencyID="EUR">37.62</ram:TaxTotalAmount>
        <ram:GrandTotalAmount>235.62</ram:GrandTotalAmount>
        <ram:DuePayableAmount>235.62</ram:DuePayableAmount>
      </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    </ram:ApplicableHeaderTradeSettlement>
  </rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
thierryler commented 1 year ago

Actually, it was my mistake because I was not looking at the good invoice file. Sorry.