* John Wiegley <[email protected]> [2012-03-17 23:08]:
> > Let's say I have 1 AAPL which I bought at $10 and now I sell it for $20.
> > I'd say:
> >     Assets:Investments -1 AAPL {$10.00} @ $20.00
> 
> > What is the price and what the cost?  Is $10 really the price and $20 the
> > cost according to ledger?  I'd expect the exact opposite.  ledger -B shows
> > $-20 while -I shows $-10.
> 
> The shares you are selling *had* a price of $10, and you are selling them at a
> (negative) cost to you of $-20.  Price is always an attribute of the
> _commodity_, while cost is always an attribute of the _posting_.

Thanks for this clarification.  Your last sentence in particular
clarifies a lot for me.

I see how price and cost makes sense from ledger's point of view.  I'm
worried though that cost basis doesn't always represent the accounting
concept of cost basis and I think that's an important concept that
ledger should support because it's used in a lot of cases.

I wonder whether fixing the behaviour described in bug 713 would bring
ledger's cost basis concept back in sync with the accounting concept.

Let's take an example (from bug 713): I buy 1 AAA for $10 and 1 BBB
for $15 and then sell the 1 AAA for $12.
According to ledger, the costs are:
 - AAA: $10 (when buying) and $-12 (when selling)
 - BBB: $15
And -B on my investment account will add up all of these costs:
$10 + $-12 + $15 = $13

And this is where the "cost basis" no longer represents the accounting
concept of cost basis -- my investment account only contains BBB and
the cost basis of 1 BBB is $15.  ledger should not take the costs of
commodities into account which are not in the account anymore.

To show this better, let's take this example: 1 buy 1 AAA for $10 and
then sell this 1 AAA for $12.  The costs are: $10 and $-12, and ledger
-B on the investment account - which is now empty - will show $-2.

How can the cost basis of an empty account be $-2?

I believe if you fix bug 713 by only taking the costs of current
commodities into account (i.e. things that are still in my account and
haven't been sold previously), the cost basis concept would reflect
that in accounting again. (I'm not sure if there are other scenarios
where ledger's understanding of cost basis doesn't reflect the
accounting concept, but so far I only ran into this particular case.)

-- 
Martin Michlmayr
http://www.cyrius.com/

Reply via email to