Sorry for the slow reply to this (my own thread even...).  I wanted to
think about it and got caught up in life.

The issue of keeping an inventory of commodities isn't lost on me.  It's
definitely a difficult problem.  For the most part, I like how ledger does
it.  However, I'm making a move to Japan in a month and I have not been
able to figure out if the tax man likes FIFO, LIFO or weighted average
cost.  I've been practicing all three in Ledger :-)

I may be wrong, but the ability to choose whatever capital gains you want
(or whatever non-existant lot-price you want) seems to be useful for doing
weighted average cost.  Of course your lot-price inventory gets completely
blown out of the water, but presumably you don't care about that in this
case -- you just want to make sure that the amount of money balances.

My main issue for bringing this up was some pain that I had when I entered
the wrong price for something by accident.  When I realized (much later), I
had to change the lot-price for every transaction after it.  Not a pleasant
experience.  I was looking for a notation that made the lot price more
implicit.  In retrospect, this is probably a bad idea.  The pain of
updating the journal is far outweighed by having the software pick the
wrong lot-price silently ;-)

The Beancount notation is interesting.  Do you support weighted average
cost as well?

On 22 September 2014 23:31, Martin Blais <[email protected]> wrote:

>
>
>>> As you can see, I start with $500,000 and buy one house for $100,000 and
>>> the other for $120,000.  I can sell the house and realize the capital gains
>>> with:
>>>
>>> 05/01 Sell House A
>>>   Assets:HOU            -HOU 1
>>>   Assets:CAD             CAD 105000
>>>   Income:Gains          -CAD 5000
>>>
>>> I was impressed that Ledger even figures out the cost of the house and
>>> removes the correct lot price when I inspect the balance with
>>> --lot-prices!  So far so good.
>>>
>>
>> Actually, that's not really what you would want the system to do, because
>> that's ambiguous: which of the houses are you selling? The fact that Ledger
>> does not fail on this is not reassuring to me. What you would want in this
>> case is for the system to barf an error indicating that you need to
>> disambiguate which of the HOU units you're selling: the one at 100000 CAD
>> or the one at 120000 CAD?
>>
>> In fact, you might as well put any amount in the gains postings and
>> Ledger will accept it; try putting 15000 instead:
>>
>> 05/01 Sell House A
>>   Assets:HOU            -HOU 1
>>   Assets:CAD             CAD 105000
>>   Income:Gains          -CAD 15000
>>
>> Here are the balances I get
>>
>>
>>
>> ledger -f /Users/blais/tmp/charlton.ledger bal --lot-prices --no-color
>>
>>           385000 CAD
>>
>>   -1 HOU {90000 CAD}
>>
>>   1 HOU {100000 CAD}
>>
>>   1 HOU {120000 CAD}  Assets
>>
>>           385000 CAD    Bank
>>
>>   -1 HOU {90000 CAD}
>>
>>   1 HOU {100000 CAD}
>>
>>   1 HOU {120000 CAD}    House
>>
>>          -500000 CAD  Equity:Capital
>>
>>           -15000 CAD  Income:Gains
>>
>> --------------------
>>
>>          -130000 CAD
>>
>>   -1 HOU {90000 CAD}
>>
>>   1 HOU {100000 CAD}
>>
>>   1 HOU {120000 CAD}
>>
>>
>>
>> In the cases which aren't ambiguous, down the road, this will be allowed
>> in Beancount:
>>
>> 2014-05-01 * "Sell House A"
>>   Assets:House            -1 HOU {}
>>   Assets:Bank         100000 USD @ 1.05 CAD
>>   Income:Gains         -5000 CAD
>> See this working doc for more detail:
>> http://furius.ca/beancount/doc/proposal-inventory
>>
>>
> I fat-fingered this one somewhat (sometimes I despise writing mail in a
> web browser textarea on a laptop loosely hanging off my knees).
>
> I also meant to add: notice how no error is issued in the Ledger example
> with -15000 CAD in gains. This will only match the correct HOU unit if you
> get your capital gains right.  This means if you make an error, it goes
> unnoticed and you get funky inventory results (not only you still have both
> houses, you're now "short" a house at a cost of 90000 CAD). Moreover,
> unless you put the cost in yourself - and you better get it right - you
> can't let it calculate the gains for you automatically.
>
> The inventory booking method I enforced in Beancount firmly prevents this
> mistake from occurring. Lot reductions _always_ must match existing
> inventory. This is one of the main differences between our systems and this
> example is illustrative of the kind of pitfalls I'm trying hard to prevent
> users (and myself) from falling into. It's so, so easy to make small
> numerical mistakes when entering data (and some data is inevitably entered
> by hand in practice).
>
> For more, read here:
>
> https://docs.google.com/document/d/1dW2vIjaXVJAf9hr7GlZVe3fJOkM-MtlVjvCO1ZpNLmg/edit#heading=h.kqx4yya021of
>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to