[GNC] How to create a new Invoice report template

john jralls at ceridwen.us
Mon Apr 17 11:56:47 EDT 2023



> On Apr 17, 2023, at 12:27 AM, Stein Erik Berget <seberget at gmail.com> wrote:
> 
> Hi all.
> I've been wondering how I can create a new invoice report for suppliers.
> The report is not to be created on paper, but to be delivered as email. The
> format is in XML and is known to be EHF - Elektronic Trade Format.
> https://anskaffelser.dev/postaward/g3/spec/current/billing-3.0/norway/
> shows how this would look like. The advantage in this format is direct
> handling of it, both at the supplier and you.
> 
> How do I start with this? Where do I create the hooks and the driver to
> populate the report?

The simplest way would be to write a program in the language of your choice to convert
a GnuCash Invoice from HTML to XML complying with the EHF schema.

For more flexibility you can query the GnuCash data using C/C++ or the Python/Guile
bindings and write a program to format the XML directly from that, or write an external
program to read the data directly from the GnuCash data file. Unless you're really
proficient with XSLT or XQuery you'll probably prefer to save your file as SQL and query
the resulting database. The SQL schema is described in https://wiki.gnucash.org/wiki/SQL and
there's non-normative XML relax-ng schema and DTDs at https://github.com/Gnucash/gnucash/tree/stable/libgnucash/doc/xml.

Regards,
John Ralls



More information about the gnucash-user mailing list