So, I've spent far too much of my weekend digging into thinking about this Bug.
BTW, I took Martin's patch from the bug tracker: http://bugs.ledger-cli.org/show_bug.cgi?id=712#c3 And applied it to a branch, and made an extra test to show what Martin is talking about. But, not surprisingly, this patch causes a lot of regressions in tests where Equity:Capital.* accounts are expected, so I didn't propose this for a pull request yet, and won't until all the regression test are fixed. You can follow my work if you want in this gitorious branch: https://gitorious.org/ledger/ledger/commits/bug-712 Anyway, I've definitely become convinced over the last few days that it's completely wrong for Ledger to generate the Equity:Capital Gains / Capital Losses accounts automatically, or at the very least, the way it's doing so now doesn't make any sense. To make this simpler, I've gone back to the only example from ledger3.texi that talks about the Equity:Capital Gains/Losses category: 2009/01/01 Shell Expenses:Gasoline 11 GAL {=$2.299} @ $2.30 Assets:Checking This transaction says that you bought 11 gallons priced at $2.299 per gallon at a @strong{cost to you} of $2.30 per gallon. Ledger auto-generates a balance posting in this case to Equity:Capital Losses to reflect the 1.1 cent difference, which is then balanced by Assets:Checking because its amount is null. Fact is, if I wrote this: 2009/01/01 Shell Expenses:Gasoline 11 GAL @{=$2.299@} @@ $2.30 Assets:Checking $-25.30 it doesn't balance, so ledger isn't auto generating anything for me with regarding to this posting. I must enter it myself: 2009/01/01 Shell Expenses:Gasoline 11 GAL @{=$2.299@} @@ $2.30 Assets:Checking $-25.30 Expenses:Bad Gas Station Rounding $0.01 So what does the manual mean when it says it "auto-generates a balance posting in this case to Equity:Capital Losses to reflect the 1.1 cent difference, which is then balanced by Assets:Checking because its amount is null." ? And, if I need to enter the transaction myself anyway, what use are the Equity:Capital.* entries anyway? I'm convinced this entire feature should be rethought, or at the very least made optional in the meantime. -- -- bkuhn