first you need to do pay as you go to that number with which you want a pac code.after that you can transfer the same number to a new contract number with a same network with out transfering to another network first.
but for pay as you go , u need to pay all remaining fee for the rest of the contract if your old number is on the contract.
this is the only solution.
it takes maximum 24 hours for Pay as you go and when its done it takes more 24 hours to transfer on a contract number.
for more details contact three.