Our small company is being required to supply EU-compliant E-invoices. I have found the Python package factur-x, and the factur-x plug-in for libreoffice. Unfortunately the latter generates only minimal factur-X invoices, and our customers are telling us that these are insufficient.
Can anybody help me with pointers either to other open-source software, or to English-language examples or descriptions of the required xml?
Ideally, a Django template that could convert a Python dict or suchlike context into the relevant xml, for merging into a pdf invoice (which factur-x can do). Any other macro or template language would do. But I'll take any help I can get. I can't read standards documents written in German!
Working on the same topic at the moment.
For generating the xml with Python, take a look at this library: https://github.com/invinet/python-en16931
Unfortunately this library seems to be not maintained since the last years but can serve as a good starting point.
With the factur-x library you have already found you can merge the xml to the pdf but keep in mind that you will need the PDF/A3 format to make the invoice compliant. So either the original PDF already has the A3 archive format or - the way I prefer - is to use ghostscript to merge the xml.
See https://ghostscript.com/zugferd.html
EDIT:
Also take a look in the xsd-folder that comes with the factur-x-Library - there you have the XML schema description files needed to create a compliant xml.
I found this library very useful:
https://github.com/pretix/python-drafthorse
It allows creating the xml file from scratch and provides for exporting various ZUGFeRD schemas.
Creation example:
# Build data structure
doc = Document()
doc.context.guideline_parameter.id = "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended"
doc.header.id = "RE1337"
doc.header.type_code = "380"
doc.header.name = "RECHNUNG"
doc.header.issue_date_time = date.today()
doc.header.languages.add("de")
...
And it is still maintained, last commit 4 hours ago.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With