Closing out a year?

Paul Lussier
Thu, 10 May 2001 16:07:47 -0400

In a message dated: 10 May 2001 15:16:03 EDT
Matthew "T." Jachimstal said:

>It works somewhat nicely, but is a pain to go to EACH account and zero it.

Well, you only have to do it once a year, right?  Hmmm, didn't I see 
you mention "list of accounts to be zero'ed" somewhere?  That has 
"perl script" screaming out to me :)

>> Thanks, I hadn't thought of zero'ing things out for yearly 
>> comparisons :)
>I hadn't thought of archiving each year in its own file. :)
>That would be rather nice to have, just make the beginning balance of
>the asset & liability accounts equal to the ending balance before
>seperation. (Gee, that sound a lot like standard accounting practices.
>:) )

Now if we can just figure out how to get this separation part working!

The tough part is that (currently) we'd have to maintain multipl 
files; the previous year's file, the current/on-going year's file, 
and next year's file which becomes this years file.

	1. When the first "Previous Year" (PY) ends
		- save to a different file name
		- zero out income/expenses in "rolling file" for
		  "Current Year" (CY)

	2. When CY ends
 		- save to a different file name
		- open this new file and delete all PY transactions
		  setting the initial balances of asset/liability accounts
		  to what they were at the end of PY
		- zero out income/expenses in "rolling file" for
		  "Next Year" (NY)	

So, the very first year you start using GnuCash, you'd follow the
steps in #1, but the next and subsequent years, you follow
the steps in #2.

It would be very nice to script this somehow.  In order to do this 
though, we'd need to be able to export a chart of accounts to an 
ascii text file somehow, otherwise it's going to be quite tedious 
typing all that in, and quite prone to error.

The other question I have is, to write this, should we attack this 
from a 1.4.x point of view with the binary file format, or from the 
1.5.x side of things with the XML file?

I'm not using 1.5 yet (though if I ever get any spare time, I may 
start playing with it).  So at this point, it seems to make more 
sense to go with what we have in 1.4.  

I'm seeing this as a command line perl script with something like the 

	closeout --last-year=gnucash-2000 --this-year=gnucash-2001 \ 
		 --rolling=gnucash-rolling --zero-accounts=zero_accts.txt

where:	--last-year	is the file name containing last year's transactions
	--this-year	is the file name containing this year's transactions
	--rolling	is the file name containing everything
	--zero-accounts is the file containing the list of accounts 
			to zero out

Sorry, I started thinking with my fingers and it all just came out.

Am I missing anything major here?  I'm not an accountant, so I don't 
know if there are any procedural steps missing at all.

Any comments?


	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!