Why is booking done before plugins

56 views
Skip to first unread message

Martin Michlmayr

unread,
Apr 8, 2020, 10:19:00 PM4/8/20
to bean...@googlegroups.com
A non-profit I'm working with is moving to beancount. They have some
transactions in foreign currency and we had this idea of looking up
exchange rates from the pricemap and adding cost and price
automatically in a plugin where appropriate. A proof-of-concept plugin
worked fine but then I ran into a fundamental issue: beancount does
interpolation and booking before plugins.

Doing interpolation before plugins makes sense, but I don't understand
why the booking code runs at such an early stage. Are there
fundamental reasons for this or is that something that could be
changed?

--
Martin Michlmayr
https://www.cyrius.com/

Martin Blais

unread,
May 2, 2020, 3:12:04 AM5/2/20
to Beancount
Yes.
It's a catch 22. Booking first allows some more interpolation, and interpolation first allows some more booking. Choosing do to one before the other provides different benefits. I wrote a doc somewhere with a bunch of examples trying to wrap my head around this, and came up with this particular compromise. I remember working hard on figuring out the best solution and I'm not sure I got there, this could potentially be improved, but I think surfacing a lot of the possible types of interpolation & automatic booking combinations will make your head hurt too (it did mine). I can dig it up if you want.



--
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/20200409021848.GD5254%40jirafa.cyrius.com.
Reply all
Reply to author
Forward
0 new messages