add condition upah12 tawarruq & keuntungan baru

This commit is contained in:
Amirah
2023-12-06 09:00:27 +08:00
parent 7e725d5534
commit a106f6ce63
2 changed files with 18 additions and 7 deletions
+1 -1
View File
@@ -4198,7 +4198,7 @@ class KhazanahController extends Controller
$tarikh_cetak = $current->toDateString(); $tarikh_cetak = $current->toDateString();
if($request->datemula == null){ if($request->datemula == null){
$mula_date = '2017-01-01'; $mula_date = $current->toDateString();
}else{ }else{
$split_date = explode('-', $request->datemula); $split_date = explode('-', $request->datemula);
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; $mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
@@ -53,9 +53,9 @@
<th>Tarikh Gadai</th> <th>Tarikh Gadai</th>
<th>No Rujukan</th> <th>No Rujukan</th>
<th>Pembiayaan (RM)</th> <th>Pembiayaan (RM)</th>
<th>Ujrah (RM) </th> <th>Keuntungan Ujrah (RM) </th>
<th>Keuntungan 1% (RM)</th> <th>Keuntungan 1% (RM)</th>
<th>Keuntungan Sebenar (RM)</th> <th>Jumlah Keuntungan (RM)</th>
<th>Nilai Marhun (RM)</th> <th>Nilai Marhun (RM)</th>
<th>Berat (g)</th> <th>Berat (g)</th>
</tr> </tr>
@@ -213,12 +213,23 @@
tablegadai.clear().draw(); tablegadai.clear().draw();
$.each(data,function(index,gadai){ $.each(data,function(index,gadai){
total_pinjaman += Number(gadai['pinjaman']); total_pinjaman += Number(gadai['pinjaman']);
total_upah12 += Number(gadai['upah12']);
total_nm += Number(gadai['nilaimarhun']); total_nm += Number(gadai['nilaimarhun']);
total_berat += Number(gadai['berat']); total_berat += Number(gadai['berat']);
total_onepercent += Number(gadai['onepercent']*12); total_onepercent += Number(gadai['onepercent']*12);
total_ujrah += Number(gadai['ujrah']*12); total_ujrah += Number(gadai['ujrah']*12);
if (gadai['tagbaru'] == 0) {
var upah12 = gadai['upah12'];
} else {
var upah12 = gadai['ujrah']*12 + gadai['onepercent']*12;
}
total_upah12 += Number(upah12) ;
tablegadai.row.add([ tablegadai.row.add([
counter, counter,
gadai['nama'], gadai['nama'],
@@ -227,8 +238,8 @@
gadai['norujukan'], gadai['norujukan'],
formatter.format(gadai['pinjaman']), formatter.format(gadai['pinjaman']),
formatter.format(gadai['ujrah']*12), formatter.format(gadai['ujrah']*12),
formatter.format(gadai['onepercent']*12), formatter.format(gadai['onepercent']*12),
formatter.format(gadai['upah12']), formatter.format(upah12),
formatter.format(gadai['nilaimarhun']), formatter.format(gadai['nilaimarhun']),
formatter.format(gadai['berat']) formatter.format(gadai['berat'])
]).draw(); ]).draw();