hand-coded transactions are usually BAD transactions

Neil Williams linux at codehelp.co.uk
Sat Oct 30 07:36:15 EDT 2004


On Saturday 30 October 2004 12:23 am, Kevin HaleBoyes wrote:
> Just for fun I wrote a small perl program

Which was inevitably too simple to cope with the requirements of the data.

> to create the 
> <gnc:transaction> entries.  I then took those and merged
> them into my BoR xml file (after a backup of course).

By hand? There's no telling the chaos that will result in the QofBook when you 
arbitrarily insert items. Did you check the GUID? did you create them out of 
thin air? Did you make any effort to match the GUID of the parent against the 
GUID of the child?

> When I restarted gnucash I got quite a few errors to the
> console than I don't get in the original BoR file.  Here

BoR? 

> is a snippet of the messages:
> -----------------------------------
> Transactions: Total: 1144, Loaded: 1160

You appear to have Transactions that are not linked to an account, linked to 
an invalid account or corrupt in other ways.

>
> First, is it possible to even do this?

Not by hand, at least, not without a very high probability of errors.

I'm working on a merge routine that will sort this out but it's not ready yet.

> It looks like there is a transaction count somewhere that
> I also need to update.  Is that true?

There are lists of transactions and splits within Account objects. There is no 
way just via the XML to cause those lists to be re-calculated, you have to 
invoke it via the C code.

> Maybe there are just too many little things

Links between objects are not 'little' - they are the crux of the GnuCash 
system.

> that need to 
> be updated manually to accomplish this.  That's fine but
> I wanted to see if I could merge these hand-coded transactions.

No, not yet. It's far from simple, despite how it might appear in the XML.

At least you have the backup.

-- 

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20041030/4c1e3a23/attachment.bin


More information about the gnucash-user mailing list