XML format, transactions

Derek Atkins warlord at MIT.EDU
Mon May 13 09:54:42 EDT 2013


Hi,

Danny Pansters <danny at sauna-joe.nl> writes:

> Hi all,
>
> I've been using GnuCash for over 4 years now for our business, together
> with a cash register app I wrote myself. So far, I've been manually
> entering my journal posts for the daily sales and payments and whatnot,
> but that gets boring. So now I'm wanting to use that data -- it gets
> archived plain text with certain codes for certain types of actions --
> and convert and append it to my GnuCash XML file.
>
> The cash register app is very general and could as well be used for a
> restaurant or a hotel etc. All specific context is stored in separate
> config files. Using these I assemble all the data that should go into
> the daily ledger entries. I won't necessarily get all the splits filled
> out completely but having the bulk of it, the most common ones, will
> certainly save me a lot of time. 
>
> To get to GnuCash format I can work with a template of an actual journal
> post, but questions arise. The first one being: In a transaction the
> ledger accounts are referenced by id. Do I need to make a id lookup
> table in my conversion script, or can I reference the accounts also by
> name or number?

Manually editing the XML file is neither recommended nor supported.
There are too many ways that you could do something wrong and destroy
your data file.  Instead, you should use the GnuCash APIs (in C, Scheme,
or Python) to manipulate your data.

Having said that, to answer your question, the XML requires the GUIDs
for referencing objects.  Therefore, you would need to have some way to
look up the GUID for your account(s) in order to properly enter them
into the transactions.

You might be better off having your program output QIF and then you can
use the QIF importer to pull the transactions into GnuCash.  Granted,
that requires manual intervention.  If your goal is automated entry then
I recommend the GnuCash API.

> TIA,
>
> Danny Pansters
> Sauna Joe

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list