penebusan laporan

This commit is contained in:
MUHD HAFIFIE
2021-04-20 16:47:17 +08:00
parent 795c94d566
commit 4f2bd88c04
@@ -100,20 +100,23 @@
}
});
});
function tebustable(data){
async function tebustable(data){
var counter = 1;
var total_pinjaman = 0;
tabletebus.clear().draw();
$.each(data,function(index,tebus){
$.ajax({
url:api_url + '/api/gadai/norujukan/' + tebus['norujukan'],
method:'get',
async:false,
success:function(gadai){
$.ajax({
url:api_url + '/api/customers/' + gadai[0][0]['nokp'],
method:'get',
success: function(customer){
total_pinjaman += parseFloat(tebus['bakipjm']);
console.log(total_pinjaman);
tabletebus.row.add([
counter,
customer[0]['nama'],
@@ -124,12 +127,13 @@
tebus['bakiupah'],
tebus['bakipjm']
]).draw();
counter = counter + 1;
$('#jumlah_pinjaman').text('RM '+ total_pinjaman);
}
});
}
});
});
}
</script>
@endsection