Hledger: Balance in only USD

Created on 20 Nov 2017  路  3Comments  路  Source: simonmichael/hledger

Hello! Thanks for the great tool!

Newbie question here. I have transactions in $ and in RUB. How can I make 'hledger balance --monthly Income -b 2017-06 --value' only in $? This displays report in RUB. In my journals default currency is set to RUB (褉).

A BUG cli docs easy? journal

All 3 comments

Welcome @artkpv. Have you seen http://hledger.org/manual.html#market-value ? See also http://hledger.org/hledger.html#cost.

If this was too hard to discover, let's discuss how to improve the help/docs.

@simonmichael Thanks for the hints! How to make this balance command to display it only in RUB? I guess if I put P directive with desired currency last it should be used. Now it outputs:

hledger -f test.ledger bal -V
              USD 10  Cash
           RUB -1000  OpenBalance
              ABC 10  Stocks
--------------------
              ABC 10
           RUB -1000
              USD 10

test.ledger:

2017/12/11 
  OpenBalance    
  Cash    RUB 1000

2017/12/11
  Cash    RUB -1000
  Cash    USD 100

2017/12/12 
  Cash      USD -90
  Stocks    ABC 10

P 2017/12/20 USD RUB 15
; 9 * 15:
P 2017/12/20 ABC RUB 135

And here is a draft for Q&A item. Probably useful.

How to show balance report in one or more desired currencies?
You can show it either in a market price (-V/--market) or in a transaction price (-B/--cost). To show your balance report in some other currency you should have prices from your transaction currency to the desired currency. And these prices should come last. For a transaction price, make your desired currency to be last. For a market price, put your desired currency price last in your price list.

@artkpv I see now you are running into #683 - by default -V uses market prices as of the last transaction's date. You can see it working when a later date is specified:

$ hledger -f examples/648.journal bal -V -e 2017/12/31
             RUB 150  Cash
           RUB -1000  OpenBalance
            RUB 1350  Stocks
--------------------
             RUB 500

I think we'll have this fixed shortly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Timonsc picture Timonsc  路  4Comments

simonmichael picture simonmichael  路  8Comments

varac picture varac  路  9Comments

adityag81 picture adityag81  路  5Comments

MisterY picture MisterY  路  9Comments