@extends('master.app') @section('title','Batch Details') @section('body')
Batch Details
Token: {{ $batch->token }}
Back
Date
{{ $batch->date }}
Location
{{ $batch->location_id ?? '—' }}
Total Raw Cost
{{ number_format($batch->total_raw_cost ?? 0, 2) }}
Produce CPI
{{ number_format($batch->produce_cpi ?? 0, 4) }}
Notes
{{ $batch->notes ?? '—' }}
{{-- RAW ITEMS --}}
Raw Items (Consumed)
@php $rawTotalQty = 0; $rawTotalCost = 0; @endphp @forelse($batch->rawItems as $i => $r) @php $rawTotalQty += (float)($r->qty_used ?? 0); $rawTotalCost += (float)($r->total_cost ?? 0); @endphp @empty @endforelse
# Category Sub Category Unit Qty Used CPI Total Cost
{{ $i+1 }} {{ $r->category->title_en ?? $r->cat_id }} {{ $r->sub_category->title_en ?? ($r->scat_id ?? '—') }} {{ $r->unit->title_en ?? $r->unit_id }} {{ number_format($r->qty_used ?? 0, 2) }} {{ number_format($r->cpi ?? 0, 4) }} {{ number_format($r->total_cost ?? 0, 2) }}
No raw items.
Total {{ number_format($rawTotalQty, 2) }} {{ number_format($rawTotalCost, 2) }}
{{-- OUTPUTS --}}
Outputs (Finished Goods)
@php $outTotalQty = 0; $outTotalCost = 0; @endphp @forelse($batch->outputs as $i => $o) @php $outTotalQty += (float)($o->qty_produced ?? 0); $outTotalCost += (float)($o->total_cost ?? 0); @endphp @empty @endforelse
# Category Sub Category Unit Weight Qty Produced CPI SPI Total Cost
{{ $i+1 }} {{ $o->category->title_en ?? $o->cat_id }} {{ $o->sub_category->title_en ?? ($o->sub_cat_id ?? '—') }} {{ $o->unit->title_en ?? $o->unit_id }} {{ $o->weight->title_en ?? ($o->weight_id ?? '—') }} {{ number_format($o->qty_produced ?? 0, 2) }} {{ number_format($o->cpi ?? 0, 4) }} {{ number_format($o->spi ?? 0, 2) }} {{ number_format($o->total_cost ?? 0, 2) }}
No outputs.
Total {{ number_format($outTotalQty, 2) }} {{ number_format($outTotalCost, 2) }}
Batch Produce Qty
{{ number_format($batch->produce_qty ?? 0, 2) }}
Batch Produce CPI
{{ number_format($batch->produce_cpi ?? 0, 4) }}
Batch Produce SPI
{{ number_format($batch->produce_spi ?? 0, 2) }}
@endsection