baki tuntut fix
This commit is contained in:
@@ -109,7 +109,7 @@
|
||||
HARGA JUAL (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['hargajual'],2) }}" class="form-control" readonly/>
|
||||
<input type="text" id="hargajual" value="{{ number_format($lelong['hargajual'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
PEMBIAYAAN (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['pinjaman'],2) }}" class="form-control" readonly/>
|
||||
<input type="text" id="pembiayaan" value="{{ number_format($lelong['pinjaman'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
BATCH LELONG
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ $lelong['batchno'] }}" class="form-control" readonly/>
|
||||
<input type="text" id="batch" value="{{ $lelong['batchno'] }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
KEUNTUNGAN (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['bakiupah'],2) }}" class="form-control" readonly/>
|
||||
<input type="text" id="keuntungan" value="{{ number_format($lelong['bakiupah'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
CAJ LELONG (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['cajlelong'],2) }}" class="form-control" readonly/>
|
||||
<input type="text" id="cajlelong" value="{{ number_format($lelong['cajlelong'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
JUMLAH (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['baki'],2) }}" id="jumlah" class="form-control" readonly/>
|
||||
<input type="text" id="jumlah" value="{{ number_format($lelong['baki'],2) }}" id="jumlah" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -200,13 +200,58 @@
|
||||
function bayarantuntubaki()
|
||||
{
|
||||
let norujukan = $('#norujukan').val();
|
||||
let api = "{{ config('api.url') }}";
|
||||
let nowakil = 0;
|
||||
let jenis = '';
|
||||
|
||||
console.log(norujukan);
|
||||
if($("input[name='radlelong']:checked").val() == 'baki')
|
||||
{
|
||||
jenis = 'T';
|
||||
}else{
|
||||
jenis = 'B';
|
||||
}
|
||||
|
||||
|
||||
let batchno = $('#batch').val();let teller = "{{ Auth::user()->name }}";let bakipjm = $('#pembiayaan').val();let bakiupah = $('#keuntungan').val();
|
||||
let cajlain = 0.00; let cajlelong = $('#cajlelong').val();
|
||||
let jumlah = $('#jumlah').val();let hargajual = $('#hargajual').val();
|
||||
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: "{{ route('lelong.tuntutbaki') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
'batchno' : batchno,
|
||||
'jenis' : jenis,
|
||||
'norujukan' : norujukan,
|
||||
'teller' : teller,
|
||||
'bakipjm' : bakipjm,
|
||||
'bakiupah' : bakiupah,
|
||||
'cajlain' : cajlain,
|
||||
'cajlelong' : cajlelong,
|
||||
'jumlah' : jumlah,
|
||||
'nowakil' : nowakil,
|
||||
'hargajual' : hargajual
|
||||
},
|
||||
success:function(data){
|
||||
let urlroute = '{{ route("resit.tuntutbaki", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', norujukan);
|
||||
Swal.fire(
|
||||
'Berjaya!',
|
||||
'Tuntut Baki Berjaya',
|
||||
'success'
|
||||
) .then(function() {
|
||||
window.open(urlroute, '_blank');
|
||||
window.location.replace("{{ route('customer_info') }}");
|
||||
})
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
let urlroute = '{{ route("resit.tuntutbaki", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', norujukan);
|
||||
|
||||
window.open(urlroute, '_blank');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user