@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
{{-- Total per Label --}}

Total {{ $title_menu }} per Label

{{-- Filter --}}


{{-- --}} {{-- @php $totalall = 0; $ig = 1; @endphp @foreach ($grcurr as $gc) @php $totalall += $gc->total_currency; @endphp @endforeach --}}
No KategoriCurrTotal
{{ $ig++ }} {{ $gc->long_text }} {{ number_format($gc->total_currency, 2) }}
Total Biaya :
{{-- --}}

Detail {{ $title_menu }} per Label



Mengambil data…
No Posting Date Keterangan Kategori Sub. Kategori Label Biaya
Total
{{-- Summary per Bulan --}}

Summary {{ $title_menu }} per Bulan


@foreach ($label_gr as $lg) {{-- 4 --}} @endforeach @php $rowspanCountsL = []; $totalPerKategoriL = []; $groupedRowsL = []; // Kelompokkan data berdasarkan tahun untuk rowspan foreach ($grcurmonthlabel as $rowL) { $year = $rowL['year']; $rowspanCountsL[$year] = ($rowspanCountsL[$year] ?? 0) + 1; $groupedRowsL[$year][] = $rowL; } $currentYear = now()->year; $yearColors = [ '#f0f9ff', // biru muda '#fff7e6', // oranye muda '#ffe9e6', // peach pastel '#fef6ff', // ungu pastel '#fff0f6', // pink pastel ]; $colorMap = []; $i = 0; foreach ($groupedRowsL as $year => $rows) { $colorMap[$year] = $year == $currentYear ? '#d1fae5' // hijau muda untuk tahun sekarang : $yearColors[$i++ % count($yearColors)]; } @endphp {{-- Style untuk pewarnaan background per tahun --}} @php $dynamicStyle = ''; foreach ($colorMap as $year => $color) { $dynamicStyle .= ".bg-tahun-{$year} td { background-color: {$color} !important; }\n"; } @endphp @foreach ($groupedRowsL as $year => $rowsL) @php $rowspan = count($rowsL) + 1; // +1 untuk baris total $yearGrandTotal = 0; // hitung total poin per tahun foreach ($rowsL as $rl) { foreach ($label_gr as $lg) { $yearGrandTotal += $rl['items'][$lg->value] ?? 0; } } @endphp @foreach ($rowsL as $index => $rowL) @php $hasUndefinedInRow = ($rowL['items'][$undefinedKey] ?? 0) > 0; @endphp @if ($index === 0) {{-- Tahun di baris pertama pakai rowspan --}} @endif @foreach ($label_gr as $lg) @php $val = $rowL['items'][$lg->value] ?? 0; $totalPerKategoriL[$lg->value] = ($totalPerKategoriL[$lg->value] ?? 0) + $val; @endphp @endforeach @endforeach {{-- Baris total + kolom tahun --}} @foreach ($label_gr as $lg) @php $totalTahunPerKategori = 0; foreach ($rowsL as $rl) { $totalTahunPerKategori += $rl['items'][$lg->value] ?? 0; } @endphp @endforeach @endforeach @foreach ($label_gr as $lg) @endforeach
Tahun Bulan Label Grand Total
{{ $k->long_text }} {{ $lg->name }}
{{ $year }}
{{ \Carbon\Carbon::create()->month($rowL['month'])->translatedFormat('F') }} {{ number_format($val, 1) }}
Total {{ $year }} : {{ number_format($totalTahunPerKategori, 1) }}
Grand Total {{ number_format($totalPerKategoriL[$lg->value] ?? 0, 1) }} {{ number_format(array_sum($totalPerKategoriL), 1) }}

Chart




@endsection