updated untuk 28-9-2022

This commit is contained in:
hafifierahman
2022-09-28 02:47:15 +08:00
parent e80e122a26
commit 0e8a3b4cfc
20 changed files with 2320 additions and 614 deletions
+115 -1
View File
@@ -212,6 +212,7 @@
<th>Jum Tuntut/Bayar</th>
<th>Keuntungan</th>
<th>Caj Lelong</th>
<th>Tuntutan</th>
<th>Cetak</th>
</tr>
</thead>
@@ -805,6 +806,24 @@
var urlroute = '{{ route("lelongan", ":id") }}';
urlroute = urlroute.replace(':id', gadai_detail["norujukan"]);
var tuntutan = 'Pelanggan';
$.ajax({
method:"GET",
async:false,
url: api_url + "/api/check/customer/",
data:{
"norujukan" : gadai_detail['norujukan'],
"kodcaw" : kodcaw
},
success: function(response){
if(response[0].teller = 'DM')
{
tuntutan = 'WTD';
}
}
});
if(gadai_detail['trkhtuntut'] == null){
tablelelong.row.add([
counter,
@@ -816,6 +835,7 @@
'RM '+formatter.format(gadai_detail['baki']),
'RM '+formatter.format(gadai_detail['bakiupah']),
'RM '+formatter.format(gadai_detail['cajlelong']),
'',
'<button class="btn btn-info" disabled>Cetak</button>'
]).draw();
}else{
@@ -829,6 +849,7 @@
'RM '+formatter.format(gadai_detail['baki']),
'RM '+formatter.format(gadai_detail['bakiupah']),
'RM '+formatter.format(gadai_detail['cajlelong']),
tuntutan,
'<button class="btn btn-info" onclick="cetaktuntutbaki(this)" data-norujukan=' + gadai_detail['norujukan'] +'>Cetak</button>'
]).draw();
}
@@ -874,7 +895,99 @@
text: 'Lelongan dalam process WTD'
});
}else{
window.location.href = urlroute;
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
confirmButton: 'btn btn-success ml-1',
cancelButton: 'btn btn-danger'
},
buttonsStyling: false
});
swalWithBootstrapButtons.fire({
title: 'Dapatkan Pengesahan Khazanah',
text: "Kelulusan Tuntut Baki Lelong",
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 mohon = "Tuntut Baki";
$.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);
}
});
let teller = "{{ Auth::user()->name }}";
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(){
window.location.href = urlroute;
});
}
else if(data.kelulusan == 'batal')
{
Swal.fire({
icon: 'warning',
title: 'Telah Dibatalkan',
text: `Komen : ${data.komen}`
}).then(function(){
location.reload();
return false;
});
}
}
});
}else if (result.dismiss === Swal.DismissReason.cancel){
swalWithBootstrapButtons.fire(
'Batal',
'Tidak Berjaya Mendapatkan Pengesahan Khazanah',
'error'
)
}
});
}
}
});
@@ -890,6 +1003,7 @@
}
$(document).ready( function () {
$('#myTable').parents('div.dataTables_wrapper').first().hide();