`bal -X USD` doesn't show multicurrency account balance in the one currency (USD)
bal -X <CURRENCY> doesn't seem to work as manuall suggests - it still not recalculates everything in this one <CURRENCY>.
For example, this is what hledger bal assets -X USD -f test.journal returns:
$2345.000 assets:bank1:cur1
456 CHF assets:bank1:cur2
100 CHF assets:bank2:cur2
200 GBP assets:bank2:cur3
400 CAN assets:bank2:cur4
300 NGN assets:bank3:cur5
--------------------
$2345.000
400 CAN
556 CHF
200 GBP
300 NGN
hledger --version: hledger 1.43.1, mac-aarch64
test.journal:
2025-01-01 Opening balance
assets:bank1:cur1 $2345
assets:bank1:cur2 456 CHF @ $0.5
assets:bank2:cur2 100 CHF @ $0.5
assets:bank2:cur3 200 GBP @ $0.01
assets:bank2:cur4 400 CAN @ $10
assets:bank3:cur5 300 NGN @ $0.005
equity
I assume it should show the summary in just USD rather than showing the same as without -X USD.
Several problems:
-
Your journal uses $ but you've requested value in USD; hledger doesn't know these are the same. Use
-X \$instead. Or, you could declare that $ and USD are equivalent:P 0000-01-01 USD $1 -
hledger doesn't infer market prices from costs by default. Either add some P directives, or add
--infer-market-pricesto the command to infer them.
$ hledger bal assets -X \$ --infer-market-prices
$2345.000 assets:bank1:cur1
$228.000 assets:bank1:cur2
$50.000 assets:bank2:cur2
$2.000 assets:bank2:cur3
$4000.000 assets:bank2:cur4
$1.500 assets:bank3:cur5
--------------------
$6626.500
PS, I am open to suggestions to improve the docs. https://hledger.org/dev/hledger.html#value-reporting mentions P and --infer-market-prices.
You might be coming from Ledger, where inferring market prices from costs is done by default ?
PS, I am open to suggestions to improve the docs. https://hledger.org/dev/hledger.html#value-reporting mentions P and --infer-market-prices.
You might be coming from Ledger, where inferring market prices from costs is done by default ?
Good point. Now I can understand it from the documentation but before you mentioned it wasn't immediately clear, indeed. I will send a PR trying to clarify it better in the documentation.