@extends('layouts.teknisi') @section('title', 'Detail History Produksi - Teknisi') @section('content') @php $orderQty = $production->quantity ?? $production->order->quantity ?? 1; $materialTotal = $production->total_material_cost ?? 0; $sparepartTotal = $production->total_sparepart_cost ?? 0; $directTotal = ($production->total_direct_cost ?? ($materialTotal + $sparepartTotal)); $laborTotal = $production->labor_cost ?? 0; $actualTotal = $directTotal + $laborTotal; @endphp
{{ $production->product->product_title ?? 'N/A' }} · Order #{{ $production->order->id ?? 'N/A' }}
{{ $production->notes }}
{{ $production->productionMaterials->count() + $production->productionSpareparts->count() }} item · {{ $orderQty }} unit produk
| Nama Item | Tipe | Jumlah | Satuan | Harga/Unit | Total |
|---|---|---|---|---|---|
| {{ $pm->material->name ?? 'N/A' }} | Bahan | {{ $pm->quantity }} | {{ $pm->unit }} | Rp {{ number_format($pm->unit_cost, 0, ',', '.') }} | Rp {{ number_format($pm->total_cost, 0, ',', '.') }} |
| {{ $ps->sparepart->name ?? 'N/A' }} | Sparepart | {{ $ps->quantity }} | {{ $ps->unit }} | Rp {{ number_format($ps->unit_cost, 0, ',', '.') }} | Rp {{ number_format($ps->total_cost, 0, ',', '.') }} |
|
Bahan: Rp {{ number_format($materialTotal, 0, ',', '.') }}
Sparepart: Rp {{ number_format($sparepartTotal, 0, ',', '.') }}
|
Total: Rp {{ number_format($directTotal, 0, ',', '.') }} | ||||
Belum ada bahan atau sparepart ditambahkan
Upah untuk {{ $orderQty }} unit
Rp {{ number_format($laborTotal, 0, ',', '.') }}
Per unit: Rp {{ number_format($laborTotal / max($orderQty, 1), 0, ',', '.') }}
Langsung: Rp {{ number_format($directTotal, 0, ',', '.') }} @if($laborTotal > 0) · Labor: Rp {{ number_format($laborTotal, 0, ',', '.') }} @endif
Rp {{ number_format($actualTotal, 0, ',', '.') }}
Per unit: Rp {{ number_format($actualTotal / max($orderQty, 1), 0, ',', '.') }}