Yes. This is a flaw of the plugin approach to solving this problem - I
recommend you deploy one of the other solutions from prior threads on this
list about transferring lots between accounts. I am personally a fan of the
bean-doctor integration of the beancount emacs plugin for this task.

On Sat, Nov 12, 2022 at 1:06 AM Peter <[email protected]> wrote:

> Hi,
>
> thanks for the answer. So, „there's no hope“ here until v3 (if it includes
> pre-booking plugins)?
>
> [email protected] schrieb am Freitag, 11. November 2022 um 22:14:33 UTC+1:
>
>> This should probably be a FAQ.
>> See recent thread: https://groups.google.com/g/beancount/c/88WjwEhJKUk
>> and many before.
>>
>> In short: Booking runs before plugins
>> <https://github.com/beancount/beancount/blob/3ec62d4d8e68f352156eec6c7068b8aee8fc65f1/beancount/loader.py#L531>.
>> There's been discussion in the past about having pre-booking plugins, it
>> would certainly be helpful in a case like this.
>>
>>
>> On Fri, Nov 11, 2022 at 7:19 AM Peter <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I'm using the transfer_lots plugin to transfer lots between accounts.
>>>
>>> Sadly, after one transfer the lot seems to be locked. I.e., the `failed
>>> to categorize posting` error occurs.
>>> See this MWE:
>>>
>>> option "booking_method" "FIFO"
>>> option "operating_currency" "USD"
>>> plugin "beancount.plugins.auto_accounts"
>>>
>>> option "insert_pythonpath" "True"
>>> plugin "Plugins.transfer_lots" "transfer"
>>> plugin "beancount.plugins.implicit_prices"
>>>
>>> 2021-01-08 * "" "Buy LOT"
>>> Assets:Broker:LOT 1.25 LOT { 600 USD }
>>> Equity:Opening-Account
>>>
>>> 2021-01-10 * "" "Transfer LOT" #transfer
>>> Assets:Broker:LOT -1.25 LOT {}
>>> Assets:Storage:LOT
>>>
>>>
>>> 2021-03-11 * "Buy more LOT"
>>> Assets:Broker:LOT 0.25 LOT { 800 USD }
>>> Equity:Opening-Account
>>>
>>> 2021-03-12 * "Transfer LOT" #transfer ; failed to categorize posting
>>> Assets:Storage:LOT -1.25 LOT {}
>>> Assets:Storage2:LOT
>>>
>>> 2021-04-10 * "Transfer LOT" #transfer
>>> Assets:Broker:LOT -0.25 LOT {}
>>> Assets:Storage2:LOT
>>>
>>> 2021-04-10 * "Transfer LOT" #transfer ; failed to categorize posting
>>> Assets:Storage2:LOT -0.25 LOT {}
>>> Assets:Storage:LOT
>>>
>>> Why is that and what can I do here, to make this work?
>>>
>>> Editing the last txn to: (inspired by github issue 541)
>>> <https://github.com/beancount/beancount/issues/541>
>>>
>>> 2021-04-10 * "Transfer LOT" #transfer ; failed to categorize posting
>>> Assets:Storage2:LOT -0.25 LOT {USD}
>>> Assets:Storage:LOT 0
>>>
>>> Doesn't work, either:
>>>
>>> ** Balances before transaction --------------------------------
>>>
>>>   Assets:Storage2:LOT                     0.25 LOT {800 USD, 2021-03-11}
>>>
>>>   Assets:Storage:LOT                      1.25 LOT {600 USD, 2021-01-08}
>>>
>>>
>>> ** Unbooked Transaction --------------------------------
>>>
>>> 2021-04-10 * "Transfer LOT" #transfer
>>>   Assets:Storage2:LOT                            -0.25 LOT {}     ;
>>>
>>>   Assets:Storage:LOT   0 <class 'beancount.core.number.MISSING'>  ; 0
>>> <class 'beancount.core.number.MISSING'>
>>>
>>>
>>> ** Transaction --------------------------------
>>>
>>> 2021-04-10 * "Transfer LOT" #transfer
>>>   Assets:Storage2:LOT  -0.25 LOT {-0 USD, 2021-04-10}  ;  0 USD
>>>   Assets:Storage:LOT    0.25 LOT {-0 USD, 2021-04-10}  ; -0 USD
>>>
>>>
>>> ** Residual and Tolerances --------------------------------
>>>
>>>
>>>
>>> ** Balances after transaction --------------------------------
>>>
>>>   Assets:Storage2:LOT                     0.25 LOT {800 USD, 2021-03-11}
>>> * Assets:Storage2:LOT                     -0.25 LOT {-0 USD, 2021-04-10}
>>>
>>>   Assets:Storage:LOT                      1.25 LOT {600 USD, 2021-01-08}
>>> * Assets:Storage:LOT                       0.25 LOT {-0 USD, 2021-04-10}
>>>
>>> Any help/input is greatly appreciated. How can I "unlock" the lots and
>>> transfer them more than once?
>>>
>>> Regards
>>>
>>> --
>>> 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/5785792c-695a-4c5c-94d2-3adcc090aed7n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/beancount/5785792c-695a-4c5c-94d2-3adcc090aed7n%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/f7870d92-daa1-4eca-8bb9-4e6689858dc1n%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/f7870d92-daa1-4eca-8bb9-4e6689858dc1n%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/CACGEkZv9JGvi7EkEM16uyHqLyhOD94wQ_8TDhw77djVMYFKX_w%40mail.gmail.com.

Reply via email to