Kabayan, check your contract and see if there's a provision in your contract that mentioned ''if youre not able to complete fully the duration specified on youre contract'' you will be liable to pay the remaining of the contract or the amount that was incurred by the company when they hired you (i.e visa,plane ticket etc.)

As for myself I have that clause/provision in my contract, but my contract is only for a year then the company have the rights to extend or terminate me after the duration of my contract.

You have 2 choices now, its either you still want to go and leave the company and face the consequences or stay with the company and face the consequences too. I dont know your reason why you are leaving the company but I hope everything will be ok.

Goodluck and God Bless.