fix penebusan upah

This commit is contained in:
fifi97
2021-06-20 11:28:58 +08:00
parent 6c8cfae82d
commit afd76521a2
11 changed files with 999 additions and 906 deletions
+36
View File
@@ -470,6 +470,10 @@
"ordering": false
});
var bayaranupah = $('#tablehistoryupah').DataTable({
"ordering": false
});
const formatter = new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2
});
@@ -821,6 +825,13 @@
rekodasal(gadai);
}
});
$.ajax({
method:'get',
url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
success:function(ansuran){
rekodansuran(ansuran);
}
});
}
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
let histid = $('input[name="sudahtebus"]:checked').val();
@@ -858,6 +869,13 @@
rekodasal(gadai);
}
});
$.ajax({
method:'get',
url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
success:function(ansuran){
rekodansuran(ansuran);
}
});
}
}
}
@@ -868,6 +886,24 @@
$('#nilaimarhunmodal').text('RM ' + formatter.format(gadaian[0][0]['nilaimarhun']));
}
function rekodansuran(data){
var counter = 1;
bayaranupah.clear().draw();
$.each(data,function(index,bayaran){
var urlroute = '{{ route("resit.advansur", ":id") }}';
urlroute = urlroute.replace(':id', bayaran['norujukan']);
bayaranupah.row.add([
counter,
bayaran['tarikh'],
"RM " + bayaran['upahDibayar'],
'<a class="btn btn-info" target="_blank" href='+ urlroute +'>Cetak</a>'
]).draw();
counter = counter + 1;
});
}
function historybayarantable(data){
var counter = 1;