Merged in new-onepercent (pull request #56)

fix rekod gadaian
This commit is contained in:
Muhd hafifie
2023-12-31 09:53:09 +00:00
3 changed files with 34 additions and 10 deletions
+8 -3
View File
@@ -382,7 +382,12 @@ class GadaianController extends Controller
if(sizeof($wakil) != 0)
$wakil = $wakil[0];
return view('print.resitansuran',compact('transaction','gadai','customers_info','wakil'));
if($gadai['tagbaru'] == 1) {
return view('print.resitansuran_ujrah',compact('transaction','gadai','customers_info','wakil'));
} else {
return view('print.resitansuran',compact('transaction','gadai','customers_info','wakil'));
// return view('print.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran'));
}
}
public function resitansurans($id)
@@ -729,7 +734,7 @@ class GadaianController extends Controller
if($history == $gadai[0][0]['historygadaian'])
$history = 0;
else{
array_push($arrayhist,["hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''), "pinjaman" => ((isset($tebus[0])) ? $tebus[0]['pinjaman'] : 0),"norujukan" => $history,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]);
array_push($arrayhist,["tagbaru" => ((isset($gadai[0][0]['tagbaru'])) ? $gadai[0][0]['tagbaru'] : 0),"hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''), "pinjaman" => ((isset($tebus[0])) ? $tebus[0]['pinjaman'] : 0),"norujukan" => $history,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]);
$history = $gadai[0][0]['historygadaian'];
}
}
@@ -744,7 +749,7 @@ class GadaianController extends Controller
])->json();
array_push($arrayhist,["hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''),"pinjaman" => ((isset($tebus[0])) ? $tebus[0]['pinjaman'] : 0),"norujukan" => $norujukan,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]);
array_push($arrayhist,["tagbaru" => ((isset($gadai[0][0]['tagbaru'])) ? $gadai[0][0]['tagbaru'] : 0), "hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''),"pinjaman" => ((isset($tebus[0])) ? $tebus[0]['pinjaman'] : 0),"norujukan" => $norujukan,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]);
break;
}
}
+17 -5
View File
@@ -1417,14 +1417,26 @@
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
}else{
var urlroute = '{{ route("resit.tebus", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
if(tebusaz['historygadaian'] != '' || tebusaz['historygadaian'] != 0 || tebusaz['historygadaian'] != null){
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
}else{
var urlroute = '{{ route("resit.tebus", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
}
}
break;
case 'A':
var urlroute = '{{ route("resit.belumansurans", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
if(tebusaz['tagbaru'] == 1){
var urlroute = '{{ route("resit.ansuran", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
}else{
var urlroute = '{{ route("resit.belumansurans", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
}
break;
case 'S':
var urlroute = '{{ route("resit.tebusseparuh", ":id") }}';
@@ -1435,7 +1447,7 @@
historytebusbayaran.row.add([
counter,
tebusaz['norujukan'],
tebusaz['jenistebus'],
(tebusaz['historygadaian'] != '' || tebusaz['historygadaian'] != 0 || tebusaz['historygadaian'] != null) ? 'PS' : tebusaz['jenistebus'],
tebusaz['pinjaman'],
tebusaz['jbg'],
tebusaz['t_tebus'],
+9 -2
View File
@@ -1051,8 +1051,15 @@ $.each(data,function(index,gadai_detail){
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
}else{
var urlroute = '{{ route("resit.khazanah.tebus", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
if(tebusaz['historygadaian'] != '' || tebusaz['historygadaian'] != 0 || tebusaz['historygadaian'] != null){
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
}else{
var urlroute = '{{ route("resit.khazanah.tebus", ":id") }}';
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
}
}
break;