@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
{{-- Tabel Upload --}}
Summary Upload Material by IT
{{--
Bulan : {{ $month }}| Tahun : {{ $year }}
--}}

@foreach ($itname as $it) @endforeach @php // Guard & hitung total kolom untuk colspan pesan kosong $hasData = !empty($sumit) && count($sumit) > 0; $totalCols = 2 + count($itname) + 2; // Tahun + Bulan + IT Name(s) + Total + Grand Total @endphp @if (!$hasData) @else @php $rowspanCounts = []; $totalPerIT = []; $groupedRows = []; $totalPerKategori = []; // Kelompokkan data berdasarkan tahun untuk rowspan foreach ($sumit 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 ($itname as $it) { $yearGrandTotal += $r['items'][$it->value] ?? 0; } } @endphp @foreach ($rows as $index => $row) @if ($index === 0) @endif @foreach ($itname as $it) @php $val = $row['items'][$it->value] ?? 0; $totalPerKategori[$it->value] = ($totalPerKategori[$it->value] ?? 0) + $val; @endphp @endforeach @php $rowTotal = 0; foreach ($itname as $it) { $rowTotal += $row['items'][$it->value] ?? 0; } @endphp @if ($index === 0) @endif @endforeach @foreach ($itname as $it) @php $totalTahunPerKategori = 0; foreach ($rows as $r) { $totalTahunPerKategori += $r['items'][$it->value] ?? 0; } @endphp @endforeach @endforeach @foreach ($itname as $it) @endforeach @endif
Tahun Bulan IT Name Grand Total
{{ $it->name }}Total Grand Total
No data available in table
{{ $year }}
{{ \Carbon\Carbon::create()->month($row['month'])->translatedFormat('F') }} {{ number_format($val, 1) }} {{ number_format($rowTotal, 1) }} {{ number_format($yearGrandTotal, 1) }}
Total {{ $year }} : {{ number_format($totalTahunPerKategori, 1) }} {{ number_format($yearGrandTotal, 1) }}
Grand Total {{ number_format($totalPerKategori[$it->value] ?? 0, 1) }} {{ number_format(array_sum($totalPerKategori), 1) }}
{{-- Tabel Create --}}
Summary Create Material by User
{{--
Bulan : {{ $month }}| Tahun : {{ $year }}
--}}

@foreach ($users as $u) @endforeach @php // Guard & hitung total kolom untuk colspan pesan kosong $hasDataU = !empty($sumusers) && count($sumusers) > 0; $totalColsU = 2 + count($users) + 2; // Tahun + Bulan + IT Name(s) + Total + Grand Total @endphp @if (!$hasDataU) @else @php $rowspanCountsU = []; $totalPerIT = []; $groupedRowsU = []; // Kelompokkan data berdasarkan tahun untuk rowspan foreach ($sumusers as $rowu) { $year = $rowu['year']; $rowspanCountsU[$year] = ($rowspanCountsU[$year] ?? 0) + 1; $groupedRowsU[$year][] = $rowu; } $currentYear = now()->year; $yearColors = [ '#f0f9ff', // biru muda '#fff7e6', // oranye muda '#ffe9e6', // peach pastel '#fef6ff', // ungu pastel '#fff0f6', // pink pastel ]; $colorMap = []; $i = 0; foreach ($groupedRowsU as $year => $rowsu) { $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 ($groupedRowsU as $year => $rowsu) @php $rowspan = count($rowsu) + 1; // +1 untuk baris total $yearGrandTotal = 0; // hitung total poin per tahun foreach ($rowsu as $ru) { foreach ($users as $u) { $yearGrandTotal += $ru['items'][$u->value] ?? 0; } } @endphp @foreach ($rowsu as $index => $rowu) @if ($index === 0) @endif @foreach ($users as $u) @php $val = $rowu['items'][$u->value] ?? 0; $totalPerUser[$u->value] = ($totalPerUser[$u->value] ?? 0) + $val; @endphp @endforeach @php $rowTotal = 0; foreach ($users as $u) { $rowTotal += $rowu['items'][$u->value] ?? 0; } @endphp @if ($index === 0) @endif @endforeach @foreach ($users as $u) @php $totalTahunPerUser = 0; foreach ($rowsu as $ru) { $totalTahunPerUser += $ru['items'][$u->value] ?? 0; } @endphp @endforeach @endforeach @foreach ($users as $u) @endforeach @endif
Tahun Bulan User Grand Total
{{ $u->name }}Total Grand Total
No data available in table
{{ $year }}
{{ \Carbon\Carbon::create()->month($rowu['month'])->translatedFormat('F') }} {{ number_format($val, 1) }} {{ number_format($rowTotal, 1) }} {{ number_format($yearGrandTotal, 1) }}
Total {{ $year }} : {{ number_format($totalTahunPerUser, 1) }} {{ number_format($yearGrandTotal, 1) }}
Grand Total {{ number_format($totalPerUser[$u->value] ?? 0, 1) }} {{ number_format(array_sum($totalPerUser), 1) }}
{{-- Tabel JAM Create --}}
Summary Create Material by Time
{{--
Bulan : {{ $month }}| Tahun : {{ $year }}
--}}

