Re: Changes to support cost transfers

2024-08-13 Thread Eric Altendorf
BTW, in case anyone's looking at this, another minor issue with what I shared earlier is that it may mutate the order of some postings within a transaction during booking. I have a different implementation now as well which preserves order and feels a bit less hacky at the expense of being more ve

Re: Changes to support cost transfers

2024-08-11 Thread Eric Altendorf
I've cleaned up and added some unit tests. The preliminary PR is here: https://github.com/beancount/beancount/pull/840 The main issue right now is that it only works for transfers with two equal and opposite augment/reduce postings (and worse, does not gracefully detect and reject more complex fo

Re: Changes to support cost transfers

2024-04-13 Thread Eric Altendorf
Awesome, thanks. This sounds good: 1) I'll add unit tests, try to clean up some of the questions and todos i had, and develop more certainty around the problem and solution 2) I'll share with you my findings and the unit tests, and you can try running it on your data to ensure things match 3) Then

Re: Changes to support cost transfers

2024-04-13 Thread Martin Blais
- There's no dev list, this is it, not enough traffic to justify a separate list. - Your feature touches a very sensitive part of the booking process - one I've struggled to get sort of right in the past, has a lot of weird corner cases, it's been a bit of a whack-a-mole situation - I'd have to rea

Changes to support cost transfers

2024-04-11 Thread Eric Altendorf
I have revisited the work I did earlier to tweak Beancount to propagate cost basis with asset transfers. (As has been discussed, this is a bit of a corner case in general, but is actually very common and important for capital gains calculations for cryptocurrency assets, since they are frequently