fix apa yang patut

This commit is contained in:
MUHD HAFIFIE
2021-04-21 01:33:01 +08:00
parent 835154e563
commit 3b3db8ac42
7 changed files with 40 additions and 15 deletions
@@ -44,19 +44,27 @@
<th>No K/P</th>
<th>No Rujukan</th>
<th>Pembiayaan (RM)</th>
<th>Keuntungan (RM)</th>
<th>Nilai Marhun (RM)</th>
<th>Berat (g)</th>
</tr>
</thead>
<tfoot class="thead-dark">
<th colspan="4">TOTAL</th>
<th id="pinjamantotal"></th>
<th id="upah12total"></th>
<th id="nmtotal"></th>
<th id="berattotal"></th>
</tfoot>
</table>
</div>
</div>
<div class="row">
{{-- <div class="row">
<div class="col-md-12 text-right">
Bilangan Surat : <span id="bilangan_surat">3</span>
Jumlah Pinjaman : <span id="jumlah_pinjaman">RM 3,000.00</span>
</div>
</div>
</div> --}}
</div>
</div>
</div>
@@ -107,6 +115,10 @@
function gadaitable(data){
var counter = 1;
var total_pinjaman = 0;
var total_upah12 = 0;
var total_nm = 0;
var total_berat = 0;
tablegadai.clear().draw();
$.each(data,function(index,gadai){
$.ajax({
@@ -114,17 +126,23 @@
url:api_url + '/api/customers/' + gadai['nokp'],
success:function(customer){
total_pinjaman += Number(gadai['pinjaman']);
total_upah12 += Number(gadai['upah12']);
total_nm += Number(gadai['nilaimarhun']);
total_berat += Number(gadai['berat']);
tablegadai.row.add([
counter,
customer[0]['nama'],
gadai['nokp'],
gadai['norujukan'],
gadai['pinjaman'],
gadai['nilaimarhun'],
gadai['berat']
formatter.format(gadai['pinjaman']),
formatter.format(gadai['upah12']),
formatter.format(gadai['nilaimarhun']),
formatter.format(gadai['berat'])
]).draw();
$('#bilangan_surat').text(counter);
$('#jumlah_pinjaman').text('RM '+ formatter.format(total_pinjaman.toFixed(2)));
$('#pinjamantotal').text(formatter.format(total_pinjaman.toFixed(2)));
$('#upah12total').text(formatter.format(total_upah12.toFixed(2)));
$('#nmtotal').text(formatter.format(total_nm.toFixed(2)));
$('#berattotal').text(formatter.format(total_berat.toFixed(2)));
counter = counter + 1;
}
});