When an event occurs giving rise to a chargeable occasion by reason of TCGA92/S25, see CG42130, the assets involved are deemed to have been disposed of at their market value immediately before the change took place and to have been immediately reacquired at that value. You should therefore include that value in the computation as the disposal consideration.
The acquisition cost should be arrived at on the normal basis as for gains on disposals, see CG42160. You should not allow an acquisition cost based on the value of the asset at the date trading through the permanent establishment started.
The normal rules apply for all other items appearing in the computation.