KapJI / capital-gains-calculator

UK capital gains tax calculator which supports transaction history from different brokers
MIT License
125 stars 48 forks source link

Fix spin-offs calculations #524

Closed nihn closed 4 months ago

nihn commented 5 months ago

This diff fixes Spin-Off cost calculations (both for source and dest shares). Details of the calculations can be found in the comment of the main method. As we do not have a good DB for spin-offs the "source" share has to be provided by user during the run, the adjustments to the prices are then explained in generated .pdf file.

Additionally:

I'll add tests after initial review round.

KapJI commented 4 months ago

Can you rebase on the latest revision?

Btw, will it work correct for B&B case like in #511?

nihn commented 4 months ago

I don't think it will change anything for that B&B case as I am not touching stock splits but B&B should be handled correctly in case of spin-offs (AFAICT, as it just modifies the pool price, I am not tax advisor though :)).

nihn commented 4 months ago

Any idea why the signals are failing? I pulled the branch and it works on my machine:

image
vmartinv commented 4 months ago

Any idea why the signals are failing? I pulled the branch and it works on my machine

You're not including the spin_off_handler file in the commit.

nihn commented 4 months ago

You're not including the spin_off_handler file in the commit.

How did it work before is beyond my understanding though, thanks! :D

KapJI commented 4 months ago

Thanks for working on this! 🚀