Stock register behaviour improvements

Conrad Canterford conrad@mail.watersprite.com.au
Tue, 09 Jan 2001 16:27:33 +1100


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?

Thanks,
Conrad.
-- 
Conrad Canterford (conrad@mail.watersprite.com.au)
Water Sprite Pty Ltd   | info@mail.watersprite.com.au
 GPO Box 355,          | Incorporating:
 Canberra, ACT, 2601   |   Australian Tour and Event Management (ATEM)
 Australia.            |   Ticketing Services Division
Phone: 0419 122 553    |   Catering Services Division