You have to divide the transfer fee by the length of the contract, which give you the yearly amortization of the fee on the debt side of the accounts.
We you sale a player you have to work out the remaining years of the contract and times it by the yearly amortisation figure to give you a overall figure.
The you have to take that away from the transfer fee received to give you the postive gain (Profit) on our accounts.
For Castange case I believe we brought him for 21m on a 5 year contract, which means his transfer is amortised at 4.2m a season.
If we sold him for 12m with two years left, that 12m - (4.2m x 2 years) 8.4m = 3.6m profit
However we may have carried out Player Impairment as a result of relegation which reduces the value of the squad, which can impact of the remaining amortised figure for each player which can change that calculation.