KapJI / capital-gains-calculator

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

Test for splits #541

Open sygi opened 2 weeks ago

sygi commented 2 weeks ago

(Failing, do not merge) test showing wrong handling for stock splits.

KapJI commented 2 weeks ago

Can you fix this issue?

sygi commented 2 weeks ago

I'm afraid I might need some support with this. In my mind, splits are basically an accounting trick: what was considered 2 stock yesterday is 10 units today, but there is no other effect. I tried to implement this above by changing the past acquisitions/disposals to operate in post-split space, but this leads to issues about pre-split reporting (if you sold one of the two units before split, it's 1 unit, not 5). This has been used in mssb.py so far.

One alternative I see is to enhance the HmrcTransactionData to keep an information about being ignored for matching purposes but then we'd need to remember about the conversion whenever we cross the line.

WDYT?