add feature search name and middleware changes to fix the resit for khazanah
This commit is contained in:
@@ -1032,47 +1032,6 @@
|
||||
|
||||
<div class="col-12 form-group row">
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- sag lama -->
|
||||
{{-- <div class="col-6" id="divpembiayaanasal">
|
||||
<div class="form-group row">
|
||||
<div class="col-4">
|
||||
PEMBIAYAAN ASAL (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" id="pinjamanasal" value="{{ number_format($gadai['pinjaman'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="divbayarantawarruq">
|
||||
<div class="col-4">
|
||||
BAYARAN PEMBIAYAAN (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" id="bayarantawarruq" onkeyup="bayartawarruq(this)" placeholder="0.00" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="divbayaranminima">
|
||||
<div class="col-4">
|
||||
BAYARAN MINIMA
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" id="minimabayaran" value="" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="divperludibayartawarruq">
|
||||
<div class="col-4">
|
||||
<b>PERLU DIBAYAR (RM)</b>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" id="perludibayartawarruq" style="font-weight:bold;" class="form-control" readonly/>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
|
||||
|
||||
<div class="col-12 d-flex justify-content-between">
|
||||
@if($gadai['tagbaru'] == 0)
|
||||
<div class="col-6" id="divjenisAT">
|
||||
@@ -1096,7 +1055,7 @@
|
||||
@endif
|
||||
<div class="justify-content-end">
|
||||
<input type="button" class="float-right btn btn-danger mr-2" value="BATAL" onclick="pembatalanbalik();">
|
||||
<input type="button" id="terima_transaksi" class="float-right btn btn-primary mr-2" value="TERIMA" onclick="bayaransemua()">
|
||||
@if(Auth::user()->roles == 'teller') <input type="button" id="terima_transaksi" class="float-right btn btn-primary mr-2" value="TERIMA" onclick="bayaransemua()"> @endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1781,6 +1740,15 @@
|
||||
function bayaransemua()
|
||||
{
|
||||
$("#terima_transaksi").prop('disabled', true);
|
||||
Swal.fire({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
didOpen: function () {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
|
||||
var jumupah = parseFloat($('#jumlahupah').val().replace(/[^0-9.-]+/g,""));
|
||||
|
||||
if($('#sltjenistebus').find(":selected").val() == 'T'){
|
||||
@@ -1799,6 +1767,7 @@
|
||||
|
||||
if(count > 0)
|
||||
{
|
||||
Swal.close();
|
||||
Swal.fire('Amaran!','Tebus sudah dibuat sila tekan butang batal!','error');
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
adadah = true;
|
||||
@@ -1816,6 +1785,7 @@
|
||||
|
||||
if(success_data == true)
|
||||
{
|
||||
Swal.close();
|
||||
Swal.fire('Amaran!','Bayaran online dalam proses!','error');
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
adaonline = true;
|
||||
@@ -1867,6 +1837,7 @@
|
||||
|
||||
|
||||
if(Number(duitpelanggan) < Number(bakipinjaman)){
|
||||
Swal.close();
|
||||
Swal.fire('Amaran!','Duit Pelanggan haruslah diisi melebihi perlu dibayar!','error');
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
|
||||
@@ -1898,7 +1869,7 @@
|
||||
"jeniskeuntungan" : jeniskeuntungan,
|
||||
"teller" : teller,
|
||||
"duitpelanggan" : duitpelanggan,
|
||||
"bakipelanggan" : bakipelanggan
|
||||
"bakipelanggan" : bakipelanggan,
|
||||
},
|
||||
success:function(success_data){
|
||||
|
||||
@@ -1931,6 +1902,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
Swal.close();
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya!',
|
||||
@@ -1941,6 +1913,7 @@
|
||||
})
|
||||
}
|
||||
else{
|
||||
Swal.close();
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
@@ -1969,6 +1942,7 @@
|
||||
|
||||
if(count > 0)
|
||||
{
|
||||
Swal.close();
|
||||
Swal.fire('Amaran!','Tebus sudah dibuat sila tekan butang batal!','error');
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
|
||||
@@ -1997,6 +1971,7 @@
|
||||
if(isNaN(duitpelanggan)) duitpelanggan = 0;
|
||||
|
||||
if(Number(duitpelanggan) < Number(bayar)){
|
||||
Swal.close();
|
||||
Swal.fire('Amaran!','Duit Pelanggan haruslah diisi melebihi perlu dibayar!','error');
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
|
||||
@@ -2066,6 +2041,43 @@
|
||||
|
||||
let adadah = false;
|
||||
|
||||
let komuditiblock = false;
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: api + '/api/komuditi/check',
|
||||
async:false,
|
||||
success:function(komoditi){
|
||||
var check_komuditi = Object.keys(komoditi).length;
|
||||
if(check_komuditi == 0){
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Unit Komuditi Berbaki Minumum',
|
||||
text: 'Sila Hubungi Operasi Untuk Membuat Pembelian Komuditi'
|
||||
});
|
||||
komuditiblock = true;
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(Number(komoditi['unit_komuditi']) < pinjaman_baru){
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Baki Unit Komuditi Tidak Mencukupi',
|
||||
text: 'Sila Hubungi Operasi Untuk Membuat Pembelian Komuditi'
|
||||
});
|
||||
komuditiblock = true;
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(komuditiblock){
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method:'get',
|
||||
datatype: 'json',
|
||||
@@ -2411,6 +2423,42 @@
|
||||
}
|
||||
|
||||
let adadah = false;
|
||||
let komuditiblock = false;
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: api + '/api/komuditi/check',
|
||||
async:false,
|
||||
success:function(komoditi){
|
||||
var check_komuditi = Object.keys(komoditi).length;
|
||||
if(check_komuditi == 0){
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Unit Komuditi Berbaki Minumum',
|
||||
text: 'Sila Hubungi Operasi Untuk Membuat Pembelian Komuditi'
|
||||
});
|
||||
komuditiblock = true;
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(Number(komoditi['unit_komuditi']) < pinjaman_baru){
|
||||
$("#terima_transaksi").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Baki Unit Komuditi Tidak Mencukupi',
|
||||
text: 'Sila Hubungi Operasi Untuk Membuat Pembelian Komuditi'
|
||||
});
|
||||
komuditiblock = true;
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(komuditiblock){
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method:'get',
|
||||
@@ -3385,7 +3433,10 @@
|
||||
"nowakil" : nowakil,
|
||||
"arrayrecno" : array_recno,
|
||||
"jenisbayarantebus" : jenisbayarantebus,
|
||||
"jeniskeuntungan" : 'onepercent',
|
||||
"teller" : teller,
|
||||
"bayaran" : duitpelanggan,
|
||||
"bakipelanggan" : bakipelanggan,
|
||||
|
||||
|
||||
//yang baru
|
||||
@@ -3501,7 +3552,10 @@
|
||||
"noic" : noic,
|
||||
"norujukan" : norujukan,
|
||||
"jenisbayarantebus" : jenisbayarantebus,
|
||||
"teller" : teller
|
||||
"jeniskeuntungan" : 'onepercent',
|
||||
"teller" : teller,
|
||||
"bayaran" : duitpelanggan,
|
||||
"bakipelanggan" : bakipelanggan,
|
||||
|
||||
},
|
||||
success:function(success_data){
|
||||
@@ -3877,7 +3931,7 @@ $.ajax({
|
||||
'tebus' : 0
|
||||
},
|
||||
success:function(data){
|
||||
window.location.replace("{{ route('customer_info') }}");
|
||||
window.location.replace("{{ (Auth::user()->roles == 'pc' || Auth::user()->roles == 'ppc') ? route('khazanah.customer_info') : route('customer_info') }}");
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
@@ -3886,7 +3940,7 @@ $.ajax({
|
||||
}
|
||||
});
|
||||
}else{
|
||||
window.location.replace("{{ route('customer_info') }}");
|
||||
window.location.replace("{{ (Auth::user()->roles == 'pc' || Auth::user()->roles == 'ppc') ? route('khazanah.customer_info') : route('customer_info') }}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user