There is no accurate solution but these methods may help:
1- If the team (club) you are dealing with is in your legue, you must try to sell one of your players to this team (don't sell goalkeeper).
2- If the team you are dealing with is of another league you can do the same but it will be so difficult.
So you can enter transaction history for several times.
Note: please answer these:
1- How can I choose any team to sell my player to?
2- how can I protect players from quiting and retiring for 36or 38 years old?