From 4f2bd88c0448820e9773133d313f9e5dd00a6994 Mon Sep 17 00:00:00 2001 From: MUHD HAFIFIE Date: Tue, 20 Apr 2021 16:47:17 +0800 Subject: [PATCH] penebusan laporan --- resources/views/khazanah/laporan/penebusan.blade.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/views/khazanah/laporan/penebusan.blade.php b/resources/views/khazanah/laporan/penebusan.blade.php index 61cb897..a806e4d 100644 --- a/resources/views/khazanah/laporan/penebusan.blade.php +++ b/resources/views/khazanah/laporan/penebusan.blade.php @@ -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); } }); } }); }); - } @endsection