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

List Detail {{ $title_menu }}


{{--
--}} @php $totalCurrency = 0; $i = 1; @endphp @foreach ($gr as $g) @php $totalCurrency += $g->currency_column_ksl; @endphp @endforeach {{-- Jangan pakai colspan di tbody. Biarkan kosong saat tidak ada data --}}
No No. PR Posting Date No Asset Nama Barang Kategori Desc Kategori Qty. PO Qty. GR Curr Nominal
{{ $i++ }} {{ $g->purchase_req }} {{ $g->posting_date }} {{ $g->asset }} {{ $g->text }} {{ $g->long_text }} {{ $g->description }} {{ $g->po_qty }} {{ $g->qty_gr }} {{ $g->currency }} {{ number_format($g->currency_column_ksl, 2) }}
Total {{ number_format($totalCurrency, 2) }}

Total {{ $title_menu }} per kategori


{{--
--}} {{-- --}} @php $totalall = 0; $ig = 1; @endphp @foreach ($grcurr as $gc) @php $totalall += $gc->total_currency; @endphp @endforeach {{-- Jangan pakai colspan di tbody. Biarkan kosong saat tidak ada data --}}
No KategoriCurrTotal
{{ $ig++ }} {{ $gc->long_text }} {{ number_format($gc->total_currency, 2) }}
Total {{ number_format($totalall, 2) }}

Summary {{ $title_menu }} per Bulan


@foreach ($kategori as $k) @endforeach @php $rowspanCounts = []; $totalPerKategori = []; $groupedRows = []; // Kelompokkan data berdasarkan tahun untuk rowspan foreach ($grcurmonth as $row) { $year = $row['year']; $rowspanCounts[$year] = ($rowspanCounts[$year] ?? 0) + 1; $groupedRows[$year][] = $row; } $currentYear = now()->year; $yearColors = [ '#f0f9ff', // biru muda '#fff7e6', // oranye muda '#ffe9e6', // peach pastel '#fef6ff', // ungu pastel '#fff0f6', // pink pastel ]; $colorMap = []; $i = 0; foreach ($groupedRows 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 ($groupedRows as $year => $rows) @php $rowspan = count($rows) + 1; // +1 untuk baris total $yearGrandTotal = 0; // hitung total poin per tahun foreach ($rows as $r) { foreach ($kategori as $k) { $yearGrandTotal += $r['items'][$k->long_text] ?? 0; } } @endphp @foreach ($rows as $index => $row) @if ($index === 0) @endif @foreach ($kategori as $k) @php $val = $row['items'][$k->long_text] ?? 0; $totalPerKategori[$k->long_text] = ($totalPerKategori[$k->long_text] ?? 0) + $val; @endphp @endforeach @if ($index === 0) @endif @endforeach @foreach ($kategori as $k) @php $totalTahunPerKategori = 0; foreach ($rows as $r) { $totalTahunPerKategori += $r['items'][$k->long_text] ?? 0; } @endphp @endforeach @endforeach @foreach ($kategori as $k) @endforeach
Tahun Bulan Kategori Grand Total
{{ $k->long_text }}
{{ $year }}
{{ \Carbon\Carbon::create()->month($row['month'])->translatedFormat('F') }} {{ number_format($val, 1) }} {{ number_format($yearGrandTotal, 1) }}
Total {{ $year }} : {{ number_format($totalTahunPerKategori, 1) }}
Grand Total {{ number_format($totalPerKategori[$k->long_text] ?? 0, 1) }} {{ number_format(array_sum($totalPerKategori), 1) }}

Chart




@endsection