{{ $lokasi['nama'] }}

LAPORAN REKAP AKUN

@php $base_cols = [ [ 'key' => 'no', 'label' => 'No', 'width' => '30px' ], [ 'key' => 'kode_akun', 'label' => 'Kode Akun', 'width' => '100px' ], [ 'key' => 'nama_akun', 'label' => 'Nama Akun', 'width' => '180px' ] ]; if($jenis == "Bulanan"){ // Define grouped header types $nilai_cols = [ [ 'key' => 'n1', 'label' => 'Januari', 'width' => '120px' ], [ 'key' => 'n2', 'label' => 'Februari', 'width' => '120px' ], [ 'key' => 'n3', 'label' => 'Maret', 'width' => '120px' ], [ 'key' => 'n4', 'label' => 'April', 'width' => '120px' ], [ 'key' => 'n5', 'label' => 'Mei', 'width' => '120px' ], [ 'key' => 'n6', 'label' => 'Juni', 'width' => '120px' ], [ 'key' => 'n7', 'label' => 'Juli', 'width' => '120px' ], [ 'key' => 'n8', 'label' => 'Agustus', 'width' => '120px' ], [ 'key' => 'n9', 'label' => 'September', 'width' => '120px' ], [ 'key' => 'n10', 'label' => 'Oktober', 'width' => '120px' ], [ 'key' => 'n11', 'label' => 'November', 'width' => '120px' ], [ 'key' => 'n12', 'label' => 'Desember', 'width' => '120px' ], [ 'key' => 'total', 'label' => 'Total', 'width' => '120px'] ]; }else{ $nilai_cols = [ [ 'key' => 'n1', 'label' => 'Triwulan I', 'width' => '120px' ], [ 'key' => 'n2', 'label' => 'Triwulan II', 'width' => '120px' ], [ 'key' => 'n3', 'label' => 'Triwulan III', 'width' => '120px' ], [ 'key' => 'n4', 'label' => 'Triwulan IV', 'width' => '120px' ], [ 'key' => 'total', 'label' => 'Total', 'width' => '120px'] ]; } $all_cols = array_merge($base_cols, $nilai_cols); // Prepare totals $numeric_keys = []; foreach ($nilai_cols as $col) { $numeric_keys[] = $col['key']; } $totals = array_fill_keys($numeric_keys, 0); @endphp @foreach ($all_cols as $col) @endforeach @foreach ($data as $i => $row) @foreach ($all_cols as $col) @php $key = $col['key']; $value = $row[$key] ?? ''; $is_numeric = in_array($key, $numeric_keys); if ($is_numeric) $totals[$key] += floatval($value); @endphp @endforeach @endforeach @foreach ($all_cols as $col) @if (in_array($col['key'], $numeric_keys)) @endif @endforeach
{{ $col['label'] }}
{{ $is_numeric ? App\Helper\SaiHelpers::number_format_decimal($value, $export_type) : $value }}
Total {{ App\Helper\SaiHelpers::number_format_decimal($totals[$col['key']], $export_type) }}