Code Monkey home page Code Monkey logo

zugferd-csharp's Introduction

NuGet

Part of the ZUGFeRD community: https://github.com/zugferd

Sponsoring

Implementing and maintaining this library is a lot of hard work. I'm doing this in my spare time, there is no company behind developing ZUGFeRD-csharp. Support me in this work and help making this library better:

❤️ Sponsor me on GitHub

In particular, I am searching for sponsors for:

  • Complete UBL format support (reading and writing)
  • Validation using the standard XSL
  • Invoice visualization

Introduction

The ZUGFeRD library allows to create XML files as required by German electronic invoice initiative ZUGFeRD as well invoices in the successor Factur-X. One special profile of Factur-X is the German XRechnung format. The library is meant to be as simple as possible, however it is not straight forward to use as the resulting XML file contains a complete invoice in XML format. Please take a look at the ZUGFeRD-Test project to find sample creation code. This code creates the same XML file as shipped with the ZUGFeRD information package.

Relationship between the different standards

Since there are a lot of terms and standards around electronic invoices, I'd like to lay out my understanding:

  • ZUGFeRD was developed by a German initiative as a standard for electronic invoices (https://www.ferd-net.de/).
  • ZUGFeRD 2.1 is identical to the German/French cooperation Factur-X (ZUGFeRD 2.1 = Factur-X 1.0) (https://www.ferd-net.de/standards/what-is-factur-x/index.html).
  • The standard Factur-X 1.0 (respectively ZUGFeRD 2.1) is conform with the European norm EN 16931.
  • EN 16931 in turn is based on worldwide UN/CEFACT standard 'Cross Industry Invoice' (CII).
  • XRechnung as another German standard is a subset of EN 16931. It is defined by another party called KoSIT (https://www.xoev.de/). It comes with its own validation rules (https://www.ferd-net.de/standards/what-is-xrechnung/index.html).
  • This means that both Factur-X 1.0 (respectively ZUGFeRD 2.1) and XRechnung are conform with EN 16931. This does not automatically result that those invoices are per se identical
  • To achieve compatibility, ZUGFeRD 2.1.1 introduced a XRechnung reference profile to guarantee compatibility between the two sister formats

License

Subject to the Apache license http://www.apache.org/licenses/LICENSE-2.0.html

Installation

Just use nuget or Visual Studio Package Manager and download 'ZUGFeRD-csharp'.

You can find more information about the nuget package here:

NuGet

https://www.nuget.org/packages/ZUGFeRD-csharp/

Building on your own

Prerequisites:

  • Visual Studio >= 2017
  • .net Framework >= 4.6.1 (for .net Standard 2.0 support)

Open ZUGFeRD/ZUGFeRD.sln solution file. Choose Release or Debug mode and hit 'Build'. That's it.

For running the tests, open ZUGFeRD-Test/ZUGFeRD-Test.sln and run the unit tests. The tests show good cases on how to use the library.

Step-by-step guide for creating invoices

Central class for users is class InvoiceDescriptor. This class does not only allow to read and set all ZUGFeRD attributes and structures but also allows to load and save ZUGFeRD files.

However, the standard has become quite large during the recent years. So it is worthwhile to go through the creation process step by step.

Creating an invoice

InvoiceDescriptor desc = InvoiceDescriptor.CreateInvoice("471102", new DateTime(2013, 6, 5), CurrencyCodes.EUR, "GE2020211-471102");
desc.Name = "WARENRECHNUNG";
desc.ReferenceOrderNo = "AB-312";
desc.AddNote("Rechnung gemäß Bestellung Nr. 2013-471331 vom 01.03.2013.");
desc.AddNote("Es bestehen Rabatt- und Bonusvereinbarungen.", "AAK");
desc.SetBuyer("Kunden Mitte AG", "69876", "Frankfurt", "Kundenstraße 15", CountryCodes.DE, "88", new GlobalID(GlobalIDSchemeIdentifiers.GLN, "4000001123452"));
desc.AddBuyerTaxRegistration("DE234567890", TaxRegistrationSchemeID.VA);
desc.SetBuyerContact("Hans Muster");
desc.SetSeller("Lieferant GmbH", "80333", "München", "Lieferantenstraße 20", CountryCodes.DE, "88", new GlobalID(GlobalIDSchemeIdentifiers.GLN, "4000001123452"));
desc.AddSellerTaxRegistration("201/113/40209", TaxRegistrationSchemeID.FC);
desc.AddSellerTaxRegistration("DE123456789", TaxRegistrationSchemeID.VA);
desc.SetBuyerOrderReferenceDocument("2013-471331", new DateTime(2013, 03, 01));
desc.SetDeliveryNoteReferenceDocument("2013-51111", new DateTime(2013, 6, 3));
desc.ActualDeliveryDate = new DateTime(2013, 6, 3);
desc.SetTotals(202.76m, 5.80m, 14.73m, 193.83m, 21.31m, 215.14m, 50.0m, 165.14m);
desc.AddApplicableTradeTax(129.37m, 7m, TaxTypes.VAT, TaxCategoryCodes.S);
desc.AddApplicableTradeTax(64.46m, 19m, TaxTypes.VAT, TaxCategoryCodes.S);
desc.AddLogisticsServiceCharge(5.80m, "Versandkosten", TaxTypes.VAT, TaxCategoryCodes.S, 7m);
desc.SetTradePaymentTerms("Zahlbar innerhalb 30 Tagen netto bis 04.07.2013, 3% Skonto innerhalb 10 Tagen bis 15.06.2013", new DateTime(2013, 07, 04));

Optionally, to support Peppol, an electronic address can be passed:

desc.SetSellerElectronicAddress("DE123456789", ElectronicAddressSchemeIdentifiers.GermanyVatNumber);
desc.SetBuyerElectronicAddress("LU987654321", ElectronicAddressSchemeIdentifiers.LuxemburgVatNumber);

The fields are only necessary if you want to send the XRechnung via the Peppol network. A description of the fields can be found in the following documents:

https://docs.peppol.eu/edelivery/policies/PEPPOL-EDN-Policy-for-use-of-identifiers-4.1.0-2020-03-11.pdf

https://www.ferd-net.de/upload/Dokumente/FACTUR-X_ZUGFeRD_2p0_Teil1_Profil_EN16931_1p03.pdf

In Luxembourg, it has been mandatory since this year to process all invoices via Peppol:

https://gouvernement.lu/de/dossiers.gouv_digitalisation%2Bde%2Bdossiers%2B2021%2Bfacturation-electronique.html

In Germany, this has so far only been necessary for invoices in the course of a public contract from the federal government:

https://www.e-rechnung-bund.de/ubertragungskanale/peppol/

Adding line items

Handling of line ids

The library allows to operate in two modes: you can either let the library generate the line ids automatically or you can alternatively pass distinct line ids. This is helpful if you want to convert existing invoices, e.g. from ERP systems, to ZUGFeRD/ Factur-X.

To let the library create line ids, you can use:

InvoiceDescriptor desc = InvoiceDescriptor.CreateInvoice("471102", new DateTime(2013, 6, 5), CurrencyCodes.EUR, "GE2020211-471102");
desc.AddTradeLineItem("Item name", "Detail description", QuantityCodes.PCE, ....);

This will generate an invoice with trade line item numbered as '1'.

To pass pre-defined line ids, this is the way to go:

InvoiceDescriptor desc = InvoiceDescriptor.CreateInvoice("471102", new DateTime(2013, 6, 5), CurrencyCodes.EUR, "GE2020211-471102");
desc.AddTradeLineItem(lineId: "0001", "Item name", "Detail description", QuantityCodes.PCE, ....);
desc.AddTradeLineItem(lineId: "0002", "Item name", "Detail description", QuantityCodes.PCE, ....);

which will generate an invoice with two trade line items, with the first one as number '0001' and the second one as number '0002'.

Working with product characteristics

Product characteristics are used to add information for the specified trade product in the 'ApplicableProductCharacteristic' section. One trade product can have one or more product characteristics, which can contain description, value, typecode and value measurand elements.

// you can optionally add product characteristics:
desc.TradeLineItems.Add(new TradeLineItem()
{
   ApplicableProductCharacteristics = new List<ApplicableProductCharacteristic>
   {
       new ApplicableProductCharacteristic()
       {
           Description = "Description",
           Value = "Value"
       }
   }
});

Document references

The library allows to add special references to an invoice which are pretty rare but nevertheless supported:

// you can optionally add a reference to a procuring project:
desc.SpecifiedProcuringProject = new SpecifiedProcuringProject {Name = "Projekt AB-312", ID = "AB-312"};

// you can optionally reference a contract:
desc.ContractReferencedDocument = new ContractReferencedDocument {ID = "AB-312-1", Date = new DateTime(2013,1,1)};

Storing the invoice

FileStream stream = new FileStream(filename, FileMode.Create, FileAccess.Write);
desc.Save(stream, ZUGFeRDVersion.Version2, Profile.XRechnung);
stream.Flush();
stream.Close();    

Support for ZUGFeRD 1.x, ZUGFeRD 2.x

In order to load ZUGFeRD files, you call InvoiceDescriptor.Load(), passing a file path like this:

InvoiceDescriptor descriptor = InvoiceDescriptor.Load("zugferd.xml");

alternatively, you can pass an open stream object:

Stream stream = new FileStream("zugferd.xml", FileMode.Open, FileAccess.Read);
InvoiceDescriptor descriptor = InvoiceDescriptor.Load(stream);

The library will automatically detect the ZUGFeRD version of the file and parse accordingly. It will automatically be chosen which XRechnung version to use depending on the current date. The lifecycle of the stream is not influenced by the ZUGFeRD library, i.e. the library expects an open stream and will not close if after reading from it.

For saving ZUGFeRD files, use InvoiceDescriptor.Save(). Here, you can also pass a stream object:

InvoiceDescriptor descriptor = InvoiceDescriptor.CreateInvoice(......);

// fill attributes and structures

FileStream stream = new FileStream(filename, FileMode.Create, FileAccess.Write);
descriptor.Save(stream, ZUGFeRDVersion.Version1, Profile.Basic);
stream.Flush();
stream.Close();            

As you see, the library does not influence the lifecycle of the stream, i.e. it is not automatically closed by the library. Just as opening the stream, flushing and closing is the duty of the calling function.

Alternatively, you can pass a file path:

InvoiceDescriptor descriptor = InvoiceDescriptor.CreateInvoice(......);

// fill attributes and structures

descriptor.Save("zugferd.xml", ZUGFeRDVersion.Version1, Profile.Basic);          

Optionally, you can pass the ZUGFeRD version to use, default currently is version 1.x, e.g.:

InvoiceDescriptor descriptor = InvoiceDescriptor.CreateInvoice(......);

// fill attributes and structures


descriptor.Save("zugferd-v1.xml", ZUGFeRDVersion.Version1, Profile.Basic); // save as version 1.x
descriptor.Save("zugferd-v2.xml", ZUGFeRDVersion.Version2, Profile.Basic); // save as version 2.0
descriptor.Save("zugferd-v2.xml", ZUGFeRDVersion.Version21, Profile.Basic); // save as version 2.1

For reading and writing XRechnung invoices, please see below.

Support for XRechnung

In general, creating XRechnung files is straight forward and just like creating any other ZUGFeRD version and profile:

descriptor.Save("xrechnung.xml", ZUGFeRDVersion.Version21, Profile.XRechnung);

This will save the invoice as XRechnung 3.0.1 as valid from 2024/02/01.

Make sure to also add a business process which is required starting with XRechnung 3.0.1:

desc.BusinessProcess = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0";

Furthermore, XRechnung comes with some special features. One of these features is the ability to embed binary files as attachments to the xrechnung.xml document:

InvoiceDescriptor desc = _createInvoice();
byte[] data = System.IO.File.ReadAllBytes("my-calculation.xlsx");
desc.AddAdditionalReferencedDocument(
    issuerAssignedID: "calculation-sheet",
    typeCode: AdditionalReferencedDocumentTypeCode.ReferenceDocument,
    name: "Calculation as the basis for the invoice",
    attachmentBinaryObject: data,
    filename: "my-calculation.xlsx");

desc.Save("xrechnung.xml", ZUGFeRDVersion.Version21, Profile.XRechnung);            

The resulting xrechnung.xml file will then contain the calculation file content. As this is not standardized, the decision was to encode the attachments in base64. Please note that there are only few mime-types supported by the XRechnung standard. The supported mime-types are defined in BG-24 and BT-125. At the time of writing this tutorial, those are also listed in the discussion you find over here: https://projekte.kosit.org/xrechnung/xrechnung/-/issues/59

  • application/pdf
  • image/png
  • image/jpeg
  • text/csv
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • application/vnd.oasis.opendocument.spreadsheet
  • application/xml

Support for E-Reporting

For french companies, a dedicated profile exists called E-Reporting. This profile is implemented on top of XRechnung/ Factur-X. It is used when transactions are done to customers who don't make use of VAT. One example are private customers (in B2C scenarios). The other example is when selling to entities beyond France. More information can be found here: https://www.impots.gouv.fr/e-reporting-la-transmission-de-donnees-de-transaction-ladministration (French) And here: https://www.roedl.de/themen/frankreich-e-invoice-reporting-umsatzsteuer-digital (german)

Thanks to @Athilla, this profile is also supported by ZUGFeRD-csharp.

The information that is written into the invoice descriptor is identical to standard XRechnung/ Factur-X invoices, you just need to adjust the profile:

descriptor.Save("xrechnung.xml", ZUGFeRDVersion.Version21, Profile.EReporting);

This information needs to be sent to the tax authorities. Different due dates apply for implementation for different sizes of companies.

Support for profiles

The library contains support for all profiles that are supported by the ZUGFeRD formats:

Profile Version1 Version20 Version22
MINIMUM X X
BASIC WL X X
BASIC X X X
COMFORT/EN16391 X X X
XRECHNUNG X
EXTENDED X X X

Please note that version 1 implementation of the library is not strict, i.e. it will output all information available into the invoice xml, regardless of the profiles that is used. Reading various files with different profiles will generate the correct output.

If you want to write the invoice xml with a certain ZUGFeRD version and a certain profile, make sure to use the parameters of the Save method:

descriptor.Save("zugferd-v1.xml", ZUGFeRDVersion.Version1, Profile.Basic); // save as version 1.x, profile Basic
descriptor.Save("zugferd-v20.xml", ZUGFeRDVersion.Version20, Profile.Basic); // save as version 2.0, profile Basic
descriptor.Save("zugferd-v22.xml", ZUGFeRDVersion.Version22, Profile.Basic); // save as version 2.1, profile Basic
descriptor.Save("zugferd-v22-xrechnung.xml", ZUGFeRDVersion.Version22, Profile.XRechnung); // save as version 2.1, profile XRechnung

Extracting xml attachments from pdf files

I am frequently asked how to extract the ZUGFeRD/ Factur-X/ XRechnung attachment from existing PDF files.

There is a nice article on stackoverflow on how this can be achieved using itextsharp:

https://stackoverflow.com/a/6334252

and this one covers the same with itext7 which is the successor of itextsharp:

https://stackoverflow.com/a/37804285

Writing xml attachments to pdf files

It is also possible to add the xml ZUGFeRD or XRechnung attachment to pdf files using itextsharp. You find information about this here:

https://stackoverflow.com/questions/70597318/af-reference-to-file-embedded-into-a-pdf-with-itextsharp

Thanks

Links

You can find more information about ZUGFeRD here: https://www.ferd-net.de/

zugferd-csharp's People

Contributors

abdallahbeshi avatar alpini1980 avatar angrycodez avatar argollinger avatar cgiesen avatar danvy avatar dbingham-tl avatar drocx avatar heinz164 avatar hihuz avatar inabout avatar irgsmirx avatar jochenkirstaetter avatar landrix avatar manuel-lu avatar melanieveigl avatar patrick-3000 avatar petersawatzki-mggm avatar pkurz avatar skeller1 avatar stefanschmidcyanit avatar steffenstoerner avatar stephan-nowecor avatar stephanstapel avatar syslog-dw avatar tipa avatar tobiaswetzel1 avatar tomcatbb avatar trusoggy avatar wherethetimewent 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zugferd-csharp's Issues

I'd like to have version tags

Currently, there are no git version tags at all.

(And I would like to know from which version our internal fork was derived - probably this would help to get rid of some historical ballast.)

ram:BasisAmount in comfort profile

The validation of the xml says, that the ram:BasisAmount (in SpecifiedSupplyChainTradeAgreement) will not be evaluated in the comfort profile.

In previous versions the BasisAmount was not written, too.

Linebreakes in Notes

Wenn ich bei einem TradeLineItem zusätzlich zu einem Namen eine mehrzeilige Description angebe, so ist der darin enthaltene Zeilenumbruch u.U. für das Verständnis notwendig.
Derzeit wird der übergebene Text jedoch einfach direkt so ins XML gerendert, oder?
D.h. dass ein Zeilenumbruch für einen XML-Parser einfach zu einem Whitespace wird, oder ist hier ein anderer Standard definiert?

Müsste man potentiell mehrzeilige Texte nicht in ein <![CDATA[...]> einpacken?
Sollte das nicht von der Bibliothek übernommen werden?

Gruß,
Bernd

Zeilenbetrag beim Import fehlt?

Hallo,

sehe ich es richtig, dass es beim Import einer ZUGFeRD-Datei nicht möglich ist auf den Zeilenbetrag zuzugreifen?
Gemeint ist das Element mit dem XPath /rsm:CrossIndustryDocument/rsm:SpecifiedSupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedSupplyChainTradeSettlement/ram:SpecifiedTradeSettlementMonetarySummation/ram:LineTotalAmount

Gerade bei Rechnung im Basic-Profile wäre dies wichtig, da hier (zumindest im FeRD Beispiel
ZUGFeRD_1p0_BASIC_Einfach.pdf) außer Menge und Zeilenbetrag nichts enhalten ist.

Bug in last version

  1. 2.0 support is missing now. The tag to search vor are now in Reader2 but in fact is reader2 support for 2.1

  2. when I test a 2.1 XML I got the error
    "Auf eine geschlossene Datei kann nicht zugegriffen werden."
    "stream.Position = 0;" is not allow for closed streams ;)

Checking for version1 close the stream

Edit:
I transmit a file stream, not a FullPath

Forgot to remove ', false' in Line 180 of InvoiceDescriptor21Writer.cs?

In a lot of places ', false' was removed from lines like
Writer.WriteValue(_formatDate(tradeLineItem.BuyerOrderReferencedDocument.IssueDateTime.Value, false));
but not from line 180 of ZUGFeRD/InvoiceDescriptor21Writer.cs

The generated file ZUGFeRD/s2industries.ZUGFeRD.xml (in my tests, this file did not appear directly in ZUGFeRD) contains information about badly formatted XML in the following lines
53
1379

Between lines 1421 and 1422 the information, in which profiles this is availabe, is missing.

Line 1469 contains additional '///'.

Line 1539 misses a 'd'.

Line 1575 shoud read 'Quadratmeter'.

Lines 2094, 2124 and 2129 lack a non-empty summary.

*ReferencedDocument IssuerAssignedID ist im InvoiceDescriptor21Reader noch ID

Siehe z.B.:

string _deliveryNoteNo = _nodeAsString(doc.DocumentElement, "//ram:ApplicableHeaderTradeDelivery/ram:DeliveryNoteReferencedDocument/ram:ID", nsmgr);

ID wurder zu IssuerAssignedID in ZUGFeRD 2.1 bei den folgenden XML Knoten:

  • BuyerOrderReferencedDocument
  • DeliveryNoteReferencedDocument
  • AdditionalReferencedDocument
  • ContractReferencedDocument

EDIT: ebenso im Writer

SEPA-Lastschrift mit Angabe Mandatsreferenz und GläubigerID

Hallo,

erstmal vielen Dank für das Einbauen meiner Code Ergänzungen.

Mit ist gerade noch aufgefallen, dass der Writer noch keine SEPA Lastschrift mit Prenotification kann.
Könntest du das vielleicht noch zeitnah einbauen?
Alternativ würde ich mich daran versuchen.

Beispiel 37 aus der ZUGFeRD Formatbeschreibung Seite 86/131:

<ram:ApplicableSupplyChainTradeSettlement> 
... 
 <ram:PaymentReference>Rechnung Nummer 4711/2014</ram:PaymentReference> 
 <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode> 
   
 <ram:SpecifiedTradeSettlementPaymentMeans> 
  <ram:TypeCode>49</ram:TypeCode> 
  <ram:Information>Betrag wird per SEPA-Lastschrift eingezogen</ram:Information> 
  <ram:ID schemeAgencyID="DE98ZZZ09999999999">REF A-123</ram:ID> 
  <ram:PayerPartyDebtorFinancialAccount> 
   <ram:IBANID>DE21860000000086001055</ram:IBANID> 
   <ram:AccountName>Bundeskasse Halle -Darlehen-</ram:AccountName> 
  </ram:PayerPartyDebtorFinancialAccount> 
  <ram:PayerSpecifiedDebtorFinancialInstitution> 
   <ram:BICID>MARKDEF1860</ram:BICID> 
   <ram:Name>Deutsche Bundesbank -Filiale Leipzig-</ram:Name> 
  </ram:PayerSpecifiedDebtorFinancialInstitution> 
 </ram:SpecifiedTradeSettlementPaymentMeans> 
...
</ram:ApplicableSupplyChainTradeSettlement> 

DateMandatoryDateTimeType doesn't support xs:date

According to ZUGFeRD 1.0 scheme:

<xs:simpleType name="DateMandatoryDateTimeType">
    <xs:union memberTypes="xs:dateTime xs:date"/>
</xs:simpleType>

DateMandatoryDateTimeType can also be just a date, e.g. 2020-01-01.
Invoices with such dates lead to exceptions on reading.
Example:

<ram:BuyerOrderReferencedDocument>
   <ram:IssueDateTime>2013-08-01</ram:IssueDateTime>
   <ram:ID>123</ram:ID>
</ram:BuyerOrderReferencedDocument>

XRechnung missing fields

I am trying to create a XRechnung invoice, with the validator i get the error "[BR-DE-15] Das Element "Buyer reference" (BT-10) muss übermittelt werden." which is the "ram:BuyerReference" field, which is not possible to write with this library. (It's in a comment)

XRechnung: Consider modifying handling of SellerTradeParty

image

<ram:SellerTradeParty>
        <ram:GlobalID schemeID="0088">4000001123452</ram:GlobalID>
        <ram:Name>Lieferant GmbH</ram:Name>
        <ram:DefinedTradeContact />
        <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>

CurrencyID should not be present

The attribute currencyID seems to be only relevant in the extended profile. But is being written in every profile.
I switched to the Comfort/EN 16931 profile.

Errors

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:IncludedSupplyChainTradeLineItem[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedLineTradeAgreement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:GrossPriceProductTradePrice[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:ChargeAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:IncludedSupplyChainTradeLineItem[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedLineTradeAgreement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:NetPriceProductTradePrice[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:ChargeAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:IncludedSupplyChainTradeLineItem[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedLineTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementLineMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:LineTotalAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:ApplicableTradeTax[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:CalculatedAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:ApplicableTradeTax[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:BasisAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:LineTotalAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:TaxBasisTotalAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:GrandTotalAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:DuePayableAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

Publish nuget package for .NET Core/Standard

When referencing this project from a .NET Core 3.1 project, the following warning is shown:

warning NU1701: Package 'ZUGFeRD-csharp 2.10.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

It seems that the project (or the NuGet build) is somehow still configured as .NET framework instead of .NET Standard/Core.

Any chance this could be sorted out?

Thanks!

InvoiceType codes missing, wrong, code duplication in writers

See "ZUGFeRD-2.1.1 - Spezifikation_TA.pdf", Page 24.

Currently, we have 380, 381, 383, 389 and 1380 which should be 384 (1380 should be kept for compatibilty, but only accepted for reading purposes).
Of the recommended codes 261, 386 and 326 are missing.
For MINIMUM and BASIC WL profiles, 751 is required (in Germany).
The given UNTDID 1001 subset contains many more coders which should be supported.

_translateInvoiceType and _encodeInvoiceType should be handled like other enumerations instead of being copied to each InvoiceDescriptor_Writer.

Parts of those other EnumExtentions are ugly enough.

Instead of creating an EnumToString function, which in turn doesn't do anything else than ToString with g format which itself is just the default for a plain ToString, one should just use ToString directly.

Some Enums do not set Unkown = 0, which is a bad thing.
The CountryCodes should have their numeric value attached.
SubjectCodes should also be updated accoring to the documentation for 2.1.1.

Eine Assembly mit starkem Namen ist erforderlich. (Ausnahme von HRESULT: 0x80131044)

Hallo,

ich habe das ZUGFeRD Nuget Paket von Version 2.6 auf Version 2.7 in meinem Projekt aktualisiert.
Seid dem bekomme ich folgende Fehlermeldung:

Die Datei oder Assembly "s2industries.ZUGFeRD, Version=2.7.0.0, Culture=neutral, PublicKeyToken=null" oder eine Abhängigkeit davon wurde nicht gefunden. Eine Assembly mit starkem Namen ist erforderlich. (Ausnahme von HRESULT: 0x80131044)

Die DLL hat seid Version 2.7 auch keinen Strong Name mehr.

zugferd

Ist dies so gewollt?

Error BR-21 and BR25 See Comment AW, Name and LineID should have a value !

image

   public void addTradeLineCommentItem(string comment)
    {
        TradeLineItem item = new TradeLineItem()
        {
            //AW
            Name="ComentItem",

            AssociatedDocument = new ZUGFeRD.AssociatedDocument(),
            
            GrossUnitPrice = 0m,
            NetUnitPrice= 0m,
            BilledQuantity = 0m
        };

        item.AssociatedDocument.Notes.Add(new Note(
            content: comment,
            subjectCode: SubjectCodes.Unknown,
            contentCode: ContentCodes.Unknown
        ));

        //AW
        item.AssociatedDocument.LineID=0;

        this.TradeLineItems.Add(item);
    } // !addTradeLineCommentItem()

ZUGFeRD 2.0 und Profil EN16931 (XRechnung)

Hallo,

planst du eventuell schon das ZUGFeRD Format 2.0 zu unterstützen?
Neu ist unter anderem ein neues Profil EN16931.
Das Comfort Profil wurde zum Profil EN16931 umbenannt und erweitert.

Dieses ist identisch mit dem XRechnung Standard. Somit hätte man mit einer Schnittstelle zwei Standards unterstützt.
XRechnung wird ab 2020 für diverse öffentlichen Verwaltungen als Pflicht vorgeschrieben.
Bei XRechnung wird nur das XML versendet ohne PDF Datei.

Was ist der Unterschied zwischen ZUGFeRD 2.0 und der XRechnung und worin genau liegt hier der Vorteil von ZUGFeRD 2.0?
Was ist der Unterschied zwischen „ZUGFeRD Version 1“ und „ZUGFeRD Version 2"?

Implement 2.1

This is the starting tu discuss the needed changes for 2.1

Dieses ist der Start um die nötigen Anpassungen für 2.1 zu diskutieren.

ZUGFeRD Community

FYI:

We just forked the project to the @ZUGFeRD Community. We are building up a cross Open Source community that will promote ZUGFeRD projects.

We will communicate more details in the next weeks.

QuantityCodes nicht vollständig

Hallo zusammen,
erstmal Glückwunsch zu diesem tollen Projekt!

Ist es Absicht das als QuantityCode nur Unknown, C62, KGM, MTK angeboten werden?
Die Liste sollte um folgende Werte ergänzt werden: DAY, HAR, HUR, KTM, KWH, LS, LTR, MIN, MMK, MMT, MTQ, MTR, NAR, NPR, P1, SET, TNE, WEE
Diese Einheiten sind zumindest in der offiziellen ZUGFeRD Codeliste enthalten.

PaymentMean TypeCodes

So i got to test again, new version looks promising.
Now i noticed the typecodes for the paymentmeans are wrong (v2.1 haven't tested other versions).
According to the documentation possible values are:

Code Type
10 Bargeld
20 Scheck
30 Überweisung
42 Payment to bank account
48 Kartenzahlung
49 Lastschrift
57 Dauerauftrag
58 SEPA Credit Transfer
59 SEPA Direct Debit
97 Report

Validierung

Hallo,
wurden die generierten Daten validiert?
Habe meine generierten Dateien mal auf dieser Seite getestet: https://www.din-zugferd-validation.org
Ergebnis: Sehr viele Fehler im Bereich von (fehlenden) Namespaces und auch fehlende Elemente.
ValidationResult.txt

Die strukur enspricht an vielen Stellen auch nicht den Beispiel dateien von Zugferd und als sich auch nicht mit deren xsd validieren.

Hat dies auch schon jemand anderes beobachten können, bzw. hat eine Lösung parat?
Ansonsten bemühe ich mich um einen Hotfix...

Rule BR-S-02 and BR-CO-26 throw an error even though BT-31 is present

grafik

So i'm receiving these errors, even though i have the field BT-31 present, do i need the other fields?

  <ram:SellerTradeParty>
        <ram:Name>Company Name</ram:Name>
        <ram:DefinedTradeContact>
          <ram:PersonName>Person</ram:PersonName>
          <ram:TelephoneUniversalCommunication>
            <ram:CompleteNumber>01234567890</ram:CompleteNumber>
          </ram:TelephoneUniversalCommunication>
          <ram:EmailURIUniversalCommunication>
            <ram:URIID>[email protected]</ram:URIID>
          </ram:EmailURIUniversalCommunication>
        </ram:DefinedTradeContact>
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>00000</ram:PostcodeCode>
          <ram:LineOne>Street 12</ram:LineOne>
          <ram:CityName>Any City</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
        <ram:SpecifiedTaxRegistration>
          <ram:ID schemeID="VA">TaxRegistration1</ram:ID>
        </ram:SpecifiedTaxRegistration>
      </ram:SellerTradeParty>

Support for ZUGFeRD 2.1

Hello,

ZUGFeRD 2.1 is out since 24.03.2020.
Actually it is not supported by ZUGFeRD-csharp and InvoiceDescriptor.Load(zugferdFile); returns an empty descriptor with Type = Unknown.
Do you have any plans to support this ZUGFeRD Version?

XRechnung

Hallo zusammen,

ich habe mir den Source Code inkl. Test Project runtergeladen.
Wenn ich die Rechnung mit:
string path = "output.xml";
InvoiceDescriptor desc = _createInvoice();
desc.Save(path, ZUGFeRDVersion.Version21, Profile.XRechnung);
speicher, bekomme ich mit jedem Validator Fehlermeldung !

Was mache ich da falsch ?
Man kann doch XRechnung erstellen, oder ?

Oder muss ich warten bis V2.1.1 kommt ?

Invalid xml according to online validator

Hi Stephan,
thanks for this library, i am trying to get it to work.
But it seems i can't generate a xml schema that satisfies the online validator: Vaildator

I always get an error:
schema validation fails:org.xml.sax.SAXParseException; lineNumber: 11; 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":IssueDateTime}' is expected.

Even though "IssueDateTime" is in my xml schema.. Maybe it has to be in another order?

XRechnung: ItemName for comment lines

image

Example:

<ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:IncludedNote>
          <ram:Content>Wir erlauben uns Ihnen folgende Positionen aus der Lieferung Nr. 2013-51112 in Rechnung zu stellen:</ram:Content>
        </ram:IncludedNote>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct />
      <ram:SpecifiedLineTradeAgreement>
        <ram:GrossPriceProductTradePrice>
          <ram:ChargeAmount>0.00</ram:ChargeAmount>
        </ram:GrossPriceProductTradePrice>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>0.00</ram:ChargeAmount>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="Unknown">0.00</ram:BilledQuantity>
      </ram:SpecifiedLineTradeDelivery>
      <ram:SpecifiedLineTradeSettlement>
        <ram:ApplicableTradeTax>
          <ram:TypeCode>VAT</ram:TypeCode>
          <ram:CategoryCode>A</ram:CategoryCode>
          <ram:RateApplicablePercent>0.00</ram:RateApplicablePercent>
        </ram:ApplicableTradeTax>
        <ram:SpecifiedTradeSettlementLineMonetarySummation>
          <ram:LineTotalAmount>0.00</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>

Support for ZUGFeRD 2

Hi,
In Your solution, there are test files from ZUGFeRD 2.0 but Your solution seems to not support it.
In the description, I see that You have information that the readers are working with standards 1 and 2.
Question do You plan to implement readers for these standards or this is a bug?

Intellisense Kommentare für NuGet package

Hi.

Vielen Dank für die tolle Arbeit die du hier geleistet hast.

Ich hab die neuste Version vom NuGet package in Visual Studio heruntergeladen.
Kommentare aus dem Quelltext werden jedoch in Intellisense nicht angezeigt.
Diese sind aber super praktisch um die Bedeutung eines Enums zu verstehen z.B. TaxRegistrationSchemeID.VA

Es scheint das die XML Dokumentation nicht mit ausgegeben wird.
https://stackoverflow.com/questions/43305578/show-comments-in-nuget-package

Wäre toll wenn du diese noch hinzufügen könntest.

Danke!

Schöne Grüße
Michel

Invoice total amount wrong?

      <error type="4" location="/*[local-name()='CrossIndustryInvoice' and namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']/*[local-name()='SupplyChainTradeTransaction' and namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']/*[local-name()='ApplicableHeaderTradeSettlement' and namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100']/*[local-name()='SpecifiedTradeSettlementHeaderMonetarySummation' and namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100']" criterion="(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]))">Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).</error>  
      <error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="(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]))">[BR-CO-15]-Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).</error> 

The error is pretty clear, but the generated xml, displays the right amount.

<?xml version="1.0" encoding="utf-8"?>
<rsm:CrossIndustryInvoice xmlns:a="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:10" 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</ram:ID>
    </ram:GuidelineSpecifiedDocumentContextParameter>
  </rsm:ExchangedDocumentContext>
  <rsm:ExchangedDocument>
    <ram:ID>NUMMER2</ram:ID>
    <ram:TypeCode>380</ram:TypeCode>
    <ram:IssueDateTime>
      <udt:DateTimeString format="102">20200706</udt:DateTimeString>
    </ram:IssueDateTime>
    <ram:IncludedNote>
      <ram:Content>Rechnung NUMMER2 vom 06.07.2020 00:00:00.</ram:Content>
    </ram:IncludedNote>
  </rsm:ExchangedDocument>
  <rsm:SupplyChainTradeTransaction>
    <ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:LineID>1</ram:LineID>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct>
        <ram:Name>Rechnungsbetrag</ram:Name>
      </ram:SpecifiedTradeProduct>
      <ram:SpecifiedLineTradeAgreement>
        <ram:GrossPriceProductTradePrice>
          <ram:ChargeAmount>24245.80</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="LS">1.00</ram:BasisQuantity>
        </ram:GrossPriceProductTradePrice>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>20374.62</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="LS">1.00</ram:BasisQuantity>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="LS">1.00</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>20374.62</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>
    <ram:ApplicableHeaderTradeDelivery />
    <ram:ApplicableHeaderTradeSettlement>
      <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
      <ram:ApplicableTradeTax>
        <ram:CalculatedAmount>3871.18</ram:CalculatedAmount>
        <ram:TypeCode>VAT</ram:TypeCode>
        <ram:BasisAmount>20374.62</ram:BasisAmount>
        <ram:CategoryCode>S</ram:CategoryCode>
        <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
      </ram:ApplicableTradeTax>
      <ram:SpecifiedTradePaymentTerms>
        <ram:Description>Zahlbar innerhalb 30 Tagen netto bis 05.08.2020 00:00:00</ram:Description>
        <ram:DueDateDateTime>
          <udt:DateTimeString format="102">20200805</udt:DateTimeString>
        </ram:DueDateDateTime>
      </ram:SpecifiedTradePaymentTerms>
      <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
        <ram:LineTotalAmount>20374.62</ram:LineTotalAmount>
        <ram:TaxBasisTotalAmount>20374.62</ram:TaxBasisTotalAmount>
        <ram:TaxTotalAmount>3871.18</ram:TaxTotalAmount>
        <ram:GrandTotalAmount>24245.80</ram:GrandTotalAmount>
        <ram:DuePayableAmount>24245.80</ram:DuePayableAmount>
      </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    </ram:ApplicableHeaderTradeSettlement>
  </rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>

The fields BT-109 + BT-110 equal the sum (BT-112), i am not sure where the problem is.

ErrorState and message

Actual I got a result or not.
If not, there ist no info why!

I like to have a error flag perhaps IsError and in this case an ErrorMessage

Example:
We check the version of the XML but for some reason we can#t get the correct version.

actual the result is not filled or empty.
In this case we can set IsError to true and ErrorMessage to "not supported version"

price unit not available...?

Hello!
excellent library for creating ZUGFeRD XML files.
unfortunately i cant find a way to set the price unit correct.

i can set the gross/net unitprice and the billedquantity. if i have a Price 3814 Eur for 1000 pieces = 3,814 for ONE Piece. the price in the XML file always will by 3,81 - if i calculate the Prices in the XML file the quantity * Piece-price is not the correct total amout.

is it possible to use price-units and i only file no way?

many thanks for your help!

regards,
Chris

Profile.Basic Beispiel

Hallo,

erstmal vielen Dank für die Umsetzung dieses tollen Projekts.

Könntest du vielleicht noch, wenn es möglich wäre ein Beispiel für das Profile.Basic ergänzen.

Hardcoded path to documentation XML file

ZUGFeRD/ZUGFeRD.csproj references DocumentationFile E:\develop\ZUGFeRD\s2industries.ZUGFeRD.xml.
I don't have a drive E:.
Issue can be fixed by unsing GenerateDocumentationFile instead and setting this to true (and moving this to the main PropertyGroup without conditions.
I've fixed this in my fork.

VAT Reverse Charge

Hallo,
erst einmal vielen, vielen Dank für die tolle Arbeit.
Können Sie bitte für Netto-Rechnungen bei VAT category code (BT-119) den Code AE (VAT Reverse Charge) hinzufügen?
Und dann in VAT exemption reason text (BT-120) den Text „Umkehrung der Steuerschuldnerschaft“?

Danke und Grüße
Alexander Wittwer

Help with TradeLineItem / basis_quantity != 1

Hello all,
I am trying to generate a COMFORT level zugferd xml, using your library.
I have a time-based line-item whose basis_quantity is defined as more than 1. Here is the example:


image


If I understand the documentation correctly, the corresponding line-item XML node (IncludedSupplyChainTradeLineItem) should be defined as following:

image

Should the unit code used in BasisQuantity be the same as the one in BilledQuantity? Or, can I use a period multiplier like it is in the PDF invoice (x0.25) which effectively has a different unit_code (not hours).

Your library multiplies the unit price and the billed quantity, but in the case where the basis_quantity is not 1, like the above, the multiplication result would be false (6 x 240,00 = 1440,00 instead of 60,00)
_total = tradeLineItem.NetUnitPrice * tradeLineItem.BilledQuantity;

Reading the specification, it is completely unclear for me if my XML representation is correct or not. So, I ask you if you have any knowledge to share regarding this?

PaymentMeansTypeCodes.cs missing

Im Repo fehlt die Datei "PaymentMeansTypeCodes.cs".
Im Projekt ist diese vorhanden. Daher ist das Projekt aktuell nicht kompilierbar.

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.