From 966fc914575a8a1c5f1b6852b2839b1f9c632751 Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Sun, 1 Sep 2024 17:21:04 +0800 Subject: [PATCH] fix beberapa laporan --- resources/views/akaun/laporan_ansuran.blade.php | 16 +++++++++++++++- .../views/akaun/laporan_kawalanstok.blade.php | 6 +++--- .../views/akaun/laporan_penebusan.blade.php | 16 ++++++++++++++-- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/resources/views/akaun/laporan_ansuran.blade.php b/resources/views/akaun/laporan_ansuran.blade.php index 1e3aaab..6681dda 100644 --- a/resources/views/akaun/laporan_ansuran.blade.php +++ b/resources/views/akaun/laporan_ansuran.blade.php @@ -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 @@ Bayaran Pemb. (RM) Ujrah (RM) Keuntungan 1% (RM) + Keuntungan Sebenar (Bulan Sama) (RM) Keuntungan (RM) Bayaran (RM) @@ -339,6 +352,7 @@ {{ number_format($totalpendahuluan,2) }} {{ number_format($totalujrah,2) }} {{ number_format($totalonepercent,2) }} + {{ number_format($totalbulansama,2) }} {{ number_format($totalkeuntungan,2) }} {{ number_format($totalduitmasuk,2) }} diff --git a/resources/views/akaun/laporan_kawalanstok.blade.php b/resources/views/akaun/laporan_kawalanstok.blade.php index 80f3822..952cd5e 100644 --- a/resources/views/akaun/laporan_kawalanstok.blade.php +++ b/resources/views/akaun/laporan_kawalanstok.blade.php @@ -471,14 +471,14 @@ Baki - @php $totalbil1 = $gad1 - $teb1 - $lel1 - $ans1 - $hpk1; echo number_format($totalbil1);@endphp + @php $totalbil1 = $gad1 - $teb1 - $lel1 /*- $ans1*/ - $hpk1; echo number_format($totalbil1);@endphp @php $totalpinj1 = $gadpinj1 - $tebpinj1 - $lelpinj1 - $anspinj1 - $hpkpinj1; echo number_format($totalpinj1,2);@endphp - @php $totalbil2 = $gad2 - $teb2 - $lel2 - $ans2 - $hpk2; echo number_format($totalbil2);@endphp + @php $totalbil2 = $gad2 - $teb2 - $lel2 /*- $ans2*/ - $hpk2; echo number_format($totalbil2);@endphp @@ -486,7 +486,7 @@ - @php $totalbil3 = $gad3 - $teb3 - $lel3 = - $ans3 - $hpk3; echo number_format($totalbil3);@endphp + @php $totalbil3 = $gad3 - $teb3 - $lel3 /*- $ans3*/ - $hpk3; echo number_format($totalbil3);@endphp diff --git a/resources/views/akaun/laporan_penebusan.blade.php b/resources/views/akaun/laporan_penebusan.blade.php index 486e396..ed23021 100644 --- a/resources/views/akaun/laporan_penebusan.blade.php +++ b/resources/views/akaun/laporan_penebusan.blade.php @@ -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 @@ {{ number_format(array_key_exists('ujrah',$item) ? $item['ujrah'] : 0,2) }} {{ number_format(array_key_exists('onepercent',$item) ? $item['onepercent'] : 0,2) }} - {{ number_format($item['bakiupah'],2) }} + {{ number_format(($item['ujrah'] == 0) ? $item['bakiupah'] : 0,2) }} {{ number_format($item['bakipjm'],2) }} @php if($item['jenistebus'] == 'S'){ $total=($item['gadaibakipjm']+$item['bakiupah']);echo number_format($total,2);} else echo number_format($item['bakipjm'],2); @endphp @@ -381,6 +391,7 @@ Keuntungan Rebet(RM) Ujrah (RM) Untung 1% (RM) + Keuntungan Sebenar (Bulan Sama) (RM) Pendapatan Kasar (RM) Pendapatan Sebenar(RM) Jumlah (RM) @@ -395,6 +406,7 @@ @endphp {{ number_format($totalujrah,2) }} {{ number_format($totalonepercent,2) }} + {{ number_format($totalbulansama,2) }} {{ number_format($totalupah,2) }} {{ number_format($totalupah - $totalkeuntunganrebet,2) }} {{ number_format($totalbayaran,2) }}