Greetings to all readers of our blog! It's been a long time since we have told you about the types of reports which can be created in Stimulsoft products. Today you'll learn about e-invoices. In this article, we'll take a closer look at this report type and:

  • Find out what it is and what it is intended for;
  • Learn how e-invoices are arranged in Germany, France, and Switzerland;
  • Tell you how to create such a report using our products.

What is the e-invoice?

An e-invoice is a form of presentation and control of transactional documents issued by trading partners to ensure and comply with the terms of trade agreements. These documents include invoices, purchase orders, debit notes, credit notes, payment terms, payment instructions, etc. They are all in electronic form, which is the main advantage of an electronic invoice over all others. The report type consists of two parts: visual for humans and structured, machine-readable for computers. The first is presented in the form of regular PDF document pages, and the second is an XML representation.

Nowadays, many companies are completely moving to e-invoicing. This automates the entire trade transaction process and reduces expenses.

Let’s learn how e-invoices are arranged in Germany, France and Switzerland, and how to create an e-invoice for these countries using our products.

E-invoices in Germany

On April 4th, 2017, a German law (E-Rechnungsgesetz) defined the legal basis for e-invoicing. It defines the procedure for receiving and processing electronic invoices by all federal customers regardless of the amount. At the same time, Germany developed the ZUGFeRD format (the name parodies the German word "Zugpferd", meaning a "draft horse"). It means that this format is a tool for processing invoices that allows a supplier and a buyer to exchange documents without entering into any agreements. The format is not limited to any particular industry or company size. It can be used everywhere and allows you to exchange e-invoices in the public and private sectors. Compared with the EDI standard, ZUGFeRD can be used not only by large companies but also by small and medium-sized organizations and even freelancers.

E-invoices in France

Like many other countries, France is actively developing an e-invoicing system. In this regard, the French government is even going to introduce mandatory invoicing and electronic reporting from July 2024, after which all French companies should be able to receive electronic invoices from suppliers. Since 2017, e-invoicing for B2G (transmission of electronic invoices to public authorities) has been mandatory in France for companies with 5,000 employees. From January 2020, even the smallest companies with fewer than 10 employees must submit electronic invoices to government organizations. In this country, e-invoices are created using the Factur-X standard.

To simplify the flow of documents between the countries, France and Germany developed the new ZUGFeRD 2.1/Factur-X format, which became available on March 24, 2020. The new format is fully compatible with the original ZUGFeRD 2.0 and Factur-X 1.0 formats.Important to know!

ZUGFeRD is a hybrid format that contains structured e-invoice data inside a PDF/A-3 file, which is the visual part of the invoice. Structured data in XML format can be read from a document and used by a recipient.

Creating an e-invoice in ZUGFeRD or Factur-X format in Stimulsoft report designer

We should mention that it is impossible to create an invoice in this format using only the report designer. You can make only a visual part of an e-invoice in the report designer. The rest of the operations need to be done from code because, to create a PDF file in the format you want, you should set many options that can’t be set in the designer.

In addition, a structured XML file with invoice data must be created in advance. Its creation goes beyond the scope of the report generator and is usually carried out by specialized libraries.

The creation of an e-invoice from a code is as follows:

  • load a report template;
  • render a report to get a visual part of an invoice;
  • set the required parameters in the PDF export settings:
    - the ZUGFeRDComplianceMode property defines the format version (V1, V2, V2_1);
    - the ZUGFeRDConformanceLevel property sets the required Conformance Level;
    - apply a pre-loaded XML-file with invoice data using the ZUGFeRDInvoiceData property.
  • export a report to PDF, at the output we get a file that meets all the requirements of the specification.


Below is the code example for exporting an e-invoice in the ZUGFeRD 2.0 format with a standard file name and description.
var report = new StiReport();
report.Load("template.mrt");
report.Render();

FileStream fileStream = new FileStream(@"d:\test.pdf", FileMode.Create);
byte[] buf = File.ReadAllBytes(@"d:\ZUGFeRD-invoice.xml");

var pdfExportSettings = new StiPdfExportSettings()
{
	ZUGFeRDComplianceMode = StiPdfZUGFeRDComplianceMode.V2,
	ZUGFeRDInvoiceData = buf,
	ZUGFeRDConformanceLevel = "EN 16931" //BASIC, EN 16931, EXTENDED
};

report.ExportDocument(StiExportFormat.Pdf, fileStream, pdfExportSettings);
fileStream.Close();

This is the code example for exporting an e-invoice in the ZUGFeRD 2.1/Factur-X format with changed settings.
var report = new StiReport();
report.Load("template.mrt");
report.Render();

FileStream fileStream = new FileStream(@"d:\test.pdf", FileMode.Create);
byte[] buf = File.ReadAllBytes(@"d:\ZUGFeRD-invoice.xml");

var pdfExportSettings = new StiPdfExportSettings();
pdfExportSettings.ZUGFeRDComplianceMode = StiPdfZUGFeRDComplianceMode.V2_1;
pdfExportSettings.EmbeddedFiles.Add(new StiPdfEmbeddedFileData("factur-x.xml", "Factur-X/ZUGFeRD", buf));
pdfExportSettings.ZUGFeRDConformanceLevel = "EN 16931";

report.ExportDocument(StiExportFormat.Pdf, fileStream, pdfExportSettings);
fileStream.Close();

E-invoices in Switzerland

E-invoices in Switzerland have already been used for two decades. Initially, e-invoices were sent to private recipients (B2C). A little later, the acceptance rate among end consumers increased due to the integration of e-invoices into online banking portals. After that, e-invoices were used in B2B AND B2G companies. As a result, more than 25% of invoices in Switzerland were submitted electronically in 2017.Note

Besides, in the B2G sphere, e-invoicing has been mandatory in Switzerland since the beginning of 2016. Suppliers must submit invoices electronically to the Federal Administration for transactions with a contract value of more than 5,000 Swiss francs. However, for B2B and B2C electronic invoicing remains optional.

The creation of a Swiss e-invoice in the Stimulsoft report designer

Our application contains a ready-made report template of a Swiss e-invoice. If you use its visual part as a basis, you’ll be able to create your Swiss invoice, having added your data to it and exported it to a format you need.

If you have any questions, contact us. We’ll be glad to help you.
By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.