The last post was about accounting bond with interest. At the end, it contained a little cheating. For simplicity, the buying price was used at September 1. So there was not capital gains and the bond was not sold yet. What should we do if there is capital gains and the instrument is not sold yet? Let us say that we bought 1 share for 10, its current value is 15 and the tax is 20%. For simplicity this share does not pay dividend and there is no corresponding fee.
Ignore capital gains tax until sell
You do not pay tax for unrealized gains, unrealized means you did not sell the instrument yet, so it make sense to ignore capital gains tax until you sell the it. Unrealized gains is uncertain, it can happen that tomorrow the price will drop to 12 or even to 8 so you will have negative capital gains, which means no tax.
Using "Capital gains tax percentage"
On the other hand, one can argue that if the capital gains is 5 and the tax is 20% then the 1 capital gains tax should be taken into account. This can be done if you fill in the "Capital gains tax percentage" at the buying transaction. This is not a perfect solution because the tax might be calculated with a complex formula.
Add the buying transaction to the "Transactions" tab. Create "Category" and the category for "Capital gains tax". Do not fill the "Capital gains tax percentage" for the time being.
Now the "Instrument values" tab shows the 5 "Capital gains" and no tax.
Provide the 20% "Capital gains tax percentage" at the "Transactions" tab. The value should be entered as "0.2" but it is displayed as 20%. Now the "Instrument values" tab shows the 1 "Capital gains tax". If there is a dedicated transaction for the capital gains tax (because the share is sold), it appears in the "Actual capital gains tax" column. If there is no such row then the "Gross capital gains" and the "Capital gains tax percentage" are used.
This seems to be a small feature but actually this makes the calculation complex but more realistic. But you have to decide if you want to use this feature or not.