Creating Gnucash invoices with XML/XSLT

Neil Williams linux at codehelp.co.uk
Mon Apr 5 09:49:13 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- From the Help file:
A.5. Converting XML GnuCash File
You will now have a file in the desired output format. An enterprising 
individual could go so far as to write a stylesheet to transform the Gnucash 
data file to an OpenOffice spreadsheet (or vice-versa, for that matter). Such 
things as QIF ought to be a little less work.

The interesting part from my point of view is the vice-versa. I'm used to 
writing XSLT, although I've not done much with command-line XSLT clients in 
Linux so far, and I'm sure I can obtain the necessary data from existing data 
files in use by KOrganizer / pilot-link(expenses) to feed into an XSLT 
stylesheet.

What I would like to do is:
1. Collate data from a Palm Pilot and/or KOrganizer into a bespoke XML file - 
this part I'll do myself.
2. Use XSLT to transform the XML into a Gnucash compatible format. (Or even 
write the data straight into the final format.)
3. Import the completed invoice directly into Gnucash, ready for posting.
 (or maybe already posted).
4. This would be run, at most, once each day and would only import one invoice 
at a time - each invoice accounting for a complete day's work.

My reasoning is that my business work relies on valid data in the calendar and 
expenses databases of the Palm, sync'ed to Kontact (KOrganizer and 
addressbook) or to a stand-alone expenses file using pilot-link. I don't want 
to have to re-type all that data again to generate the invoice within 
Gnucash.

I have a client number in the Palm that already matches the job Billing ID.
I have data in addressbook that matches the customer name in Gnucash and can 
be easily crafted to pattern match to the customer ID if necessary.
I have the date, the rate, the account names are predictable and various 
expense types can be handled.
I can code for a reliable post date and description, should it be possible to 
import an invoice as posted (or post immediately on import using data 
provided).

I have 4 customers and between 2 and 30 jobs for each (most of which repeat at 
various times). Each can have different rates and all have different hours. 
Some have no expenses, some have 3 separate expense claims. No invoice runs 
over 7 days, all invoices will be one-per-job as with current Gnucash 
invoices and the average invoice consists of 1-6 items.

Before I start work on the XML, I want to be clear on whether the data can be 
imported into Gnucash and whether I can expect the import to include all 
necessary data and tie in with older, manual, invoices.

The final XSLT / XML spec. will be free software and could be included in 
future Gnucash releases, if appropriate.

- -- 

Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/

http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAcWPZiAEJSii8s+MRArsBAKDPa6WtNhWoLI4kfvwIEx6Z9wq0uQCcCYC9
ng+NpjQtLQaQa/Sv9+8HTyM=
=mZqJ
-----END PGP SIGNATURE-----



More information about the gnucash-user mailing list