The fix for bug #713 changes the way capital gains as well as basis costs
are shown. All of these tests use the same input file, which includes
capital gains and losses. The tests are too long to update and verify
manually but I verified some files and believe the output is correct.
I've therefore updated the tests with the output of the fixed ledger.
Let's take baseline/opt-lot-dates.test as one example. In the past,
ledger generated the following incorrect Equity entries:
190.42G Equity
236.83G Capital Gains
-46.41G Capital Losses
If you compare the end of the diff of the test, you'll see:
- 35.42G
+ -155.00G
The difference is: 35.42 - -155.00 = 190.42
This matches exactly the Equity entries previously generated, which
shouldn't be there.
John's fix for bug #713 changes the way basis cost are calculated.
The patch also fixes#712, which caused ledger to create automatic
Equity:Capital Gains that were not correct. Update the test cases
accordingly after verifying the new output.
Change the definition of cost: in the past, if you bought 1 AAA for
$10 and then sold it for $12, ledger would take $12 as the cost. With
the patch, the original cost of $10 is preserved ss the cost basis.
In my opinion, this brings ledger in line with accounting expectations.
This change fixes bugs #712 and #713.
Bug #712 is about Equity:Capital Gains and Equity:Capital Loss
entries ledger automatically generates that are in my opinion
incorrect.
Bug #713 is about strange behaviour with -B after a capital gain or
loss is made.
Patch from John Wiegley.
ledger.el old ledger mode. I maintain a branch locally to always
restore C-x C-s keyboard shortcut that is so deeply inside my Emacs
muscle memory. I propose to restore this definitely.
completing payees with ledger-magic-tab would add a space when
there was only one possible completion. That space, in ledger's
file format, would always need to be deleted again
it might be helpful when completing accounts to add two spaces, but
the current completion code organization can't (easily) distinguish
between payee and account completion. Adding one space is harmful
to account completion too, in that `ledger-account.*regex' parse
accounts by looking for two spaces, and treat an account name ending
with a single space before the newline as having the space as part
of the account name.