On Sun, 2003-01-12 at 10:43, Linas Vepstas wrote: > On Sat, Jan 11, 2003 at 12:01:57PM -0500, Derek Atkins was heard to remark: > > Linas, > > > > Thank you for this great summary. Mind if I ask a few clarifying > > questions? > > > > [EMAIL PROTECTED] (Linas Vepstas) writes: > > > > > Note that because the 'adjusting transaction' has one split > > > in dollars, and another split in RHAT shares (albeit for zero > > > RHAT shares), it evades the old double-entry requriement, > > > and will not be flagged as 'out of balance'. Note also > > > that because the 'adjusting transaction' contains a split > > > holding S (albeit zero S), it *must* be a part of a Lot. > > > > But it IS in balance by the old rules. The split->value is in > > balance. > > Well, its a 'weird balance'; its a good example of what I mean > by 'multi-commodity transactions fundamentally can't balance'. > > The split in the 'unrealized' account shows amt=$1000, value=$1000 > The split in the 'stock' account shows amt=0 shrs value=$1000 > > If you look at the above 'adjusting transaction' on its own, > you conclude an infinite price. Yuck. To compute the prices > corrctly, you have to find the lot that this belongs to, and > assume that the lot shares were all sold and then rebought > at $1000 less. This means that any kind of split_get_price() > routine needs to also be made more complex. Ugh. There are really > *two* prices involved ...
Indeed. That's why I was kind of wondering if it would be possible to add a field or two the Lot--perhaps a guid/price hash table, where guid == a given Split? That way there's no guessing after the initial Split creation--if amt == 0 && value != 0 return hash table element guid. Of course, that would mean an extra bit of storage to the backend for the Lot. This is just my "I just got home and am really tired" stab, so perhaps tomorrow evening will yield better ideas. -- Matthew Vanecek perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' ******************************************************************************** For 93 million miles, there is nothing between the sun and my shadow except me. I'm always getting in the way of something...
signature_asc_DEFANGED-2584.DEFANGED-43467
Description: application/defanged-43467
