From 49857f25e98aff47d24d01e779eb39de82aeea87 Mon Sep 17 00:00:00 2001 From: Amirah Date: Wed, 6 Dec 2023 16:44:31 +0800 Subject: [PATCH] recall code ansuran lama --- .../views/khazanah/laporan/ansuran.blade.php | 24 ++- .../views/khazanah/laporan/index.blade.php | 2 +- .../views/print/laporan_ansuran.blade.php | 203 +++++++++++------- 3 files changed, 150 insertions(+), 79 deletions(-) diff --git a/resources/views/khazanah/laporan/ansuran.blade.php b/resources/views/khazanah/laporan/ansuran.blade.php index 5d7fa10..2e93c50 100644 --- a/resources/views/khazanah/laporan/ansuran.blade.php +++ b/resources/views/khazanah/laporan/ansuran.blade.php @@ -9,7 +9,6 @@ @@ -45,15 +44,19 @@ Nama No K/P Tempoh - Baki Pembiayaan - Bayaran - Keuntungan + Baki Pembiayaan (RM) + Bayaran (RM) + Ujrah (RM) + Keuntungan 1% (RM) + Keuntungan (RM) TOTAL + + @@ -114,6 +117,8 @@ var total_pinjaman = 0; var total_bayaran = 0; var total_keuntungan = 0; + var total_ansuranujrah = 0; + var total_ansuranonepercent = 0; tabletebus.clear().draw(); $.each(data,function(index,tebus){ $.ajax({ @@ -127,6 +132,9 @@ total_pinjaman += Number(gadai[0][0]['bakipjm']); total_bayaran += Number(tebus['duit_masuk']); total_keuntungan += Number(tebus['bayaran_keuntungan']); + total_ansuranujrah += Number(tebus['ansuranujrah']); + total_ansuranonepercent += Number(tebus['ansuranonepercent']); + tabletebus.row.add([ counter, tebus['norujukan'], @@ -135,15 +143,23 @@ gadai[0][0]['tempoh'], gadai[0][0]['bakipjm'], tebus['duit_masuk'], + tebus['ansuranujrah'], + tebus['ansuranonepercent'], tebus['bayaran_keuntungan'] ]).draw(); $('#pinjamantotal').text(formatter.format(total_pinjaman.toFixed(2))); $('#bayarantotal').text(formatter.format(total_bayaran.toFixed(2))); + $('#ansuranujrahtotal').text(formatter.format(total_ansuranujrah.toFixed(2))); + $('#ansuranonepercenttotal').text(formatter.format(total_ansuranonepercent.toFixed(2))); $('#keuntungantotal').text(formatter.format(total_keuntungan.toFixed(2))); + + counter = counter + 1; } }); } }); + + }); } diff --git a/resources/views/khazanah/laporan/index.blade.php b/resources/views/khazanah/laporan/index.blade.php index 56fee70..e033d5c 100644 --- a/resources/views/khazanah/laporan/index.blade.php +++ b/resources/views/khazanah/laporan/index.blade.php @@ -90,7 +90,7 @@
Stok Audit diff --git a/resources/views/print/laporan_ansuran.blade.php b/resources/views/print/laporan_ansuran.blade.php index 3fe8880..a0f6f69 100644 --- a/resources/views/print/laporan_ansuran.blade.php +++ b/resources/views/print/laporan_ansuran.blade.php @@ -203,99 +203,154 @@ No Rujukan Nama No K/P + Tarikh Bayaran Tempoh Baki Pembiayaan (RM) Bayaran Pemb. (RM) + Ujrah(RM) + Keuntungan 1% (RM) Keuntungan (RM) Bayaran (RM) - @php $counter = 1;$totalduitmasuk = 0;$totalkeuntungan = 0; $totalpendahuluan = 0;@endphp - @foreach($tebus as $index=>$item) - @php $totalduitmasuk += $item['duit_masuk'];$totalkeuntungan += $item['bayaran_keuntungan'];$totalpendahuluan += $item['bayaran_pembiayaan']; @endphp - @if($index > 0) - @if($item['teller'] != $tebus[$index - 1]['teller']) - - Teller : {{ $item['teller'] }} - - @php $totaldmteller = 0;$totalupahteller = 0;$totalpendhteller = 0; @endphp - @endif - @else - - Teller : {{ $item['teller'] }} - - @php $totaldmteller = 0;$totalupahteller = 0;$totalpendhteller = 0; @endphp + @php + $counter = 1; + $totalduitmasuk = 0; + $totalkeuntungan = 0; + $totalpendahuluan = 0; + $totalujrah = 0; + $totalonepercent = 0; +@endphp +@foreach($tebus as $index=>$item) +@php + $totalduitmasuk += $item['duit_masuk']; + $totalkeuntungan += $item['bayaran_keuntungan']; + $totalpendahuluan += $item['bayaran_pembiayaan']; + $totalujrah += bcdiv(round($item['ansuranujrah'],2),1,1); + $totalonepercent += bcdiv(round($item['ansuranonepercent'],2),1,1); +@endphp + +@if($index > 0) +@if($item['teller'] != $tebus[$index - 1]['teller']) + + Teller : {{ $item['teller'] }} + + @php + $totaldmteller = 0; + $totalupahteller = 0; + $totalpendhteller = 0; + $totalujrahteller = 0; + $totalonepercentteller = 0; + @endphp +@endif +@else + + Teller : {{ $item['teller'] }} + + @php + $totaldmteller = 0; + $totalupahteller = 0; + $totalpendhteller = 0; + $totalujrahteller = 0; + $totalonepercentteller = 0; + @endphp +@endif + +{{ $counter }} +{{$item['norujukan']}} +{{ $item['nama'] }} +{{ $item['nokp'] }} + @php + $myDateTime = DateTime::createFromFormat('Y-m-d H:i:s', $item['tarikh_bayaran']); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate) +@endphp +{{ $item['tempoh'] }} +{{ number_format($item['bakipjm'],2) }} +{{ number_format($item['bayaran_pembiayaan'],2) }} +{{ number_format(bcdiv(round($item['ansuranujrah'],2),1,1),2) }} +{{ number_format(bcdiv(round($item['ansuranonepercent'],2),1,1),2) }} +{{ number_format($item['bayaran_keuntungan'],2) }} +{{ number_format($item['duit_masuk'],2) }} + +@php $counter++; @endphp +@php + $totaldmteller += $item['duit_masuk']; + $totalupahteller += $item['bayaran_keuntungan']; + $totalpendhteller += $item['bayaran_pembiayaan']; + $totalujrahteller += bcdiv(round($item['ansuranujrah'],2),1,1); + $totalonepercentteller += bcdiv(round($item['ansuranonepercent'],2),1,1); +@endphp + +@if($index+1 < sizeof($tebus)) + @if($item['teller'] != $tebus[$index + 1]['teller']) + + {{ $counter-1 }} Jumlah Bagi Teller : {{ $item['teller'] }} + {{ number_format($totalpendhteller,2) }} + {{ number_format($totalujrahteller,2) }} + {{ number_format($totalonepercentteller,2) }} + {{ number_format($totalupahteller,2) }} + {{ number_format($totaldmteller,2) }} + + @php + $counter = 1; + $totaldmteller = 0; + $totalupahteller = 0; + $totalpendhteller = 0; + @endphp @endif - - {{ $counter }} - {{$item['norujukan']}} - {{ $item['nama'] }} - {{ $item['nokp'] }} - {{ $item['tempoh'] }} - {{ number_format($item['bakipjm'],2) }} - {{ number_format($item['bayaran_pembiayaan'],2) }} - {{ number_format($item['bayaran_keuntungan'],2) }} - {{ number_format($item['duit_masuk'],2) }} - - @php $counter++; @endphp - @php $totaldmteller += $item['duit_masuk'];$totalupahteller += $item['bayaran_keuntungan'];$totalpendhteller += $item['bayaran_pembiayaan']; @endphp - @if($index+1 < sizeof($tebus)) - @if($item['teller'] != $tebus[$index + 1]['teller']) - - {{ $counter-1 }} Jumlah Bagi Teller : {{ $item['teller'] }} - {{ number_format($totalpendhteller,2) }} - {{ number_format($totalupahteller,2) }} - {{ number_format($totaldmteller,2) }} - - @php $counter = 1;$totaldmteller = 0;$totalupahteller = 0;$totalpendhteller = 0;@endphp - @endif - @else - - {{ $counter-1 }} Jumlah Bagi Teller : {{ $item['teller'] }} - {{ number_format($totalpendhteller,2) }} - {{ number_format($totalupahteller,2) }} - {{ number_format($totaldmteller,2) }} - - @endif - @endforeach +@else + + {{ $counter-1 }} Jumlah Bagi Teller : {{ $item['teller'] }} + {{ number_format($totalpendhteller,2) }} + {{ number_format($totalujrahteller,2) }} + {{ number_format($totalonepercentteller,2) }} + {{ number_format($totalupahteller,2) }} + {{ number_format($totaldmteller,2) }} + +@endif +@endforeach

- - - - - - - - - - - - + + + + + + + + + + + + + + + +
Bayaran Pemb. (RM)Keuntungan (RM)Bayaran (RM)
JUMLAH KESELURUHAN{{ number_format($totalpendahuluan,2) }}{{ number_format($totalkeuntungan,2) }}{{ number_format($totalduitmasuk,2) }}
Bayaran Pemb. (RM)Ujrah (RM)Keuntungan 1% (RM)Keuntungan (RM)Bayaran (RM)
JUMLAH KESELURUHAN{{ number_format($totalpendahuluan,2) }}{{ number_format($totalujrah,2) }}{{ number_format($totalonepercent,2) }}{{ number_format($totalkeuntungan,2) }}{{ number_format($totalduitmasuk,2) }}




- - - - - - - - - - - - - - + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
-