penebusan laporan
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user