Hello ledger community,

I'm trying to find the best way to use ledger to track my transactions, and 
to calculate capital gains/losses. Is it possible to book commodities in 
one currency, sell them in another on a later date, and providing have 
ledger correctly calculate the capital gains/losses? For example, in this 
made-up transaction, last June I sold 0.75 BTC I'd bought with USD in the 
US for euros. You can see below that the bitcoin was actually from two 
different purchase lots:

P 2014-11-28 EUR 1.245128 USD
P 2016-06-01 EUR 1.12 USD
P 2016-06-03 EUR 1.14 USD

2016-06-03 * Sell BTC via bitsquare
    Assets:Checking:FrenchBank         363.75 EUR
    Assets:Crypto:Bitcoin    -0.53443347 BTC {482.79 USD} [2014-11-28] @ 
485.00 EUR
    Assets:Crypto:Bitcoin    -0.21556653 BTC {531.93 USD} [2016-06-01] @ 
485.00 EUR
    Income:CapitalGains

Where I run ledger bal on that entry, the output ignores the Income account 
entirely, as follows:

     -0.75000000 BTC
          363.75 EUR  Assets
          363.75 EUR    Checking:FrenchBank
     -0.75000000 BTC    Crypto:Bitcoin
--------------------
     -0.75000000 BTC
          363.75 EUR

Its as if it doesn't see the lot price information, and therefore doesn't 
calculate the capital losses of 53.61 USD.

If I manually convert the euros to dollars as shown below, the bal report 
correctly calculates my capital gains (losses).
P 2014-11-28 EUR 1.245128 USD
P 2016-06-01 EUR 1.12 USD
P 2016-06-03 EUR 1.14 USD

2016-06-03 * Sell BTC via bitsquare
    Assets:Checking:FrenchBank           319.08 USD
    Assets:Crypto:Bitcoin    -0.53443347 BTC {482.79 USD} [2014-11-28] @ 425.44 
USD
    Assets:Crypto:Bitcoin    -0.21556653 BTC {531.93 USD} [2016-06-01] @ 425.44 
USD
    Income:CapitalGains

     -0.75000000 BTC
          319.08 USD  Assets
          319.08 USD    Checking:FrenchBank
     -0.75000000 BTC    Crypto:Bitcoin
           53.61 USD  Income:CapitalGains
--------------------
     -0.75000000 BTC
          372.69 USD

So, how does ledger deal with commodity lot currencies? Is there a way I 
can use my price file of conversion rates to tell ledger to convert the 
lots with the rate of their lot purchase date, so that capital gains and 
losses get calculated by ledger? Or are inventory bookings limited to 
records kept within the same currency (which is my understanding of how 
beancount deals with reducing lots)?

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to