288. Balancing allowances and balancing charges.
(1) Subject to this section, where any of the following events occurs in the case of any machinery or plant in respect of which an initial allowance or a wear and tear allowance has been made for any chargeable period to a person carrying on a trade -
(a) any event occurring after the setting up and before the permanent discontinuance of the trade whereby the machinery or plant ceases to belong to the person carrying on the trade (whether on a sale of the machinery or plant or in any other circumstances of any description),
(b) any event occurring after the setting up and before the permanent discontinuance of the trade whereby the machinery or plant (while continuing to belong to the person carrying on the trade) permanently ceases to be used for the purposes of a trade carried on by the person,
(c) the permanent discontinuance of the trade, the machinery or plant not having previously ceased to belong to the person carrying on the trade,
(d) in the case of machinery or plant consisting of a specified intangible asset within the meaning of section 291A, computer software or the right to use or otherwise deal with computer software, any event whereby the person grants to another person a right to use or otherwise deal with the whole or part of that machinery or plant in circumstances where the consideration in money for the grant constitutes (or, if there were consideration in money for the grant, would constitute) a capital sum,