Perl script for "closing the books" in a GnuCash file
Rudye McGlothlin
Rudye at LiquidOx.com
Sun Nov 12 01:53:11 EST 2006
Hi Everyone!
I've been trying to use the perl script for archiving and removing older
transactions from my Gnucash file. After installing all the perl
modules it needed, I got it to run. But I always get this error:
gnucash_close_books_unix.pl: Couldn't find tag trn:description for node:
<gnc:transaction version="2.0.0">
<trn:id type="guid">4556c015013bead65eac582fc7e58686</trn:id>
<trn:currency>
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>USD</cmdty:id>
</trn:currency>
<trn:date-posted>
<ts:date>2004-09-14 01:00:00 -0400</ts:date>
</trn:date-posted>
<trn:date-entered>
<ts:date>2004-09-18 10:21:18 -0400</ts:date>
</trn:date-entered>
<trn:description/>
<trn:splits>
<trn:split>
<split:id type="guid">8791e81e50da3a7439970891d03740b0</split:id>
<split:reconciled-state>y</split:reconciled-state>
<split:reconcile-date>
<ts:date>2004-09-30 01:00:00 -0400</ts:date>
</split:reconcile-date>
<split:value>500000/100</split:value>
<split:quantity>500000/100</split:quantity>
<split:account
type="guid">636cbd13735091c166544673dbe20d8e</split:account>
</trn:split>
<trn:split>
<split:id type="guid">6e5877579afbd75c980ce02eb703e805</split:id>
<split:reconciled-state>y</split:reconciled-state>
<split:reconcile-date>
<ts:date>2004-09-30 01:00:00 -0400</ts:date>
</split:reconcile-date>
<split:value>-500000/100</split:value>
<split:quantity>-500000/100</split:quantity>
<split:account
type="guid">81ba281ad73908c6ed94f751a3e96fea</split:account>
</trn:split>
</trn:splits>
</gnc:transaction>
I think the problem is that the <trn:description/> node is closed with
the '/' . But I don't know anything about perl in order to fix it. The
only line in the script with trn:description is:
&set_child_value($at, 'trn:description',
($start_str ? ($end_str ?
"Archived transactions $start_str - $end_str" :
"Archived transactions starting $start_str") :
($end_str ? "Archived transactions through $end_str" :
"Archived transactions")));
Anyone have an idea to work around this or fix it?
Thanks,
Rudye
More information about the gnucash-user
mailing list