multiple commodities in expenses

210 views
Skip to first unread message

jrgo...@gmail.com

unread,
May 3, 2021, 2:37:47 AM5/3/21
to Beancount
In How Inventories Work, Martin mentions,

"Note that accounts may contain any number of commodities, and this is also true for commodities held at cost, which we’ll see shortly. While this is made possible, I recommend that you define enough accounts to keep a single commodity in each; this can be enforced with the “onecommodity” plugin."

How do you best record and report expenses across multiple currencies.

Building on the example discussed, is it best to then have separate accounts for each currency you operate it?  For example:

Expenses:Restaurants:Canada CAN
Expenses:Restaurants:US USD

Then If you want to see total restaurant spending (say in USD) can you just write the appropriate query in BQL at the node "Expenses:Restaurants"? Will this automatically convert using the prices available or do you have to manually do that conversion? 

I'm trying to figure out how to best structure this as I have this exact scenario in an on-going way across two currencies for almost every category of typical expenses. 

thanks,
Jonathan



Justus Pendleton

unread,
May 4, 2021, 3:57:30 AM5/4/21
to Beancount
On Monday, May 3, 2021 at 1:37:47 PM UTC+7 jrgo...@gmail.com wrote:
Building on the example discussed, is it best to then have separate accounts for each currency you operate it?  For example:

Expenses:Restaurants:Canada CAN
Expenses:Restaurants:US USD

In general, with beancount, the way you want to structure accounts depends on how you want to eventually query data from them. The bad part is that you often don't know that for months/years after using beancount. The good part is that restructuring your beancount file is (relatively) painless if you decide you want things another way.

Anyway, I just have Expenses:Restaurants. I have all my expenses in three currencies. I've never seen any need to have my US spending, my Australian spending, my Vietnamese spending ... oh and what about when I'm only holiday and spend money in Hong Kong Dollars, Singapore Dollars, Euros, and Thai Baht? Make separate sub-accounts for all of those?

What's your use case for separating them into per-currency sub-accounts? Why not just write a query of "select * where account ~ Expenses:Restaurants and currency = USD" if, for some reason, you only wanted the USD expenses?
 
Then If you want to see total restaurant spending (say in USD) can you just write the appropriate query in BQL at the node "Expenses:Restaurants"? Will this automatically convert using the prices available or do you have to manually do that conversion? 

You have to manually do the conversion. There is a convert BQL method.

jrgo...@gmail.com

unread,
May 5, 2021, 1:27:17 AM5/5/21
to Beancount
Thank you for your thoughts on this. I think you are right that having just one category with multiple expenses is easy and as you said you can always convert/query as needed. I think I had originally thought to do that but thought that if one commodity per expense account was being suggested that perhaps there was some alternative approach that would be preferable. I think that approach may make sense for certain ways of using Beancount but for the use case I described I think allowing multiple commodities makes sense. 

Tomáš Vítek

unread,
May 7, 2021, 5:15:13 AM5/7/21
to Beancount
Hi, my approach is a bit different: when I am looking at data about expenses, I want to see an overview in one currency so I can compare month to month data. It doesn't matter for me if I spent it in EUR, CZK or IDR because I am interested in trends. So, I have expenses accounts in just one currency and convert every transaction into this currency. 

I was trying to work with "price" to auto convert EUR to CZK (my local currency), but it didn't work for me. That's why convert every transaction.

Cheers,
Tomas
Reply all
Reply to author
Forward
0 new messages