ledger-dashboard
ledger-dashboard copied to clipboard
Support for accounts with multiple currencies
I realize this may be a long shot, as probably you made this for yourself and have no need for it, but it would be great if this supported multiple currencies/commodities for the same account.
Or perhaps an option to convert everything just to one currency to view it.
Thanks, I was planning to make this more general indeed. Any idea how I could support multiple currencies / commodities?
You asked for an example ledger, two transactions can demonstrate it:
commodity USD
commodity GBP
2015/12/05 * Party City
Expenses:Gift 7.01 USD
Assets:US:Checking
2015/12/06 * Amazon.co.uk
Expenses:Gift 26.28 GBP
Liabilities:UK:BoE
The issue is when one account (Expenses:Gift) has transactions in multiple commodities.
Depending on the query, particularly with the csv command (and custom formats), I have to limit my queries with -l "commodity=~/GBP/"
edit: personally I'd be happy having everything converted to one currency, so maybe a setting to do so, but again if you're making it general others might not want that.
+1 currently out of the box I cannot use ledger-dashboard at all, as the minute I start it it blows up with Error: Cannot convert a balance with multiple commodities to an amount
I had to create a trivial wrapper forcing -X GBP
on ledger and pass that to ledger-dashboard which is fine for my use case.
I'm working on a fix for this.
Can you try the feature/multiple-currencies branch?
I could only get it to work by enabling the limit_currency setting.
Although the headings: Accounts, Expenses previous month, and Expenses this month all showed no information.
Without the currency limit the error is as before. I'm not sure why the -X isn't working though.
sh.ErrorReturnCode_1
sh.ErrorReturnCode_1:
RAN: '/usr/bin/ledger --no-color --file=/home/alex/money/money.ledger csv ^Income -X GBP'
STDOUT:
"2015/10/31","","Interest","Income:Interest","GBP","-0.0065","*",""
"2015/11/30","","Interest","<Adjustment>","","0","",""
STDERR:
While evaluating value expression:
quoted(commodity(scrub(display_amount)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
While converting 0.08 GBP
-0.12 USD to an amount:
While calling function 'commodity 0.08 GBP
-0.12 USD':
While calling function 'quoted <#EXPR commodity(scrub(display_amount))>':
While handling posting from "/home/alex/money/assets.us.checking.ledger", line 18:
>
Error: Cannot convert a balance with multiple commodities to an amount
-X
is only working when you specify the conversion rate somewhere (pricedb, or inline). Something like this worked for me:
2015/12/05 * Party City
Expenses:Gift 7.01 USD @0.69GBP
Assets:US:Checking
-X? What are the command switches, I'll add them to the readme.