You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
export const getv = function(a){
|
|
var f = _getVal(a).number();
|
|
if(f != ""){
|
|
return f;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
export const cron = function(){
|
|
try{
|
|
(function(){
|
|
if(window._getVal != undefined){
|
|
const log = _id('info-log');
|
|
const sisa = getv('sisa');
|
|
const sisajasa = getv('sisajasa');
|
|
const pokok = getv('shu') + getv('nonshu');
|
|
const bunga = getv('bunga');
|
|
const discount = getv('discount');
|
|
_setval('pokok', pokok.currency(0));
|
|
_setval('bayar', (pokok + bunga - discount).currency(0));
|
|
var logData = "";
|
|
if (pokok > sisa){
|
|
logData += " Input pokok melebihi sisa. ";
|
|
}
|
|
if (bunga > sisajasa){
|
|
logData += " Input jasa melebihi sisa. ";
|
|
}
|
|
log.innerHTML = logData;
|
|
}
|
|
})();
|
|
}catch(e){
|
|
console.log(e);
|
|
}
|
|
setTimeout(function(){
|
|
cron();
|
|
},100);
|
|
} |