Stock register behaviour improvements

Dave Peticolas dave@krondo.com
Tue, 09 Jan 2001 00:50:34 -0800


Conrad Canterford writes:
> I have been playing with this for a while, and I've decided that what I
> was attempting to do was not sufficient.
> 
> CURRENT BEHAVIOUR
> Currently, when you are using a split in a stock register you (possibly)
> have values for Shares, Price, and Value. If you change any of these
> such that Shares * Price != Value, then when you leave that split,
> gnucash prompts you to ask how you wish it recalculated, and does the
> recalculation. There is nothing wrong with this behaviour, except that
> it interupts the user (generally midway through entering a transaction).
> This can be very irritating.
> This has the annoying side effect that, when you are entering the
> balancing split to deduct money from your bank account, you still get
> prompted for how to recalculate it, and no recalculation is necessary.
> 
> PROPOSED BEHAVIOUR
> I propose changing xaccSRSaveChangedCells so that it will not prompt in
> the following situations, but will automatically recalculate the
> appropriate fields:
> 1. When precisely two of the fields have been changed (will recalculate
> the unchanged field)
> 2. When precisely one field has been changed, and precisely one of the
> other fields is zero (will recalculate the zero field). I expect this to
> only occur on initial entry.
> 3. When both the Shares and Price fields are zero (no recalculation
> should be necessary). This is intended to catch the balancing split
> case.
> 
> All the above are to occur regardless of whether we are on a new split
> or not (this is a significant difference to what I had initially
> discussed with Dave P).
> 
> Anyone have any comments? Any pitfalls I've missed/forgotten? Any
> reasons I shouldn't do this?

This sounds good to me.

dave