Skip to content

Generate e-invoices (E-Rechnung in German) conforming to EN16931 (Factur-X/ZUGFeRD, UBL, CII, XRechnung aka X-Rechnung) from LibreOffice Calc/Excel data or JSON.

License

Notifications You must be signed in to change notification settings

gflohr/e-invoice-eu

Repository files navigation

licence price coverage documentation stand with

E-Invoice-EU

Free and open source tool chain for generating EN16931 conforming e-invoices (Factur-X/ZUGFeRD, UBL, CII, XRechnung) from popular spreadsheet formats or JSON.

Supported Formats

You can currently create e-invoices in these formats:

  • CII: customization id urn:cen.eu:en16931:2017
  • Factur-X-Minimum customization id urn:factur-x.eu:1p0:minimum
  • Factur-X-BasicWL customization id urn:factur-x.eu:1p0:basicwl
  • Factur-X-Basic-WL is an alias for Factur-X-BasicWL
  • Factur-X-Basic customization id 'urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic'
  • Factur-X-EN16931 customization id urn:cen.eu:en16931:2017
  • Factur-X-Comfort is an alias for Factur-X-EN16931
  • Factur-X-Extended customization id urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended
  • Factur-X-XRechung customization id urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
  • UBL: customization customization id urn:cen.eu:en16931:2017
  • XRECHNUNG-CII: customization id urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
  • XRECHNUNG-UBL: customization id urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
  • ZUGFeRD-Minimum is an alias for Factur-X-Minimum
  • ZUGFeRD-BasicWL is an alias for Factur-X-BasicWL
  • ZUGFeRD-Basic-WL is an alias for Factur-X-BasicWL
  • ZUGFeRD-Basic is an alias for Factur-X-Basic
  • ZUGFeRD-EN16931 is an alias for Factur-X-EN16931
  • ZUGFeRD-Comfort is an alias for Factur-X-EN16931
  • ZUGFeRD-Extended is an alias for Factur-X-Extended
  • ZUGFeRD-XRechung is an alias for Factur-X-XRechnung

Case does not matter, when you specify a format.

Using the software

There are several ways to use the software:

The JavaScript/TypeScript library works both on the commandline and in the browser. The only limitation of the browser version is that it cannot generate PDF versions of invoices from spreadsheet data because this requires invocation of LibreOffice which is not possible in the browser. Instead, you have to provide a PDF version yourself, in case it is needed.

The E-Invoice-EU documentation contains a fully working demo of invoice generation right in your browser.

Description

This repository is an attempt to aid businesses, especially in France and Germany but also in other parts of the European Union to create e-invoices conforming with EN16931 with only free and open-source software.

Documentation

See the E-Invoice-EU online documentation.

The blog post Creating E-Invoices with Free and Open Source Software or the German version Elektronische Rechnungen mit freier und quelloffener Software erzeugen also provides in-depth information using a gentler approach!

Alternatives

You can achieve similar results with these projects:

BUGS

PDF/A

The Factur-X resp. ZUGFeRD standard requires PDF/A compliance for the PDF that the invoice is wrapped in. Please search the internet if you do not know what PDF/A means.

This library creates PDFs solely with pdf-lib and does some pretty complicated transformations on the PDF to achieve PDF/A compliance. This is not battle tested and may fail.

If you encounter a PDF that does not meet the PDF/A requirements, please open an issue and attach an anonymized version of the PDF. What you can do in the meantime:

  • If you have GhostScript installed, convert the PDF to PDF/A with this command: gs -dVERBOSE -dPDFA=3 -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=OUTPUT_FILE.pdf PDFA_def.ps INPUT_FILE.pdf
  • Try to create the PDF again with LibreOffice.
  • If the normal settings in LibreOffice do not work, enable PDF/A support (in the General section of the PDF options).
  • If you want to automate the process, you can start LibreOffice in headless mode on the commandline: libreoffice --headless "-env:UserInstallation=file:///tmp/LibreOffice_Conversion_${USER}" --convert-to 'pdf:writer_pdf_Export:{"SelectPdfVersion":{"type":"long","value":"3"}}' SOURCE_FILE.ods

On Un*x systems, libreoffice should be in your $PATH. On MacOS, you will find it under /Applications/LibreOffice.app/Contents/MacOS/soffice. On MS Windows, it is probably somewhere like C:\\Program Files\\LibreOffice\\libreoffice.exe (corrections are welcome).

Reporting Bugs

Please report bugs at https://github.com/gflohr/e-invoice-eu/issues.

Copyright

Copyright (C) 2024-2025 Guido Flohr guido.flohr@cantanea.com, all rights reserved.

This is free software available under the terms of the WTFPL.

Disclaimer

This free software has been written with the greatest possible care, but like all software it may contain errors. Use at your own risk! There is no warranty and no liability.