Summary of the previous episode: on December 25th 2015, Akretion offered a Christmas present to the Odoo accounting community in the form of an opensource Odoo module named account_invoice_import. With this module, the accountant can upload a PDF invoice in Odoo and it will automatically create the supplier invoice with all the needed information : supplier, invoice date, invoice number, untaxed amount, VAT, amount with taxes, etc.
This import works with regular PDF invoices by using the invoice2data Python library, which extracts text from the PDF, finds the appropriate template (the invoice2data library has templates for many suppliers and you can add your own) and then uses regular expressions to grab the relevant information (invoice date, invoice number, amount without taxes, amount with taxes). The advantage of this solution is that it works with all PDF invoices. The drawback is that you have to develop a template in the invoice2data library for every supplier and, when the supplier changes the layout of its PDF invoice, you have to update the template.
PDF format is great for viewing and printing, but it doesn't provide structured information about the invoice. XML is the most common format for structured information. There are 2 main international standards for XML invoices:
- Universal Business Language (UBL) standardized by the OASIS,
- Cross Industry Invoice (CII) published by an agency of the United Nations called UN/CEFACT.
If you receive an invoice in XML format and if your ERP supports the import of that format, you will have a reliable import solution thanks to the structured data provided by the XML format. But, if you send an invoice as an XML file to your customer, you may be afraid that he won't be able to read it... so you may never get paid ! The ZUGFeRD standard provides a pragmatic and clever solution to this problem: it defines a way to embed a standard XML file inside the PDF invoice. With the publication of the PDF/A-3 standard in 2012 (the corresponding ISO standard is 19005-3:2012), you can embed one or several files of any format inside a PDF document (if you use Acrobat Reader, you can view the files embedded in a PDF document by clicking on the paper-clip icon). So a ZUGFeRD invoice is a PDF invoice with an embedded XML file named ZUGFeRD-invoice.xml in Cross Industry Invoice (CII) format.
The ZUGFeRD specifications can be downloaded from the FeRD (Forum elektronische Rechnung Deutschland) website. This standard is based on several international standards:
- the Cross Industry Invoice (CII) format which uses the building blocks of the Core Components Specification (ISO 15000-5:2014),
- the codification of units of measure, taxes and payment means defined by the United Nations Economic Commission for Europe, which has 56 members states in Europe, America and Central Asia according to Wikipedia (the other international XML invoice format, UBL, uses the same codification),
- the recommendations of the Message User Guide (MUG) of the CEN, the European standardization organization.
Germany, the author of the ZUGFeRD standard, encourages its companies to send their invoices in this format. Starting from January 1st 2017, the French administration will only accept electronic invoices from large companies, and this obligation will be extended progressively to all companies until January 1st 2020, following this calendar (in French). In France, the FNFE-MPE (Forum National de la Facture Electronique et des Marchés Publics Electroniques) is coordinating the efforts on the standardization of electronic invoices. According to this slide show (in French), France is adopting the same technical approach as ZUGFeRD: standard XML file embedded inside the PDF invoice. This common press release (in French) of FeRD and FNFE shows that France and Germany are working together to adopt a common standard for electronic invoices.
Akretion has implemented the ZUGFeRD specifications both for the generation of customer invoices (Comfort level) and for the import of supplier invoices (all levels) in Odoo version 8. The generation of ZUGFeRD PDF customer invoices and refunds is provided by the module account_invoice_zugferd for the Qweb reporting engine (which is the default reporting engine since Odoo v8). It also works with the Aeroo reporting engine if you apply this patch. The resulting invoices have been checked by the ZUGFeRD eInvoice validation portal and the validation system confirms that the invoices are fully compliant. The import of ZUGFeRD PDF supplier invoices is provided by the module account_invoice_import_zugferd, which is an extension of the account_invoice_import module.
All these modules are published by Akretion under the AGPL licence on the account-invoicing project of the Odoo Community Association (OCA). They require some data modules that provide the UNECE codification of units of measure, taxes and payment modes available in the community-data-file project of the OCA. You can see a demo of these modules in this screencast (in English, high-resolution OGV file, 22 minutes, 200 MB, readable with VLC)
Since February 23rd 2016, all the invoices sent by Akretion to its customers are ZUGFeRD PDF invoices. That way, our customers can reliably import our invoices in their Odoo ERP in just 4 clicks! Alexis de Lattre, who developed the ZUGFeRD modules for Odoo, declares : "I am very proud to publish the first opensource implementation for the generation and import of ZUGFeRD electronic invoices in an opensource ERP! It is also the first opensource implementation of ZUGFeRD in the Python programming language. The fact that there is now an opensource implementation of ZUGFeRD for Odoo, the leading opensource ERP software, is important to boost the adoption of electronic invoicing. We are now ready for the take-off of electronic invoicing in Europe!"
Don't hesitate to contact Akretion if you are interested by our work on electronic invoicing or whether you want to generate or import invoices in ZUGFeRD or UBL format with Odoo in your company.