Opening accounts and specifying booking methods within plugins

66 views
Skip to first unread message

Red S

unread,
Oct 21, 2022, 10:47:16 PM10/21/22
to Beancount
Does anyone know if it's possible for a plugin to insert an open directive and specify a booking method? Or do plugins run too late in the process to do this? Specifically, if I have this in my source:
option "booking_method" "STRICT"

and if my plugin inserts this:
beancount.core.data.Open(metadata, date, 'Assets:XYZ', currencies, data.booking.FIFO)

The booking method on 'Assets:XYZ' does not get set to FIFO.

Thank you!

Red S

unread,
Oct 21, 2022, 11:29:33 PM10/21/22
to Beancount
Ah, never mind, transactions are booked before the plugins run. In v2, at least. Here is the code.

Martin Blais

unread,
Oct 22, 2022, 5:32:00 PM10/22/22
to bean...@googlegroups.com
You got it.
IIRC I discussed to change this in v3 and also allow pre-booking manipulation of the proto objects that come out of the parser.



--
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/00d5c87c-e7b1-414c-b5e4-262932ef5705n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages