On Tue, Aug 1, 2023 at 12:11 PM Eric Altendorf <[email protected]> wrote:
> On Sun, Jul 30, 2023 at 8:52 AM Martin Blais <[email protected]> wrote: > >> On Wed, Jul 19, 2023 at 6:44 AM Eric Altendorf <[email protected]> >> wrote: >> >>> Just found this thread. I think I'm encountering similar issues; >>> difficulties tracking assets that have been transferred. >>> >>> Have there been any developments on this front since? >>> >> >> No >> > > FWIW, I *think* things are working for me by using both: > > 1) The {USD} cost hack to pass cost basis info > > 2) The ZeroSum account pattern to decouple the outgoing half of the > transfer from the incoming. I haven't actually plugged in RedS's plugin > but the balances in the intermediating > virtual "buffer" accounts show me how close I am to properly accounting > for both the incoming and outgoing amounts. > I spoke too soon, its not working :) I reread the thread, here's my understanding of the current state: - You implemented at least some aspects of the solution in a plugin in this patch <https://github.com/beancount/beancount/commit/9e6e8f8c3793982a6de5af5321e3026d326f8170> - That plugin appears to have ended up in beanlabs here <https://github.com/beancount/beanlabs/blob/master/beanlabs/plugins/transfer_lots.py> - This issue <https://github.com/beancount/beancount/issues/614> was also filed I'm willing to spend some cycles on this problem if I can understand a bit more. Some initial questions: What does the beanlabs plugin implement, and what is left to do? What does the filed issue cover, and how does that relate to the patch? Do you want this behavior in a plugin? Should transferring cost be a default behavior (personally, I would think so; transfers may be more common for crypto, but it seems more correct for any asset -- I have transferred equities between brokerages as well and I needed to transfer lots and cost basis there too) > > >> >> >> >>> >>> On Saturday, June 5, 2021 at 4:05:36 PM UTC-7 Red S wrote: >>> >>>> Glad it helped. I'll post the python file if I find it. Meanwhile, here >>>> is a dummy skeleton of a vim function written in python to serve as an >>>> example. I find these useful to save for somewhat rare (say once/twice a >>>> year) but repeated transformations. Eg: stock splits. I can never remember >>>> the syntax of vimscript since I rarely use it, and hence, writing these in >>>> python helps. >>>> >>>> # to be run on bean-doctor context output inside vim >>>> function! CapGains() >>>> python3 << EOF >>>> import vim >>>> from decimal import Decimal >>>> >>>> line = vim.current.line >>>> s = line.split() >>>> account = s[0].replace('Assets', 'Income') >>>> vim.current.line = f'{line} ; Hello world: {account}' >>>> EOF >>>> endfunction >>>> >>>> >>>> On Saturday, June 5, 2021 at 12:59:13 AM UTC-7 >>>> [email protected] wrote: >>>> >>>>> Thanks, some neat ideas there! :D >>>>> >>>>> On Saturday, 5 June 2021 at 3:04:46 pm UTC+10 [email protected] >>>>> wrote: >>>>> >>>>>> On Friday, June 4, 2021 at 8:40:54 PM UTC-7 >>>>>> [email protected] wrote: >>>>>> >>>>>>> Apologies for bumping an old thread with an off-topic question, but >>>>>>> Redstreet, you said: >>>>>>> >>>>>>> > I personally have a vim plugin that uses bean-doctor context to >>>>>>> insert the lots. >>>>>>> >>>>>>> This is really interesting; I wonder if this is something that's >>>>>>> openly available or if it's a personal hack whether you'd be interested >>>>>>> in >>>>>>> sticking it on Github? >>>>>>> >>>>>> >>>>>> For conversions, it's trivial: it's a 2 or 3 line python script that >>>>>> scales the units and cost fields. When I have an imported transaction >>>>>> that >>>>>> looks like: >>>>>> >>>>>> 2000-01-01 * "Upgrade shares" >>>>>> Assets:XTrade:ABC -234.15 ABC >>>>>> Assets:XTrade:DEF 175.45 DEF >>>>>> >>>>>> Then what I do is: get beancount context (I've mapped this to '\g' in >>>>>> vim-beancount), which opens the context in a split. I then select (visual >>>>>> mode) all the ABC lots, and pipe it through the python script. An >>>>>> equivalent awk script would look roughly like: >>>>>> >>>>>> :'<,'>!awk '{print $1, -$2*(175.45/234.15), $3, $4, >>>>>> $5*(234.15/175.45), $6, $7}' >>>>>> >>>>>> My python script just made this easier by spitting out both sides of >>>>>> the transaction (DEF as well), and accepting parameters for the scale >>>>>> value. >>>>>> >>>>>> >>>>>> >>>>>> -- >>> 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/2a9684b7-8c10-47ee-8bec-bd58c1095023n%40googlegroups.com >>> <https://groups.google.com/d/msgid/beancount/2a9684b7-8c10-47ee-8bec-bd58c1095023n%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%2BhMisGxYyhdEk2RpFB-UWPz40T3wv7seWog-qyaC5qJEew%40mail.gmail.com >> <https://groups.google.com/d/msgid/beancount/CAK21%2BhMisGxYyhdEk2RpFB-UWPz40T3wv7seWog-qyaC5qJEew%40mail.gmail.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/CAFXPr0tuQ79mHH8OUCNeSH4CeiocB9NCYqe25hMYXCkDg0PQvA%40mail.gmail.com.
