mini-ANNOUNCE: auto gain/loss scrubbing implemented

Linas Vepstas linas at
Sun Apr 6 13:18:44 CDT 2003

On Sun, Apr 06, 2003 at 11:32:08AM -0400, Derek Atkins was heard to remark:
> linas at (Linas Vepstas) writes:
> > 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.
> I admit that I haven't looked at this, yet.  Is this "trading account"
> a flag on an account?  Or is it a new account type?

Neither.  During scrub, its a search through all transactions in an account: 
if I find a (transaction->currency != account->commodity) then use lots,
else not.   

> I've come to realize that certain other types of accounts also would
> do well with lot support.  For example, credit card accounts would do
> well in order to keep track of which items have been paid and which
> not.  Similarly, A/R and A/P (which is currently using lots) need the
> same information.  Asset accounts could use it for Asset Tracking
> (depreciation).

Yes, but I think this is waiting on a GUI. 
For which I have a proposal, see next email.

> > -- 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)
> How would this work with "pre-payments" (or over-payments)?  Currently
> I handle pre-payment as an open lot with a negative balance instead of
> a positive balance.  During the payment processing, if a payment would
> take an existing lot negative then it get's auto-split into a new lot
> and so on (the one split becomes many splits).

Yes. That's how the scrub routine does it.

BTW, if you scrub 'all accounts', I guess I can potentially damage 
some of your invoices (or not ?).  I'd like to get you to test this out.


pub  1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas at>
PGP Key fingerprint = 8305 2521 6000 0B5E 8984  3F54 64A9 9A82 0104 5933

More information about the gnucash-devel mailing list