@foreach ($time as $t) @endforeach @php // Guard & hitung total kolom untuk colspan pesan kosong $hasDataT = !empty($sumtime) && count($sumtime) > 0; $totalColsT = 2 + count($time) + 2; // Tahun + Bulan + IT Name(s) + Total + Grand Total @endphp @if (!$hasDataT) @else @php $rowspanCountsT = []; $totalPerIT = []; $groupedRowsT = []; // Kelompokkan data berdasarkan tahun untuk rowspan foreach ($sumtime as $rowt) { $year = $rowt['year']; $rowspanCountsT[$year] = ($rowspanCountsT[$year] ?? 0) + 1; $groupedRowsT[$year][] = $rowt; } $currentYear = now()->year; $yearColors = [ '#f0f9ff', // biru muda '#fff7e6', // oranye muda '#ffe9e6', // peach pastel '#fef6ff', // ungu pastel '#fff0f6', // pink pastel ]; $colorMap = []; $i = 0; foreach ($groupedRowsT as $year => $rowst) { $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 ($groupedRowsT as $year => $rowst) @php $rowspan = count($rowst) + 1; // +1 untuk baris total $yearGrandTotal = 0; // hitung total poin per tahun foreach ($rowst as $rt) { foreach ($time as $t) { $yearGrandTotal += $rt['items'][$t->value] ?? 0; } } @endphp @foreach ($rowst as $index => $rowt) @if ($index === 0) @endif @foreach ($time as $t) @php $val = $rowt['items'][$t->value] ?? 0; $totalPerTime[$t->value] = ($totalPerTime[$t->value] ?? 0) + $val; @endphp @endforeach @php $rowTotal = 0; foreach ($time as $t) { $rowTotal += $rowt['items'][$t->value] ?? 0; } @endphp @if ($index === 0) @endif @endforeach @foreach ($time as $t) @php $totalTahunPerTime = 0; foreach ($rowst as $rt) { $totalTahunPerTime += $rt['items'][$t->value] ?? 0; } @endphp @endforeach @endforeach @foreach ($time as $t) @endforeach @endif
Tahun Bulan Time Grand Total
{{ $t->name }}Total Grand Total
No data available in table
{{ $year }}
{{ \Carbon\Carbon::create()->month($rowt['month'])->translatedFormat('F') }} {{ number_format($val, 1) }} {{ number_format($rowTotal, 1) }} {{ number_format($yearGrandTotal, 1) }}
Total {{ $year }} : {{ number_format($totalTahunPerTime, 1) }} {{ number_format($yearGrandTotal, 1) }}
Grand Total {{ number_format($totalPerTime[$t->value] ?? 0, 1) }} {{ number_format(array_sum($totalPerTime), 1) }}
{{-- Tabel ID MAt Group --}}
Summary Material by ID Mat Group
{{--
Bulan : {{ $month }}| Tahun : {{ $year }}
--}}

@foreach ($matgroup as $mg) @endforeach @php // Guard & hitung total kolom untuk colspan pesan kosong $hasDataMG = !empty($summatgroup) && count($summatgroup) > 0; $totalColsMG = 2 + count($matgroup) + 2; // Tahun + Bulan + IT Name(s) + Total + Grand Total @endphp @if (!$hasDataMG) @else @php $rowspanCountsMG = []; $totalPerIT = []; $groupedRowsMG = []; // Kelompokkan data berdasarkan tahun untuk rowspan foreach ($summatgroup as $rowmg) { $year = $rowmg['year']; $rowspanCountsMG[$year] = ($rowspanCountsMG[$year] ?? 0) + 1; $groupedRowsMG[$year][] = $rowmg; } $currentYear = now()->year; $yearColors = [ '#f0f9ff', // biru muda '#fff7e6', // oranye muda '#ffe9e6', // peach pastel '#fef6ff', // ungu pastel '#fff0f6', // pink pastel ]; $colorMap = []; $i = 0; foreach ($groupedRowsMG as $year => $rowsmg) { $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 ($groupedRowsMG as $year => $rowsmg) @php $rowspan = count($rowsmg) + 1; // +1 untuk baris total $yearGrandTotal = 0; // hitung total poin per tahun foreach ($rowsmg as $rmg) { foreach ($matgroup as $mg) { $yearGrandTotal += $rmg['items'][$mg->value] ?? 0; } } @endphp @foreach ($rowsmg as $index => $rowmg) @if ($index === 0) @endif @foreach ($matgroup as $mg) @php $val = $rowmg['items'][$mg->value] ?? 0; $totalPerMG[$mg->value] = ($totalPerMG[$mg->value] ?? 0) + $val; @endphp @endforeach @php $rowTotal = 0; foreach ($matgroup as $mg) { $rowTotal += $rowmg['items'][$mg->value] ?? 0; } @endphp @if ($index === 0) @endif @endforeach @foreach ($matgroup as $mg) @php $totalTahunPerMG = 0; foreach ($rowsmg as $rmg) { $totalTahunPerMG += $rmg['items'][$mg->value] ?? 0; } @endphp @endforeach @endforeach @foreach ($matgroup as $mg) @endforeach @endif
Tahun Bulan Material Group Grand Total
{{ $mg->value }} ({{ $mg->name }}) Total Grand Total
No data available in table
{{ $year }}
{{ \Carbon\Carbon::create()->month($rowmg['month'])->translatedFormat('F') }} {{ number_format($val, 1) }} {{ number_format($rowTotal, 1) }} {{ number_format($yearGrandTotal, 1) }}
Total {{ $year }} : {{ number_format($totalTahunPerMG, 1) }} {{ number_format($yearGrandTotal, 1) }}
Grand Total {{ number_format($totalPerMG[$mg->value] ?? 0, 1) }} {{ number_format(array_sum($totalPerMG), 1) }}


{{-- retrieve table list --}} @foreach ($list_material as $list) @endforeach
No Kode Baru FG ID Material Grup Customer Product Name Division Keterangan Alt UOM Status Created By Upload By Created At
1 {{ $list->kode_baru_fg }} {{ $list->id_mat_group }} {{ $list->customer }} {{ $list->product_name }} {{ $list->division }} {{ $list->keterangan }} {{ $list->alt_uom }} {{ $list->status }} {{ $list->user_create }} {{ $list->it_update }} {{ $list->created_at }}

@endsection