No need to get visa on arrival if you can use the international transfer route at CGK. However, you will need to pay departure tax at the gate (all major currencies accepted albeit at lousy exchange rates) and you will also need to rush to the gate to allow enough time for gate security and check in (if you don't already have the return boarding pass).