Merge branch 'new-super' into afiqhamzah-feat-mykad-reader-registration

This commit is contained in:
afiq.hamzah
2022-11-14 11:20:28 +08:00
5 changed files with 31 additions and 208 deletions
+1
View File
@@ -2231,6 +2231,7 @@
method:"put",
url: api_url + "/api/customers/update/kaunter/" + nokp,
data:{
"namateller" : "{{ Auth::user()->name }}",
"telefon1": telefon1,
"telefon2": telefon2,
"kodbank":kodbank,
-149
View File
@@ -589,155 +589,6 @@ function ubahwakil(e)
});
return false;
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
confirmButton: 'btn btn-success',
cancelButton: 'btn btn-danger'
},
buttonsStyling: false
});
//let jumlah = $('#jumlah').val();let hargajual = $('#hargajual').val();
swalWithBootstrapButtons.fire({
title: 'Dapatkan Pengesahan Khazanah',
text: "Tuntutan Baki Pelanggan!",
icon: 'info',
showCancelButton: true,
confirmButtonText: 'Hantar',
cancelButtonText: 'Batal',
reverseButtons: true
}).then((result) => {
if(result.isConfirmed) {
Swal.fire({
title: 'Tunggu Pengesahan Daripada Khazanah.',
icon: 'info',
width: 600,
padding: '3em',
background: '#fffff',
showCancelButton: false,
showConfirmButton: false,
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false
})
let norujukan = $('#norujukan').val();
let api = "{{ config('api.url') }}";
let nowakil = 0;
let jenis = '';
let mohon = '';
if($("input[name='radlelong']:checked").val() == 'baki')
{
jenis = 'T';
mohon = "Tuntut Baki Lelongan";
}else{
jenis = 'B';
mohon = "Bayar Baki Lelongan";
}
let batchno = $('#batch').val();let teller = "{{ Auth::user()->name }}";let bakipjm = $('#pembiayaan').val().replace(/[^0-9.-]+/g,"");let bakiupah = $('#keuntungan').val();
let cajlain = 0.00; let cajlelong = $('#cajlelong').val();
let jumlah = $('#jumlah').val().replace(/[^0-9.-]+/g,"");let hargajual = $('#hargajual').val().replace(/[^0-9.-]+/g,"");
$.ajax({
method:'post',
url: '{{ route("teller.createkelulusan") }}',
data: {
"_token": "{{ csrf_token() }}",
"norujukan" : norujukan,
"mohon" : mohon
},
success:function(data){
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
cluster: 'ap1',
encrypted: true
});
var channel = pusher.subscribe('notice-ubahhapus');
channel.bind('my-ubahhapus', function(data) {
if(data.norujukan == norujukan && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
Swal.fire({
icon: 'success',
title: 'Telah Disahkan'
}).then(function(){
$.ajax({
method: 'put',
url: "{{ route('lelong.tuntutbaki') }}",
data: {
"_token": "{{ csrf_token() }}",
'batchno' : batchno,
'jenis' : jenis,
'norujukan' : norujukan,
'teller' : teller,
'bakipjm' : bakipjm,
'bakiupah' : bakiupah,
'cajlain' : cajlain,
'cajlelong' : cajlelong,
'jumlah' : jumlah,
'nowakil' : nowakil,
'hargajual' : hargajual
},
success:function(data){
let urlroute = '{{ route("resit.tuntutbaki", ":id") }}';
urlroute = urlroute.replace(':id', norujukan);
Swal.fire(
'Berjaya!',
'Tuntut Baki Berjaya',
'success'
) .then(function() {
window.open(urlroute, '_blank');
window.location.replace("{{ route('customer_info') }}");
})
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
return true;
});
}
else if(data.kelulusan == 'batal')
{
Swal.fire({
icon: 'warning',
title: 'Telah Dibatalkan',
text: `Komen : ${data.komen}`
}).then(function(){
return false;
});
}
}
});
}else if (result.dismiss === Swal.DismissReason.cancel){
swalWithBootstrapButtons.fire(
'Batal',
'Tidak Berjaya Mendaptkan Pengesahan Khazanah',
'error'
)
}
});
}
</script>