Hi @webdienste, how are you?
I took some time to look at your problem, and it seems that it’s now mandatory (or about to become so) to send an electronic invoice in Germany but also in France (it’s apparently a European decision so I imagine that eventually it will be the case for all of Europe).
When I looked it up on the net, I found that the Factur-x format (also known as ZUGFeRD in Germany) seems to be pretty widespread for this type of invoice; it’s actually a pdf file with the XML file attached (on the website, you’ll find full documentation in German, French and English).
For your case, I think the ideal scenario might look something like this:
- You generate the usual pdf invoice
- Either the same action or an automation triggered by the creation of the invoice pdf file (if your store it in your table) runs a script that will create, from the data in your database, the corresponding XML file (and eventually store it as well)
- The Factur-x file is created from both the pdf invoice and the XML file.
For this third step, I found a Factur-x python library that seems to do the job. This python library is not actually present in the SeaTable python interpreter, but maybe this is something you can ask @cdb or @rdb for, or you could use another solution like running this script from replit or another similar service…
The second step is still more complex as far as I understand it, because I didn’t find yet any library able to do this step for you. Of course, generating an xml file from a python script is no big deal, but of course this XML file will have to be compliant with the official Factur-x XSD (XML Schema Definition) which is actually neither unique (Minimum, Basic WL, Basic, EN16931 and Extended) nor easy to find/understand…
In my humble opinion, the better way to generate this XML file from your actual data is to:
- Define which data profile seems to be the most appropriate for you (descriptions below come from the fnfe-mpe website cited above):
- MINIMUM: corresponding to the minimum invoice information required on CHORUSPRO and equivalent to a classic header OCR and manual validation data capture.
- BASIC WL: corresponding to the document level invoice information that are mostly required or useful for buyers for their process automation
- BASIC: corresponding to the BASIC WL profile with the core line information required or useful for buyers for their process automation
- EN16931: corresponding to all the invoice information present in the European Norm EN16931
- EXTENDED: corresponding to the EN16931 profile, with some additional invoice data. This profile is under construction, and will be published later.
- Once you chose the data profile, find in the full documentation an invoice example pretty similar to the ones you actually generate so you can get the corresponding XML file
- Develop a python script (or find someone to develop it for you
) able to generate a similar XML file from your data stored in SeaTable
PS: two other formats exist for electronic invoices: Universal Business Language (UBL) and Cross Industry Invoice (CII).
Bests,
Benjamin
I love spending time gathering information and explaining solutions to help you solve your problems. I spend… quite a bit of time on it
.If you feel grateful for the help I’ve given you, please don’t hesitate to support me. I am also available for paid services (scripts, database architecture, custom development, etc.).