Hi, I've unleashed automated 'lot scrubbing' aka automated determination of realized gains/losses in the experimental CVS branch.
How this works: -- search for 'trading accounts': these are accounts that have transactions between different currencies/commodities. -- automaitcally assign splits to 'lots'. A lot is opened by putting a split into it. All subsequent splits added to it must decrease its 'amount' balance to zero. When a lot hits zero balance, it is 'closed'. (see src/doc/lots.txt) -- The value of the splits in a closed lot is totalled up. This total value is the 'realized gain/loss'. If its not zero, a transaction is added: one split goes into the lot, making its value zero, the other split goes into a new 'realized gain/loss' account. This implements the 'double balance' requirement discussed on this mailing list last summer. It sure would be nice to be able to view & edit lots from a GUI, but there is no GUI at this time. The 'lot scrubber' implements a FIFO accounting policy: oldest asset purchases are matched to oldest asset sales. It could be nice to have other accounting policies. I promise to think about the GUI. N.B. this clears the way for accounting periods, which were mostly implemented except that they couldn't handle stocks correctly. Well, now we have the mechanism for that. I'll see if I can fix that soon. Note also: accounting periods don't have a GUI, either. --linas p.s. the way to disable this is to comment out 'lot scrub' from the file below. ----- Forwarded message from Linas Vepstas <[EMAIL PROTECTED]> ----- Date: Sunday April 6, 2003 @ 1:33 Author: linas Update of /home/cvs/cvsroot/gnucash/src/gnome In directory www.linas.org:/tmp/cvs-serv13677 Modified Files: window-acct-tree.c Log Message: enable lot scrubbing for good! ----- End forwarded message ----- -- pub 1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <[EMAIL PROTECTED]> PGP Key fingerprint = 8305 2521 6000 0B5E 8984 3F54 64A9 9A82 0104 5933 _______________________________________________ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnucash.org/cgi-bin/mailman/listinfo/gnucash-devel