baki tuntut fix

This commit is contained in:
hafifierahman
2021-03-03 13:39:53 +08:00
parent d2db35854e
commit 43802e3246
6 changed files with 159 additions and 37 deletions
+26 -8
View File
@@ -134,8 +134,8 @@
<tr>
<th>Bil</th>
<th>Masa</th>
<th>Debit</th>
<th>Kredit</th>
<th>Debit (RM)</th>
<th>Kredit (RM)</th>
<th>Nota</th>
</tr>
</thead>
@@ -149,8 +149,8 @@
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Pinjaman</th>
<th>Nilai Marhun</th>
<th>Pinjaman (RM)</th>
<th>Nilai Marhun (RM)</th>
<th>Jenis Transaksi</th>
</tr>
</thead>
@@ -181,12 +181,30 @@
<thead>
<tr>
<th>Bil</th>
<th>Masa</th>
<th>Debit</th>
<th>Kredit</th>
<th>Nota</th>
<th>Tarikh</th>
<th>Caj Lelong (RM)</th>
<th>Jumlah (RM)</th>
<th>Jenis</th>
</tr>
</thead>
<tbody>
@if(is_object($tuntutbaki) || is_array($tuntutbaki))
@foreach($tuntutbaki as $tb)
<tr>
<td> {{ $loop->iteration }} </td>
<td> {{ $tb['tarikh'] }} </td>
<td> {{ $tb['cajlelong'] }} </td>
<td> {{ $tb['jumlah'] }} </td>
<td> @php if($tb['jenis'] == 'T'){
echo '<h4><span class="badge badge-success">Baki Lelong</span></h4>';
}else{
echo '<h4><span class="badge badge-danger">Rugi Lelong</span></h4>';
}
@endphp </td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
+55 -10
View File
@@ -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>
@@ -92,7 +92,7 @@
#details td, #details th {
padding: 20px;
padding: 10px;
font-size:12px;
}
@@ -155,7 +155,7 @@
</tr>
<tr>
<td>{{ $cawangan_detail['alamat1'] }}</td>
<td>No Resit : <span></span></td>
<td>No Resit : <span>{{ $lelong['recno'] }}</span></td>
</tr>
<tr>
<td>{{ $cawangan_detail['alamat2']}}</td>
@@ -170,13 +170,12 @@
<br>
<table id="scan">
<tr>
<td>Batch No Lelongan : <span></span></td>
<td>Batch No Lelongan : <span>{{ $lelong['batchno'] }}</span></td>
</tr>
<tr>
<td>Tarikh Lelongan : <span></span></td>
<td>Tarikh Lelongan : <span>{{ $lelong['t_lelong'] }}</span></td>
</tr>
<tr>
<td></td>
@@ -195,62 +194,62 @@
<table id="details" style="width:70%;border:1px solid black;">
<tr>
<th>No Rujukan Surat Gadai</th>
<th>012334</th>
<td>{{ $lelong['norujukan'] }}</td>
<th></th>
</tr>
<tr>
<th>Nama Pemilik</th>
<th>Siti Aminah</th>
<td>{{ $lelong['nama'] }}</td>
<th></th>
</tr>
<tr>
<th>No K/P</th>
<th>892322232</th>
<td>{{ $lelong['kpbaru'] }}</td>
<th></th>
</tr>
<tr>
<th>Tarikh</th>
<th>03-12-2020</th>
<td>{{ $lelong['tarikh'] }}</td>
<th></th>
</tr>
<tr style="border-top:1px solid black;">
<th>Nama wakil</th>
<th></th>
<td></td>
<th></th>
</tr>
<tr style="border-bottom:1px solid black;">
<th>No K/P</th>
<th></th>
<td></td>
<th></th>
</tr>
<tr>
<th>Harga Lelongan</th>
<th>1,930.00</th>
<td>RM {{ number_format($lelong['hargajual'],2) }}</td>
<th></th>
</tr>
<tr>
<th>Pembiayaan</th>
<th>1,200.00</th>
<td>RM {{ number_format($lelong['pinjaman'],2) }}</td>
<th></th>
</tr>
<tr>
<th>Baki Keuntungan</th>
<th>198.00</th>
<td>RM {{ number_format($lelong['bakiupah'],2) }}</td>
<th></th>
</tr>
<tr>
<th>Caj Lelong</th>
<th>57.90</th>
<td>RM {{ number_format($lelong['cajlelong'],2) }}</td>
<th></th>
</tr>
<tr>
<th>Lebihan Lelongan</th>
<th>4474.10</th>
<td>RM {{ number_format($lelong['jumlah'],2) }}</td>
<th></th>
</tr>
<tr>
<th>Jumlah Bayaran</th>
<th><b>RM 474.10</b></th>
<td><b>RM {{ number_format($lelong['jumlah'],2) }}</b></td>
<th></th>
</tr>
</table>
@@ -261,6 +260,8 @@
<td>Nota: Pastikan No Kad Pengenalan Surat Akuan Gadaian dan Tandatangan. Sila ambil cop sekiranya surat gadai hilang/tidak dibawa manakala wakil diminta Tandatangan dan Cop Jari.</td>
</table>
<br>
<br>
<br>
<br>
<table id="sign">