fix skit2 la

This commit is contained in:
MUHD HAFIFIE
2021-08-17 18:28:57 +08:00
parent c50ccb09e5
commit 2e25e0d918
4 changed files with 132 additions and 48 deletions
+74 -44
View File
@@ -828,40 +828,56 @@
text: 'Sila pilih salah satu SAG'
});
}else{
Swal.fire({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
didOpen: function () {
Swal.showLoading()
}
});
$.ajax({
method:'get',
url:'{{ route("gadai.history") }}',
data:{ "norujukan" : histid},
success:function(data)
{
$('#historytebusModal').modal();
historytebustable(data);
$.ajax({
method: 'get',
url: api_url + '/api/transaction/' + histid,
success: function(data){
historybayarantable(data);
$.ajax({
method:'get',
url: api_url + '/api/gadai/norujukan/'+histid,
success:function(gadai){
rekodasal(gadai);
$.ajax({
method:'get',
url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
success:function(ansuran){
rekodansuran(ansuran);
Swal.close();
$('#historytebusModal').modal();
}
});
}
});
}
});
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
$.ajax({
method: 'get',
url: api_url + '/api/transaction/' + histid,
success: function(data){
historybayarantable(data);
}
});
$.ajax({
method:'get',
url: api_url + '/api/gadai/norujukan/'+histid,
success:function(gadai){
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();
@@ -873,39 +889,53 @@
text: 'Sila pilih salah satu SAG'
});
}else{
Swal.fire({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
didOpen: function () {
Swal.showLoading()
}
});
$.ajax({
method:'get',
url:'{{ route("gadai.history") }}',
data:{ "norujukan" : histid},
success:function(data){
$('#historytebusModal').modal();
historytebustable(data);
$.ajax({
method: 'get',
url: api_url + '/api/transaction/' + histid,
success: function(data){
historybayarantable(data);
}
});
$.ajax({
method:'get',
url:api_url + '/api/gadai/norujukan/'+histid,
success:function(gadai){
rekodasal(gadai);
}
});
$.ajax({
method:'get',
url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
success:function(ansuran){
rekodansuran(ansuran);
}
});
$('#historytebusModal').modal();
Swal.close();
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
$.ajax({
method: 'get',
url: api_url + '/api/transaction/' + histid,
success: function(data){
historybayarantable(data);
}
});
$.ajax({
method:'get',
url:api_url + '/api/gadai/norujukan/'+histid,
success:function(gadai){
rekodasal(gadai);
}
});
$.ajax({
method:'get',
url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
success:function(ansuran){
rekodansuran(ansuran);
}
});
}
}
}
@@ -272,6 +272,13 @@
</div>
<div class="tab-pane fade" id="nav-{{ $ls->id }}-addtunai" role="tabpanel" aria-labelledby="addtunai-tab">
<div class="input-group mb-3 col-4" style="margin-left:-15px;">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Tarikh</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetarikh" name="datetarikh" aria-describedby="basic-addon1">
</div>
<table class="table table-striped table-hover text-center" id="tableaddtunai-{{ $ls->id }}">
<thead class="thead-dark">
<tr>
@@ -300,6 +307,13 @@
</div>
<div class="tab-pane fade" id="nav-{{ $ls->id }}-gt" role="tabpanel" aria-labelledby="gt-tab">
<div class="input-group mb-3 col-4" style="margin-left:-15px;">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Tarikh</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetarikh" name="datetarikh" aria-describedby="basic-addon1">
</div>
<table class="table text-center table-striped table-hover" id="tablegadaitebus-{{ $ls->id }}">
<thead class="thead-dark">
<tr>
@@ -333,6 +347,13 @@
</div>
<div class="tab-pane fade" id="nav-{{ $ls->id }}-tuntutbaki" role="tabpanel" aria-labelledby="tuntutbaki-tab">
<div class="input-group mb-3 col-4" style="margin-left:-15px;">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Tarikh</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetarikh" name="datetarikh" aria-describedby="basic-addon1">
</div>
<table class="table text-center table-striped table-hover" id="tabletuntutbaki-{{ $ls->id }}">
<thead class="thead-dark">
<tr>
@@ -517,6 +538,15 @@
</div>
<div class="tab-pane fade" id="nav-{{ $ls->id }}-addtunai" role="tabpanel" aria-labelledby="addtunai-tab">
<div class="input-group mb-3 col-4" style="margin-left:-15px;">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Tarikh</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetarikh" name="datetarikh" aria-describedby="basic-addon1">
</div>
<table class="table text-center table-striped table-hover" id="tableaddtunai-{{ $ls->id }}">
<thead class="thead-dark">
<tr>
@@ -546,6 +576,14 @@
</div>
<div class="tab-pane fade" id="nav-{{ $ls->id }}-gt" role="tabpanel" aria-labelledby="gt-tab">
<div class="input-group mb-3 col-4" style="margin-left:-15px;">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Tarikh</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetarikh" name="datetarikh" aria-describedby="basic-addon1">
</div>
<table class="table text-center table-striped table-hover" id="tablegadaitebus-{{ $ls->id }}">
<thead class="thead-dark">
<tr>
@@ -579,6 +617,14 @@
</div>
<div class="tab-pane fade" id="nav-{{ $ls->id }}-tuntutbaki" role="tabpanel" aria-labelledby="tuntutbaki-tab">
<div class="input-group mb-3 col-4" style="margin-left:-15px;">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Tarikh</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetarikh" name="datetarikh" aria-describedby="basic-addon1">
</div>
<table class="table text-center table-striped table-hover" id="tabletuntutbaki-{{ $ls->id }}">
<thead class="thead-dark">
<tr>
+1 -1
View File
@@ -171,7 +171,7 @@
<div class="inner">
<h3>RM {{ ($dashboard[0]['variasi']) ? number_format((float)$dashboard[0]['variasi'],2) : "0.00" }}</h3>
<p>Variasi</p>
<p>Varian</p>
</div>
<div class="icon">
</div>
@@ -203,13 +203,14 @@
<th>J Tebus</th>
<th width="6%;">Nilai Marhun(RM)</th>
<th width="6%;">Pembiayaan(RM)</th>
{{-- <th width="6%;">Baki Pembiayaan(RM)</th> --}}
<th width="6%;">Upah/Keuntungan(RM)</th>
<th width="6%;">Bayaran(RM)</th>
<th width="6%;">Jumlah(RM)</th>
</tr>
@php $counter = 1;$totalnm = 0; $totalbayaran = 0; $totalpinjaman = 0; $totalupah = 0;@endphp
@foreach($tebus as $index=>$item)
@php $totalbayaran += ($item['jenistebus'] === 'S') ? ($item['pinjaman']+$item['bakiupah']) : $item['bakipjm']; $totalpinjaman += $item['pinjaman']; $totalupah += $item['bakiupah']; $totalnm += $item['nilaimarhun'];@endphp
@php $totalbayaran += ($item['jenistebus'] === 'S') ? ($item['pinjaman']+$item['bakiupah']) : $item['bakipjm']; $totalpinjaman += ($item['hargajualan'] != $item['bakihargajualan']) ? $item['gadaibakipjm'] : $item['pinjaman']; $totalupah += $item['bakiupah']; $totalnm += $item['nilaimarhun'];@endphp
@if($index > 0)
@if($item['teller'] != $tebus[$index - 1]['teller'])
<tr>
@@ -240,13 +241,20 @@
<td>
{{ number_format($item['nilaimarhun'],2) }}
</td>
<td>{{ number_format($item['pinjaman'],2) }}</td>
<td>@php
if($item['hargajualan'] !== $item['bakihargajualan'])
echo number_format($item['gadaibakipjm'],2);
else
echo number_format($item['pinjaman'],2);
@endphp</td>
{{-- <td>{{ number_format($item['gadaibakipjm'],2) }}</td> --}}
<td>{{ number_format($item['bakiupah'],2) }}</td>
<td>{{ number_format($item['bakipjm'],2) }}</td>
<td>@php if($item['jenistebus'] == 'S'){ $total=($item['pinjaman']+$item['bakiupah']);echo number_format($total,2);} else echo number_format($item['bakipjm'],2); @endphp</td>
</tr>
@php $counter++; @endphp
@php $totalnmteller += $item['nilaimarhun']; $totalpinjamanteller += $item['pinjaman'];$totalupahteller += $item['bakiupah'];$totalbayaranteller += $item['bakipjm']; @endphp
@php $totalnmteller += $item['nilaimarhun']; $totalpinjamanteller += ($item['hargajualan'] != $item['bakihargajualan']) ? $item['gadaibakipjm'] : $item['pinjaman'];$totalupahteller += $item['bakiupah'];$totalbayaranteller += $item['bakipjm']; @endphp
@php $totaljumlahteller += ($item['jenistebus'] === 'S') ? ($item['pinjaman']+$item['bakiupah']) : $item['bakipjm']; @endphp
@if($index+1 < sizeof($tebus))
@if($item['teller'] != $tebus[$index + 1]['teller'])