-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
You can't sell asset after transfer. #1
Comments
Hi, just wanted to check whether this was still a problem or if its been resolved? |
It hasn't been resolved. I don't actually remember if I even looked into it or just forgot about it. Anyway, having looked into it a bit I'm not sure it can be fixed. Here's the problem (I think). It is caused by using the {} in the In loader.py around lines 506-513 it looks like the loader runs "interpolation" on incomplete booking entries before it runs "transformations" from plugins. So the {} gets triggered (and then fails because it can't find enough matching holdings) before the asset_transfer plugin has a chance to run and actually generate the holdings. You can workaround this by not using {} and instead specifying the lots explicitly. That is, instead of
You need to write `2021-04-04 * "Sell 2.9 VTI"
` Obviously this isn't great since it means you can never use {} with this plugin, which probably isn't the answer anyone is looking for. (I never use {} which it why it never came up in my usage.) So I think I need to leave as "Can't Fix", unfortunately. I haven't really followed the 3.0 development so I don't know if this can be fixed over there. |
A solution to this is to not run this as a plugin but as a script to output the relevant transactions & append to the ledger beancount file. Pre-condition for below quick fix: NO sales post the transfer date. If this is the case, the cost basis gets expanded incorrectly as outlined by hoostus The script is quite easy to modify for the above purpose:
Then just run If you want FIFO (as some countries require, e.g., Germany), change
|
Hello,
There's a bug where you can't sell an asset after transferring if you didn't have enough of that asset before the transfer.
The plugin correctly sets the balances but it doesn't work regardless
error:
The text was updated successfully, but these errors were encountered: