Price Conversion of Commodities

69 views
Skip to first unread message

Toby

unread,
Aug 27, 2021, 12:53:05 PM8/27/21
to Beancount
Hi,
Is this possible on Beancount? I am trying to convert commodities prices.

2021-01-01 * "Purchase 3 Apple"
   Assets:Inventory:Apple     3 Apple @@ 15 USD   ;5 USD per Apple.
   Assets:Cash

I want to know the price of the apples in EUR.

2021-02-01 price EUR 1.50 USD  ; hypothetical example.

It doesn't convert. Is this possible to do on Beancount?
I  also tried it with the plugin "beancount.plugins.implicit_prices" and it doesn't seem to convert the values to EUR.

Thanks


Patrick Ruckstuhl

unread,
Aug 27, 2021, 2:19:41 PM8/27/21
to bean...@googlegroups.com

Hi,

There's no out of the box conversion of prices in different currencies.

I created a plugin that will automatically generate commodity prices based on fx

https://github.com/tarioch/beancounttools

e.g.

plugin "tariochbctools.plugins.generate_base_ccy_prices" "CHF"

If your commodity is priced in EUR and you have an exchange rate EUR -> CHF, then this will also add commodity prices in CHF.

There's also some possibilities to do conversions when doing the query.


Regards,

Patrick

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/718c8283-1c34-4bcf-9eff-5b0f7083b38an%40googlegroups.com.

Toby

unread,
Aug 27, 2021, 2:36:41 PM8/27/21
to Beancount
Hi Patrick,
Nice! Appreciate the plugin. The plugin seems to work flawlessly and its exactly what I was looking for.
Thank You,
Reply all
Reply to author
Forward
0 new messages