fix spearuh dan tambah pinjaman
This commit is contained in:
@@ -659,7 +659,8 @@
|
||||
}else{
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url:'{{ route("gadai.history") }}',
|
||||
url:'{{ route("gadai.history.khazanah") }}',
|
||||
datatype:'json',
|
||||
data:{ "norujukan" : histid},
|
||||
success:function(data){
|
||||
$('#historytebusModal').modal();
|
||||
@@ -687,6 +688,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
function ulangcetakagh()
|
||||
{
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
let histid = $('input[name="belum"]:checked').val();
|
||||
if(histid == null){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Sila pilih salah satu SAG'
|
||||
});
|
||||
}else{
|
||||
let urlroute = '{{ route("agh.ulangcetak", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', histid);
|
||||
window.open(urlroute, '_blank');
|
||||
swal.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function saghilangfunc()
|
||||
{
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
@@ -714,8 +734,8 @@
|
||||
allowEnterKey: false,
|
||||
showConfirmButton: false,
|
||||
html: "<br>" +
|
||||
'<button type="button" role="button" tabindex="0" class="btn btn-primary mr-1">' + 'Okay' + '</button>' +
|
||||
'<button type="button" role="button" tabindex="0" class="btn btn-primary">' + 'Ulang Cetak' + '</button>',
|
||||
'<button type="button" role="button" tabindex="0" class="btn btn-primary mr-1" onclick="swal.close()">' + 'Okay' + '</button>' +
|
||||
'<button type="button" role="button" tabindex="0" class="btn btn-primary" onclick="ulangcetakagh()">' + 'Ulang Cetak' + '</button>',
|
||||
icon: 'error',
|
||||
title: 'Surat Akuan Gadaian Hilang telah dikeluarkan!'
|
||||
});
|
||||
@@ -733,43 +753,24 @@
|
||||
}
|
||||
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
||||
let histid = $('input[name="sudahtebus"]:checked').val();
|
||||
|
||||
if(histid == null){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Sila pilih salah satu SAG'
|
||||
});
|
||||
}else{
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: api_url + '/api/polis/get/',
|
||||
data:{ "norujukan" : histid,"kodcaw" : kodcaw},
|
||||
success:function(data){
|
||||
var count = Object.keys(data).length;
|
||||
|
||||
if(count > 0)
|
||||
{
|
||||
Swal.fire({
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false,
|
||||
confirmButtonText: '<i class="fa fa-check-circle"></i> Baik Boss!',
|
||||
icon: 'success',
|
||||
title: 'Surat Akuan Gadaian Hilang telah dijana sebelum ini!'
|
||||
});
|
||||
}else{
|
||||
$('#AGHModal').modal('show');
|
||||
$('#norujukanhidden').val(histid);
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Cetakan Surat Akuan Hilang tidak dibenarkan'
|
||||
});
|
||||
|
||||
}else if($("input[name='options']:checked").val() == 'lelong'){
|
||||
let histid = $('input[name="sudahtebus"]:checked').val();
|
||||
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Cetakan Surat Akuan Hilang tidak dibenarkan'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$('#negeriagh').change(function(){
|
||||
|
||||
Reference in New Issue
Block a user