@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @if (empty($selected_detail_month)) @include('layouts.navbars.auth.topnav', ['title' => '']) @endif
{{-- CARD 1: Pie Chart & Komposisi ZSUP --}}
Komposisi ZSUP Berdasarkan Material Group
@if (!empty($selected_detail_month))
Data Bulan: {{ \Carbon\Carbon::createFromFormat('Y-m', $selected_detail_month)->translatedFormat('F Y') }}
@endif
@php $grandTotal = 0; @endphp @foreach ($zsupByMatkl as $matkl => $items) @php $matklId = Str::slug($matkl, '_'); $matklTotal = $items->sum('total_value'); $grandTotal += $matklTotal; @endphp @endforeach
Material Group Curr Total
{{ $matkl }} ({{ $items->count() }} item) IDR {{ number_format($matklTotal) }}
@foreach ($items as $row) @endforeach
- {{ $row->MAKTX }} {{ number_format($row->total_value) }}
Total IDR {{ number_format($grandTotal) }}
{{-- CARD 2: Summary Bulanan --}}
Summary Nilai per Bulan (ZSUP - {{ \Carbon\Carbon::createFromFormat('Ym', $yearMonth)->format('Y') }})
@foreach ($months as $m) @endforeach @foreach ($monthlySummary as $row) @foreach ($months as $m) @php $key = $m['key']; @endphp @endforeach @endforeach
Mt. Type Curr{{ $m['label'] }}TOTAL
{{ $row['MTART'] }} IDR{{ number_format($row[$key] ?? 0) }}{{ number_format($row['TOTAL'] ?? 0) }}
{{-- CARD 3: Top Vendor & Top Material --}}
{{-- CARD: Top Vendor --}}
Top Vendor (ZSUP)
@php $grandTotal = $topVendors->sum('total'); @endphp @foreach ($topVendors->take(5) as $vendor => $data) @php $vendorId = \Str::slug($vendor) @endphp @endforeach @if ($topVendors->count() > 5) @endif @foreach ($topVendors->slice(5) as $vendor => $data) @php $vendorId = \Str::slug($vendor) @endphp @endforeach
Vendor Curr Total
{{ $vendor }} ({{ count($data['details']) }} item) IDR {{ number_format($data['total']) }}
@foreach ($data['details'] as $item) @endforeach
-{{ $item->MAKTX }} {{ number_format($item->total_value) }}
{{ $vendor }} ({{ count($data['details']) }} item) IDR {{ number_format($data['total']) }}
@foreach ($data['details'] as $item) @endforeach
-{{ $item->MAKTX }} {{ number_format($item->total_value) }}
TOTAL {{ number_format($grandTotal) }}
{{-- CARD: Top Material --}}
Top Material (ZSUP)
@php $grandTotal = $topMaterials->sum('total_value'); @endphp @foreach ($topMaterials->take(5) as $i => $m) @endforeach @if ($topMaterials->count() > 5) @endif @if ($topMaterials->count() > 5) @foreach ($topMaterials->slice(5)->values() as $j => $m) @endforeach @endif
Material Curr Total
@foreach ($m->budat_list as $d) @endforeach
-{{ $d->MAKTX }} ({{ $d->BUDAT }}) {{ number_format($d->ksl) }}
@foreach ($m->budat_list as $d) @endforeach
-{{ $d->MAKTX }} ({{ $d->BUDAT }}) {{ number_format($d->ksl) }}
TOTAL {{ number_format($grandTotal) }}
@endsection @push('js') @endpush