testing the book zeroing code (maybe for backport?)

Derek Atkins warlord at MIT.EDU
Fri Dec 28 07:55:59 EST 2007


Quoting Tim Wunder <tim at thewunders.org>:

> Couple things:
> * it'd be nice to have some sort of feedback to the user that something is
> happening. How hard would it be to add a progress bar or something?

Is it really slow enough that a progress bar is needed?  In my cursory
tests the process took the blink of an eye.  Doesn't seem worth a progress
bar when clicking OK makes it look like the dialog just disappears
(and the accounts get updated).  I suppose I could add a "Done" box at
the end, but that's pretty obnoxious IMHO.

> * I noticed that one of my expense accounts was not configured as an expense
> account, so it was skipped. I then re-ran the book close program only to find
> out that not only did the revised account get closed out, a second closing
> transaction was added to the other accounts. This is probably because I chose
> a future date (12/31/07) for the close out. When I re-ran the close using
> that future date, gnc didn't see the pre-existing zeroing out transaction on
> 12/31/07.

The future date shouldn't matter.  The code performs a "BalanceAsOfDate()"
operation.  Did the second transaction have the same Splits as the first?
If so, then the problem is either that the BalanceAsOfDate is using < instead
of <=, or the date chooser is giving different timestamps for the day.
It SHOULD add a new transaction, but it should skip the already-processed
accounts, because it should notice that they are already zero.

Is there any chance you could look in your data file for those two 
and email the date_entered and date_posted entries for those two?
There's clearly a bug here.

Also, I question how you have an Expense account that isn't of type Expense?
GnuCash shouldn't let you do that!

> * It'd be nice if the dialog would remember the previous entires for 
> the date, income and expense accounts.

True.  It was on my list of useful features.  I was also thinking it would
be nice to base the date on the Edit -> Preferences Period setting.  Could
you file an RFE in bugzilla on this so I don't forget?  I might not have
time to get to this "soon".

> * It might also be a good idea for the user to be presented with a review
> dialog with suitable warning about book closing. Something like "This will
> create a zeroing transaction for all your income and expense accounts as of
> $DATE_SELECTED" with the obligatory OK/CANCEL buttons.

Sure, this is easy enough to do, but it's pretty annoying.  Why would you
need this?  It's pretty easy to undo; you just have to delete two 
Also, it's not going to do anything until you click that first OK, and
the operation isn't dangerous.  It's not like it's going to delete
any transactions or do anything that isn't immediately recoverable.  So
I'm not sure the operation warrants a warning dialog like that.

> *If gnucash can remember the last book close date, a warning could be
> displayed if the book close is within say 30 days of the last close, telling
> the user something like "You just closed the books on $LAST_CLOSE_DATE,
> num_days ago. Are you sure you want to close the books again?"

Eh, I suppose.  Again, I think it's easy enough to undo the operation
that such a warning isn't important.

> But it looks like a great start to a useful feechur. Thanks, Derek!


> Tim


       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-devel mailing list