Section 338 | Writing off capital value which has been realised
From legislation.gov.uk
If a balancing event within section 328 occurs (realisation of capital value), an amount equal to any capital value realised is written off at the time of the event.F1