block gadaian belum serah

This commit is contained in:
afiq
2021-03-02 01:48:14 +08:00
parent b1cedf7e6f
commit 3dde0f030c
+27 -6
View File
@@ -427,6 +427,32 @@
minimumFractionDigits: 2
});
function checkserah(data){
var urlpenebusan = $(data).data("url");
var norujukan = $(data).data("norujukan");
$.ajax({
method:'get',
url: api_url + '/api/check/serah/gadai',
datatype:'json',
data:{
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
'norujukan': norujukan
},
success:function(data){
console.log(data);
if(data == 'true'){
window.location = urlpenebusan;
}else if(data == 'false'){
Swal.fire({
icon: 'error',
title: 'Amaran',
text: 'Gadaian Belum Scan Barcode'
});
}
}
});
}
function gadaiTable(data,jenistebus){
var counter = 1;
@@ -443,7 +469,7 @@
urlroute = urlroute.replace(':id', gadai_detail["norujukan"]);
tablegadai.row.add([
'<input type="radio" value='+ gadai_detail["norujukan"] +' name="belum"/>',
'<a href=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
'<a href="#" onclick="checkserah(this)" data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
gadai_detail['t_gadai'],
gadai_detail['t_matang1'],
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
@@ -480,12 +506,7 @@
counter = counter + 1;
}
});
});
}
$(document).ready( function () {