fix stok audit combine

This commit is contained in:
Amirah
2024-02-19 10:22:54 +08:00
parent 812c6b51c0
commit 83e2e36052
2 changed files with 27 additions and 9 deletions
+2 -2
View File
@@ -1524,14 +1524,14 @@ class AkaunController extends Controller
if($request->jenis == 'pdf')
{
$stokaudit_aktif = Http::get($api_url. '/api/stokaudit/aktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
$stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
$stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktifcombine/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
$pdf = PDF::loadView('akaun.laporan_stokaudit_combine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','tebus_date','api_url'))->setPaper('a4', 'potrait');
return $pdf->download('laporan_stokaudit_' . $request->kodcaw .'_'. $tebus_date . '.pdf');
}
else{
$stokaudit_aktif = Http::get($api_url. '/api/stokaudit/aktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
$stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
$stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktifcombine/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
return view('akaun.laporan_stokaudit_combine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
}
@@ -239,12 +239,15 @@
<th>Keuntungan Belum Bayar (RM)</th>
<th>Lanjutan</th>
</thead>
@php $counter = 1;$totalpinjaman = 0; @endphp
@php
$counter_aktif = 1;
$totalpinjaman = 0;
@endphp
@foreach($stokaudit_aktif['rekod'] as $index=>$item)
@php if($item['hargajualan'] == null) $totalpinjaman += $item['pinjaman']; else $totalpinjaman +=
$item['bakipjm']; @endphp
<tr>
<td>{{ $counter }}</td>
<td>{{ $counter_aktif }}</td>
<td>{{$item['norujukan']}}</td>
<td>{{ $item['tempoh'] }}</td>
<td>{{$item['nokp']}}</td>
@@ -259,7 +262,7 @@
{{-- <td>{{ number_format($item['pinjaman'],2) }}</td> --}}
<td>{{$item['lelong_tawarruq']}}</td>
</tr>
@php $counter++; @endphp
@php $counter_aktif++; @endphp
@endforeach
<tfoot>
<th colspan='4'>Jumlah</th>
@@ -325,12 +328,12 @@
<th>Pembiayaan</th>
<th>Lanjutan</th>
</thead>
@php $counter = 1;$totalpinjaman = 0; @endphp
@php $counter_xaktif = 1;$totalpinjaman = 0; @endphp
@foreach($stokaudit_takaktif['rekod'] as $index=>$item)
@php if($item['hargajualan'] == null) $totalpinjaman += $item['pinjaman']; else $totalpinjaman +=
$item['bakipjm']; @endphp
<tr>
<td>{{ $counter }}</td>
<td>{{ $counter_xaktif }}</td>
<td>{{$item['norujukan']}}</td>
<td>{{ $item['jbg'] }}</td>
<td>{{$item['nokp']}}</td>
@@ -341,7 +344,7 @@
number_format($item['bakipjm'],2); @endphp</td>
<td>{{$item['lelong_tawarruq']}}</td>
</tr>
@php $counter++; @endphp
@php $counter_xaktif++; @endphp
@endforeach
<tfoot>
<th colspan='4'>Jumlah</th>
@@ -353,7 +356,22 @@
</tfoot>
</table>
<br>
<br><br>
@php
$total_bilangan =($counter_aktif - 1) + ($counter_xaktif - 1);
$total_nm = $stokaudit_aktif['totalnilaimarhun'] + $stokaudit_takaktif['totalnilaimarhun'];
@endphp
<table id="details" style="border-top:1px solid black;border-bottom:1px solid black;text-align:center;">
<tr>
<th colspan="9" style="text-align: center;"><b>JUMLAH BILANGAN = {{ $total_bilangan }}</b></th>
<th colspan="9" style="text-align: center;"><b>JUMLAH NILAI MARHUN (RM) = {{
number_format($total_nm,2)}}</b></th>
</tr>
</table>
<br>
<table id="sign">
<tr>