On Sun, Nov 2, 2014 at 5:10 PM, Martin Michlmayr <[email protected]> wrote:

> * Martin Blais <[email protected]> [2014-11-02 16:58]:
> > 1. Can somebody explain how the treatment of "@ price" vs. "{price}"
> > differs? Other members of this list have previously pointed out to the
> docs
> > that say that they are entirely equivalent. Based on the previous change,
> > they appear not to be. This needs clarification IMO.
>
> {price} is the lot price, i.e. the original cost.  @ price is what
> it's worth now.  e.g. you could have 1 AAA {5.00 GBP} @ 6.00 GBP - you
> bought it for 5 and now you're selling it for 6.
>
> Why are {price} and @ price handled differenly?  I think this is a
> bug.  See http://bugs.ledger-cli.org/show_bug.cgi?id=630


This makes sense, thanks for the link.

I think as you explore issues related to fixing that bug, eventually you
might end up considering the same model I've using for currency
conversions, it avoids the problem with well-defined and simply understood
meaning:
https://bitbucket.org/blais/beancount/src/2376dd522c03977955e6915153a3a1cfd8a47724/src/python/beancount/core/complete.py?at=default#cl-28

Another option that might be considered as a fix is the implementation of
GnuCash's "Trading Accounts" method.  I'm considering writing a plugin to
automatically do that in Beancount, so the user could choose to use Trading
Accounts (with no effort required, would happen automatically) or the
conversions patch-up method I currently use.



> 2. What is the correct way to convert my original transaction to Ledger
> > syntax?
>
> I think for now:
>
>   Assets:CA:Investment:GOOG          5 GOOG {520.0 USD} @ 520.0 USD
>   Expenses:Commissions            9.95 USD
>   Assets:CA:Investment:Cash   -2939.46 CAD @ 0.8879 USD
>

This works indeed.  Adding the price seems to have no other effect on the
balances report than to make it accept the input, it's odd (and perhaps
insert that as a price entry in the price db?). This will work for my
conversion.  (I was halfway through splitting the entries in two, a
conversion entry and a stock purchase entry. Thanks for the quick reply.)

Thanks Martin!


P.S. I think it might be worthwhile for someone to spell out the balancing
algorithm in detail in the docs.



--
> Martin Michlmayr
> http://www.cyrius.com/
>
> --
>
> ---
> 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