Merged in hotfix/laporan (pull request #61)

fix beberapa laporan
This commit is contained in:
Muhd hafifie
2024-09-01 09:23:08 +00:00
3 changed files with 32 additions and 6 deletions
@@ -221,9 +221,20 @@
$totalpendahuluan = 0;
$totalujrah = 0;
$totalonepercent = 0;
$totalbulansama = 0;
@endphp
@foreach($tebus as $index=>$item)
@php
$tarikh_tebus = new DateTime($item['tarikh_bayaran']);
$tarikh_gadai = new DateTime($item['t_gadai']);
$month_tebus = $tarikh_tebus->format('m');
$month_gadai = $tarikh_gadai->format('m');
$year_tebus = $tarikh_tebus->format('Y');
$year_gadai = $tarikh_gadai->format('Y');
$totalduitmasuk += $item['duit_masuk'];
$totalkeuntungan += $item['bayaran_keuntungan'];
$totalpendahuluan += $item['bayaran_pembiayaan'];
@@ -231,7 +242,8 @@
$totalujrah += $item['ansuranujrah'];
// $totalujrah += array_key_exists('ansuranujrah', $item) ? $item['ansuranujrah']: 0;
$totalonepercent += $item['ansuranonepercent'];
// $totalonepercent += array_key_exists('ansuranonepercent', $item) ? $item['ansuranonepercent'] : 0;
// $totalonepercent += array_key_exists('ansuranonepercent', $item) ? $item['ansuranonepercent'] : 0;
$totalbulansama += (($month_tebus == $month_gadai) && ($year_tebus == $year_gadai)) ? $item['bayaran_keuntungan'] : 0;
@endphp
@if($index > 0)
@@ -331,6 +343,7 @@
<th style="text-align:center;">Bayaran Pemb. (RM)</th>
<th style="text-align:center;">Ujrah (RM)</th>
<th style="text-align:center;">Keuntungan 1% (RM)</th>
<th style="text-align:center;">Keuntungan Sebenar (Bulan Sama) (RM)</th>
<th style="text-align:center;">Keuntungan (RM)</th>
<th style="text-align:center;">Bayaran (RM)</th>
</tr>
@@ -339,6 +352,7 @@
<td>{{ number_format($totalpendahuluan,2) }}</td>
<td>{{ number_format($totalujrah,2) }}</td>
<td>{{ number_format($totalonepercent,2) }}</td>
<td>{{ number_format($totalbulansama,2) }}</td>
<td>{{ number_format($totalkeuntungan,2) }}</td>
<td>{{ number_format($totalduitmasuk,2) }}</td>
</tr>
@@ -471,14 +471,14 @@
<tr style="font-weight:bold;">
<td colspan="2">Baki</td>
<td style="text-align: right;">
@php $totalbil1 = $gad1 - $teb1 - $lel1 - $ans1 - $hpk1; echo number_format($totalbil1);@endphp
@php $totalbil1 = $gad1 - $teb1 - $lel1 /*- $ans1*/ - $hpk1; echo number_format($totalbil1);@endphp
</td>
<td style="text-align: right;">
@php $totalpinj1 = $gadpinj1 - $tebpinj1 - $lelpinj1 - $anspinj1 - $hpkpinj1; echo number_format($totalpinj1,2);@endphp
</td>
<td style="text-align: right;">
@php $totalbil2 = $gad2 - $teb2 - $lel2 - $ans2 - $hpk2; echo number_format($totalbil2);@endphp
@php $totalbil2 = $gad2 - $teb2 - $lel2 /*- $ans2*/ - $hpk2; echo number_format($totalbil2);@endphp
</td>
<td style="text-align: right;">
@@ -486,7 +486,7 @@
</td>
<td style="text-align: right;">
@php $totalbil3 = $gad3 - $teb3 - $lel3 = - $ans3 - $hpk3; echo number_format($totalbil3);@endphp
@php $totalbil3 = $gad3 - $teb3 - $lel3 /*- $ans3*/ - $hpk3; echo number_format($totalbil3);@endphp
</td>
<td style="text-align: right;">
@@ -230,10 +230,20 @@
$totalupah = 0;
$totalujrah = 0;
$totalonepercent = 0;
$totalbulansama = 0;
@endphp
@foreach($tebus as $index=>$item)
@php
$tarikh_tebus = new DateTime($item['t_tebus']);
$tarikh_gadai = new DateTime($item['t_gadai']);
$month_tebus = $tarikh_tebus->format('m');
$month_gadai = $tarikh_gadai->format('m');
$year_tebus = $tarikh_tebus->format('Y');
$year_gadai = $tarikh_gadai->format('Y');
$totalbayaran += ($item['jenistebus'] === 'S') ? ($item['gadaibakipjm']+$item['bakiupah']) : $item['bakipjm'];
$totalpinjaman += ($item['hargajualan'] != $item['bakihargajualan']) ? $item['gadaibakipjm'] : $item['pinjaman'];
$totalupah += $item['bakiupah'];
@@ -241,7 +251,7 @@
$totalnm += $item['nilaimarhun'];
$totalujrah += array_key_exists('ujrah',$item) ? $item['ujrah'] : 0;
$totalonepercent += array_key_exists('onepercent',$item) ? $item['onepercent'] : 0;
$totalbulansama += (($month_tebus == $month_gadai) && ($year_tebus == $year_gadai)) ? ($item['ujrah'] == 0) ? $item['bakiupah'] : ($item['ujrah'] + $item['onepercent']) : 0;
@endphp
@if($index > 0)
@@ -310,7 +320,7 @@
</td>
<td>{{ number_format(array_key_exists('ujrah',$item) ? $item['ujrah'] : 0,2) }}</td>
<td>{{ number_format(array_key_exists('onepercent',$item) ? $item['onepercent'] : 0,2) }}</td>
<td>{{ number_format($item['bakiupah'],2) }}</td>
<td>{{ number_format(($item['ujrah'] == 0) ? $item['bakiupah'] : 0,2) }}</td>
<td>{{ number_format($item['bakipjm'],2) }}</td>
<td>@php if($item['jenistebus'] == 'S'){ $total=($item['gadaibakipjm']+$item['bakiupah']);echo number_format($total,2);} else echo number_format($item['bakipjm'],2); @endphp</td>
</tr>
@@ -381,6 +391,7 @@
<th style="text-align:center;">Keuntungan Rebet(RM)</th>
<th style="text-align:center;">Ujrah (RM)</th>
<th style="text-align:center;">Untung 1% (RM)</th>
<th style="text-align:center;">Keuntungan Sebenar (Bulan Sama) (RM)</th>
<th style="text-align:center;">Pendapatan Kasar (RM)</th>
<th style="text-align:center;">Pendapatan Sebenar(RM)</th>
<th style="text-align:center;">Jumlah (RM)</th>
@@ -395,6 +406,7 @@
@endphp</td>
<td>{{ number_format($totalujrah,2) }}</td>
<td>{{ number_format($totalonepercent,2) }}</td>
<td>{{ number_format($totalbulansama,2) }}</td>
<td>{{ number_format($totalupah,2) }}</td>
<td>{{ number_format($totalupah - $totalkeuntunganrebet,2) }}</td>
<td>{{ number_format($totalbayaran,2) }}</td>