Buying and selling are accounted for differently however it is the guaranteed fee that is accounted for, not the x% that is received up front.
So for example you buy a player for £50m on a 5 year deal and you only pay £20m up front with the rest spread over the next 3 years. The fact you only paid £20m up front counts for nothing. That £50m is spread over the life of a players contract so in this case it will cost the club (from an accounting point of view) £10m per season.
When you sell a player, the player has a value which is based on the above - you signed somebody for £50m on a 5 year deal and after 2 years he's now worth £30m. You sell him for £50m and the buying club only pays £10m up front. He's worth £30m and you sold him for £50m so you record a profit of the difference, £20m. The fact that you only physically received £10m up front is irrelevant in relation to the profit/loss you make. Had that player who is worth £30m been sold for £20m, you'd record a loss of £10m on the accounts.