@extends('templates.report_layout') @section('content')

Daily Production Summary ({{ $date }})

Item Production Quantities by UOM

@php // Group by both item_id and uom from production output $groupedOutputs = $outputs->groupBy(function($item) { return $item->item_id.'|'.$item->uom; }); @endphp @foreach($groupedOutputs as $groupKey => $groupItems) @php [$itemId, $uomId] = explode('|', $groupKey); $firstItem = $groupItems->first(); // Get item and UOM details $itemName = $firstItem->schedule->productionOrder->item->name ?? 'N/A'; $uomName = $firstItem->unit_of_measure->name ?? 'N/A'; $totalQuantity = $groupItems->sum('quantity'); $outputCount = $groupItems->count(); @endphp @endforeach
Item UnitOfMeasure Quantity Produced
{{ $itemName }} {{ $uomName }} {{ number_format($totalQuantity, 2) }}
Grand Totals {{ number_format($outputs->sum('quantity'), 2) }}
@endsection