@extends('layouts.app') @section('content')
Laporan Aging Penebusan
{{-- Dari --}}
{{-- Hingga --}}
{{-- Button Group --}}
{{-- Button Group --}}
{{-- Search --}} {{-- Excel --}}
@if(empty($aging))
Tiada data dijumpai untuk tarikh {{ $endDate }}.
@else
@foreach ($aging[0]['summary_by_tempoh'] as $summary) @endforeach @foreach ($aging[0]['summary_by_tempoh'] as $summary) @endforeach @php $counter = 1; $totalGrandCountByTempoh = array_fill( 0, count($aging[0]['summary_by_tempoh']), 0 ); $totalGrandKeuntunganByTempoh = array_fill( 0, count($aging[0]['summary_by_tempoh']), 0 ); @endphp @foreach ($aging as $branch) @php $totalCount = 0; $totalKeuntungan = 0; @endphp @foreach ($branch['summary_by_tempoh'] as $index => $summary) {{-- Bil --}} {{-- RM --}} @php // Total per cawangan $totalCount += $summary['count']; $totalKeuntungan += $summary['sum_bayaran_keuntungan_rebet']; // Grand total $totalGrandCountByTempoh[$index] += $summary['count']; $totalGrandKeuntunganByTempoh[$index] += $summary['sum_bayaran_keuntungan_rebet']; @endphp @endforeach {{-- Keseluruhan --}} @endforeach @foreach ($totalGrandCountByTempoh as $index => $grandCount) {{-- Grand total bil --}} {{-- Grand total RM --}} @endforeach {{-- Total keseluruhan --}}
Bil. Cawangan{{ $summary['label'] }} Keseluruhan
Bil RM Bil RM
{{ $counter++ }} {{ $branch['cawangan'] }} {{ $summary['count'] }} {{ number_format($summary['sum_bayaran_keuntungan_rebet'], 2) }} {{ $totalCount }} {{ number_format($totalKeuntungan, 2) }}
Total {{ $grandCount }} {{ number_format($totalGrandKeuntunganByTempoh[$index], 2) }} {{ array_sum($totalGrandCountByTempoh) }} {{ number_format(array_sum($totalGrandKeuntunganByTempoh), 2) }}
@endif
@include('layouts.footer')
@endsection