@php $totalSku = count($data); $totalOut = array_sum(array_map(fn($r) => (float)($r->{'TOTAL OUT'} ?? 0), $data)); $avgMonthlyAll = $totalSku > 0 ? round(array_sum(array_map(fn($r) => (float)($r->{'AVG BULAN (BAG)'} ?? 0), $data)) / $totalSku, 2) : 0; $avgDailyAll = $totalSku > 0 ? round(array_sum(array_map(fn($r) => (float)($r->{'AVG HARI (BAG)'} ?? 0), $data)) / $totalSku, 2) : 0; @endphp

LAPORAN SUMMARY PEMAKAIAN MATERIAL

Periode: {{ \Carbon\Carbon::parse($filters['date_from'])->format('d/m/Y') }} - {{ \Carbon\Carbon::parse($filters['date_to'])->format('d/m/Y') }}

Dicetak: {{ now()->format('d/m/Y H:i:s') }}

{{ number_format($totalSku) }}

Total SKU

{{ number_format($totalOut) }}

Total Keluar (Bag)

{{ number_format($avgMonthlyAll, 2) }}

Rata2 Bulanan (Bag)

{{ number_format($avgDailyAll, 2) }}

Rata2 Harian (Bag)

@forelse($data as $index => $item) @empty @endforelse
No SKU Material Grade Total Out Jml Bulan Avg Bulan (Bag) Avg Hari (Bag) Stok Bag Stok Berat Estimasi Habis (Hari) Last Updated
{{ $index + 1 }} {{ $item->SKU }} {{ $item->MATERIAL }} {{ $item->GRADE }} {{ number_format($item->{'TOTAL OUT'} ?? 0) }} {{ number_format($item->{'JUMLAH BULAN'} ?? 0) }} {{ number_format($item->{'AVG BULAN (BAG)'} ?? 0, 2) }} {{ number_format($item->{'AVG HARI (BAG)'} ?? 0, 2) }} {{ number_format($item->{'STOK BAG'} ?? 0) }} {{ is_numeric($item->{'STOK BERAT'} ?? 0) ? number_format((float)$item->{'STOK BERAT'}, 2) : ($item->{'STOK BERAT'} ?? '0.00') }} kg {{ number_format((float)($item->{'ESTIMASI HABIS (HARI)'} ?? 0), 1) }} {{ $item->{'LAST UPDATED'} ?? '-' }}
Tidak ada data