@php $org = auth()->user()->organization ?? \App\Models\System\Organization::find(auth()->user()->organization_id); @endphp @extends('documents.procurement._layout', [ 'documentTitle' => 'Material Consumption', 'reference' => null, 'documentDate' => $reportDate, 'noAutoPrint' => true, ]) @section('header-meta')
|
Records {{ $consumptions->count() }} |
Raw Materials {{ $byProduct->count() }} |
Total Cost ({{ $currency }}) {{ number_format($totalCost, 0) }} |
No confirmed material consumptions found for this period.
@else @foreach($byProduct as $productId => $productRows) @php $product = $productRows->first()->product; $totalPQty = $productRows->sum('quantity_consumed'); $totalPCost = $productRows->sum('total_cost_base'); @endphpTotal consumed: {{ number_format($totalPQty, 4) }} {{ $product?->uom ?? '' }} · Total cost: {{ $currency }} {{ number_format($totalPCost, 2) }}
| Production Order | Finished Product | Lot | Qty Consumed | UoM | Unit Cost ({{ $currency }}) | Total Cost ({{ $currency }}) | Confirmed |
|---|---|---|---|---|---|---|---|
| {{ $c->productionOrder?->production_reference ?? '—' }} | {{ $c->productionOrder?->product?->name ?? '—' }} | {{ $c->lot?->lot_number ?? '—' }} | {{ number_format((float) ($c->quantity_consumed ?? 0), 4) }} | {{ $c->quantity_uom ?? $product?->uom ?? '—' }} | {{ number_format((float) $c->unit_cost_snapshot_base, 4) }} | {{ number_format((float) $c->total_cost_base, 2) }} | {{ $c->consumed_at ? \Carbon\Carbon::parse($c->consumed_at)->format('d M Y') : '—' }} |
| Grand Total Cost ({{ $currency }}) | {{ number_format($totalCost, 2) }} |