update komuditi

This commit is contained in:
afiq
2021-02-08 12:06:43 +08:00
parent cc8c2bdd1b
commit 4a89aa13d3
5 changed files with 51 additions and 32 deletions
+21 -14
View File
@@ -424,7 +424,7 @@
'<input type="radio" value='+ gadai_detail["norujukan"] +' name="belum"/>',
'<a href=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
gadai_detail['t_gadai'],
gadai_detail['t_matang'],
gadai_detail['t_matang1'],
'RM '+ formatter.format(gadai_detail['nilaimarhun']),
'RM '+formatter.format(gadai_detail['pinjaman']),
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
@@ -437,7 +437,7 @@
'<input type="radio" value='+ gadai_detail["norujukan"] +' name="sudahtebus"/>',
gadai_detail['norujukan'],
gadai_detail['t_gadai'],
gadai_detail['t_matang'],
gadai_detail['t_matang1'],
'RM '+ formatter.format(gadai_detail['nilaimarhun']),
'RM '+formatter.format(gadai_detail['pinjaman']),
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
@@ -450,7 +450,7 @@
counter,
gadai_detail['norujukan'],
gadai_detail['t_gadai'],
gadai_detail['t_matang'],
gadai_detail['t_matang1'],
'RM '+ formatter.format(gadai_detail['nilaimarhun']),
'RM '+formatter.format(gadai_detail['pinjaman']),
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
@@ -719,7 +719,7 @@
let hapusid = $('input[name="belum"]:checked').val();
let hapusidsudah = $('input[name="sudahtebus"]:checked').val();
let harini = new Date();harini.setHours(0, 0, 0, 0);
console.log(hapusid);
if(hapusid == null && $("input[name='options']:checked").val() == 'belum_tebus'){
Swal.fire({
icon: 'error',
@@ -829,7 +829,6 @@
"norujukan" : id
},
success:function(data){
console.log(data);
if(data != 0){
console.log('berjaya');
clearInterval(timerInterval);
@@ -842,15 +841,23 @@
method:'put',
url: api_url + '/api/gadai/hapus/' + kodcaw + '/' + hapusid,
success:function(data){
console.log(data);
swalWithBootstrapButtons.fire(
'Hapus!',
'Data pelanggan telah dihapuskan.',
'success'
).then(function () {
location.reload();
});
$.ajax({
method:'put',
url: api_url + '/api/komuditi/batal',
dataType:'json',
data:{
norujukan: hapusid
},
success:function(batalkomuditi){
swalWithBootstrapButtons.fire(
'Hapus!',
'Data pelanggan telah dihapuskan.',
'success'
).then(function(){
location.reload();
});
}
})
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);