Sure why not. But you could also write your own booking method that does just this instead? I would call it "CHECK_FIFO". (Problem is it's orthogonal to all the methods, e.g. CHECK_LIFO, etc.. Whatever.)
Right now I don't have a registration mechanism so you'd have to either - patch the code - monkey-patch the code without change the library (not sure if possible) - send me a patch to add a registry so you can do this cleanly On Fri, Jun 4, 2021 at 11:52 PM [email protected] < [email protected]> wrote: > Hi folks, > > I use a FIFO methodology for capital gains but with STRICT booking, > inputting the lots I sell explicitly (relying heavily on vim-beancount's > GetContext, but increasingly also automating this with importers that > accept the prior entries). > > I have two reasons: I'm affected by the "transfer lots with cost" issue > discussed at length in crypto contexts, but a crypto transfer with a fee > means increasing the cost base slightly while preserving the date. All > things considered, this is safer to do explicitly so I can see what's going > on. I also find it personally preferable for everything to be explicitly > expressed in the text. It's aesthetically appealing and reassuring to me > that I haven't misunderstood beancount if it's done explicitly. > > Which brings me to my question: I have in mind a plugin that would check > the transactions after all the parsing and processing is complete, and > assert that the lots I've explicitly reduced are the ones that are > consistent with a FIFO approach. > > I think this is something useful and that I could reasonably write (and > open-source) when I have time, but I wanted to ask if anyone's aware of an > existing plugin that does this? > > A further thought is that if I choose `option "booking_method" "FIFO"`, > then it would be extremely cool if beancount would not just interpolate > missing bookings according to FIFO but also consider it an error if I have > explicitly booked a reduction that doesn't conform to FIFO. I'll leave it > up to Martin to decide whether this validation is in the scope of > `booking_method` or whether this belongs to a plugin. > > Thanks for reading! > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/2a2682b6-83d9-4288-a3d5-c7c5b2659cafn%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/2a2682b6-83d9-4288-a3d5-c7c5b2659cafn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhOM_wY-bpcSv51KL0rvVEecxpAxoRZagoegWAfSGZ92bw%40mail.gmail.com.
