New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balance in only USD #648

Closed
artkpv opened this Issue Nov 20, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@artkpv

artkpv commented Nov 20, 2017

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 (р).

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Nov 20, 2017

Owner

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.

Owner

simonmichael commented Nov 20, 2017

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.

@artkpv

This comment has been minimized.

Show comment
Hide comment
@artkpv

artkpv Dec 26, 2017

@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 commented Dec 26, 2017

@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.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Dec 29, 2017

Owner

@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.

Owner

simonmichael commented Dec 29, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment