Cleared balance bug and corrected explanation (was: Re: balancing gnucash against bank checking account),

David Hampton hampton at employees.org
Fri Aug 29 17:29:48 CDT 2003


On Fri, 2003-08-29 at 13:38, Benoit Grégoire wrote:
> David, can you elaborate on how "Future" is actually 
> calculated vs "Projected Minimum"?

Well, the engine internally keeps several running balance for each split
in an account.  Splits are ordered chronologically from oldest to
newest, and the balances on each split are 1) the beginning balance of
the account plus the sum of all splits up to and including that split;
2) the beginning cleared balance of the account plus the sum of of all
splits marked cleared up to and including that split, and 3) the
beginning reconciled balance of the account plus the sum of of all
splits marked reconciled or "frozen" up to and including that split.

So the answer to the earlier question is: no, the cleared balance does
not include any reconciled transactions.  If anyone wants to change this
behavior the function to modify is xaccAccountRecomputeBalance().  Its
entirely possible that I introduced this bug when adding the ability for
a user to choose to view one of a zillion different balances in the
account tree.

The Future balance of an account is simply balance #1 above from the
last split in the account.  Present balance is balance #1 from the last
split having today's date.  The Projected Minimum balance is the
smallest balance #1 from the set of splits starting with the last split
having today's date and ending with the last split in the account.  Note
that all three of these balances should be the same number if you have
not entered any transactions in advance.

David

P.S. The code correctly handles the case where you haven't entered any
transactions for the current day.

P.P.S. Hmmm, looks like I did introduce this bug. On April Fools Day, no
less.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /pipermail/attachments/20030829/151a49cd/attachment.bin


More information about the gnucash-devel mailing list