function openInterest(){var n=parseFloat($("#price_auto1").val().replace(/\./g,""));n>0&&$("#txtMoney").val(addPeriod(Math.round(n/2)));$("#interest").show()}function closeInterest(){$("#interest").hide()}function addPeriod(n){n+="";x=n.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";for(var t=/(\d+)(\d{3})/;t.test(x1);)x1=x1.replace(t,"$1.$2");return x1+x2}function getRepaymentSchedule(){$("#interest_result").empty();var txtMoney=$("#txtMoney"),txtTime=$("#txtTime"),txtInterest=$("#txtInterest"),money=txtMoney.val().replace(/[^0-9]/g,""),time=txtTime.val(),interest=txtInterest.val(),re=/^\d+(\,\d+)?$/;if(!re.test(interest)){CreateMessageError("Invalid percent");return}if($("#lblMessage").empty(),!money||eval(money)<=0){CreateMessageError("Silakan masukkan Jumlah pinjaman");txtMoney.focus();return}if(!time||eval(time)<=0){CreateMessageError("Silakan masukkan Waktu yang dipinjam");txtTime.focus();return}if(!interest||eval(interest)<=0){CreateMessageError("Silakan masukkan Suku bunga");txtInterest.focus();return}var month=parseInt($("#month").val()),month1=parseInt($("#month1").val()),lh=$("#lh").val();if(parseFloat(money)>9999999999){CreateMessageError("Jumlah pinjaman maksimal 9.999.999.999");txtMoney.focus();return}if(parseFloat(interest)>=100){CreateMessageError("Bunga maksimal 100%");txtInterest.focus();return}if(month==1&&time>360){CreateMessageError("Jangka waktu pinjaman maksimal 360 bulan");txtTime.focus();return}if(month==12&&time>30){CreateMessageError("Jangka waktu pinjaman maksimal 30 tahun");txtTime.focus();return}var amount=parseFloat(money),totalMonth=parseInt(time)*month,interest=parseFloat(interest)/month1;lh==1?LaiDeuHangThang(totalMonth,amount,interest):DuNoGiamDan(totalMonth,amount,interest);$(".payment").addClass("pd-bottom-30");$(".wr_table").scrollbar()}function LaiDeuHangThang(n,t,i){for(var f=Math.round(t/n,0),e=t,o=Math.round(t*i/100,0),h=o+f,s=o*n,r='
| Jumlah Periode<\/th>",t+=" | Mulai dari periode yang luar biasa<\/th>",t+=" | Hutang Capital<\/th>",t+=" | Hutang Bunga<\/th>",t+=" | Modal + Bunga<\/th>",t+=" <\/tr>",t+=" <\/thead>",t+=" |
|---|