XML format, transactions

Danny Pansters danny at sauna-joe.nl
Tue May 14 19:14:32 EDT 2013


On Mon, 2013-05-13 at 09:54 -0400, Derek Atkins wrote:
> 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.

Thanks very much for this suggestion! This works very well for my
purposes. I can now auto-enter fairly complicated journal posts
(payments in cash and via ATM, sales per group, VAT payable, skimming to
vault, deposit at bank, buying and reselling from restaurants with which
we work including VAT receivable, private withdrawals -- all these can
be part of a daily cash register slip). Highly recommended to any
Pythoneer who's a bit familiar with SWIG/C. And best of all: done in a
day!

Once again, thanks.

Dan

> 
> 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
> 




More information about the gnucash-user mailing list