Skip to content
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
Closed

Balance in only USD #648

artkpv opened this issue Nov 20, 2017 · 3 comments
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. cli Command line parsing, options, arguments and suchlike. docs Documentation-related. journal The journal file format, and its features.

Comments

@artkpv
Copy link

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
Copy link
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.

@simonmichael simonmichael added cli Command line parsing, options, arguments and suchlike. docs Documentation-related. easy? journal The journal file format, and its features. labels Nov 20, 2017
@artkpv
Copy link
Author

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
Copy link
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.

@simonmichael simonmichael added the A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. label Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. cli Command line parsing, options, arguments and suchlike. docs Documentation-related. journal The journal file format, and its features.
Projects
None yet
Development

No branches or pull requests

2 participants