JAKARTA, Dec 6: Indonesia's parliament approved a new criminal code on Tuesday that bans sex outside marriage with a punishment of up to one year in jail, despite worries the laws may scare away tourists from its tropical shores and harm investment.