@extends('layouts.admin') @section('title', 'Detail Produksi - Admin') @section('content') @php $orderQty = $production->quantity ?? $production->order->quantity ?? 1; $materialTotal = $production->total_material_cost ?? 0; $sparepartTotal = $production->total_sparepart_cost ?? 0; $directTotal = $materialTotal + $sparepartTotal; $laborTotal = $production->labor_cost ?? 0; $actualTotal = $directTotal + $laborTotal; $totalCost = $actualTotal; @endphp

Detail Produksi #{{ $production->id }}

Order #{{ $production->order->id ?? 'N/A' }} · {{ $production->order->customer_name ?? 'N/A' }}

@if(in_array($production->status, ['dalam_proses', 'selesai']))
@endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('info'))
{{ session('info') }}
@endif @if(session('fix_stock_results'))

Detail Perbaikan Stok

@foreach(session('fix_stock_results') as $result)
Produksi #{{ $result['production_id'] }}: @if($result['status'] === 'success') {{ $result['fixed'] }} item diperbaiki @elseif($result['status'] === 'error') Error: {{ $result['message'] }} @else {{ $result['message'] }} @endif
@if(isset($result['details']) && count($result['details']) > 0)
@foreach($result['details'] as $detail)
{!! $detail !!}
@endforeach
@endif
@endforeach
@endif @if($errors->any())
@endif {{-- ============================================== --}} {{-- ASSIGN TEKNISI SECTION (ADMIN ONLY) --}} {{-- ============================================== --}} @if(!$production->teknisi_id && !in_array($production->status, ['selesai', 'dibatalkan']))

Tugaskan ke Teknisi

Pilih teknisi yang akan mengerjakan produksi ini.

@csrf
@elseif($production->teknisi_id && !in_array($production->status, ['selesai', 'dibatalkan']))

Sudah Ditugaskan

Teknisi: {{ $production->teknisi->name ?? 'N/A' }} @if($production->assigned_at) ({{ $production->assigned_at->format('d M Y H:i') }}) @endif

@csrf
@endif

Info Produksi

Qty: {{ $orderQty }} unit
Teknisi: {{ $production->teknisi->name ?? 'Belum ditugaskan' }}
Status: @php $statusConfig = [ 'menunggu' => ['bg' => 'bg-gray-100 dark:bg-gray-700/50', 'text' => 'text-gray-700 dark:text-gray-300', 'label' => 'Menunggu'], 'dalam_proses' => ['bg' => 'bg-yellow-100 dark:bg-yellow-900/40', 'text' => 'text-yellow-700 dark:text-yellow-300', 'label' => 'Dalam Proses'], 'selesai' => ['bg' => 'bg-green-100 dark:bg-green-900/40', 'text' => 'text-green-700 dark:text-green-300', 'label' => 'Selesai'], 'dibatalkan' => ['bg' => 'bg-red-100 dark:bg-red-900/40', 'text' => 'text-red-700 dark:text-red-300', 'label' => 'Dibatalkan'], ]; $status = $statusConfig[$production->status] ?? $statusConfig['menunggu']; @endphp {{ $status['label'] }}

Info Pesanan

Order ID: #{{ $production->order->id ?? 'N/A' }}
Produk: {{ Str::limit($production->product->product_title ?? 'N/A', 15) }}
Harga: Rp {{ number_format($production->order->price ?? 0, 0, ',', '.') }}

Ringkasan

Bahan: {{ $production->productionMaterials->count() }} item
Sparepart: {{ $production->productionSpareparts->count() }} item
Total: Rp {{ number_format($totalCost, 0, ',', '.') }}

Pembayaran

Metode: {{ strtoupper($production->order->payment_method ?? 'N/A') }}
Status: @php $paymentStatus = $production->order->status ?? 'menunggu'; $paymentStatusConfig = [ 'selesai' => ['bg' => 'bg-green-100 dark:bg-green-900/40', 'text' => 'text-green-700 dark:text-green-300', 'label' => 'Lunas'], 'diproses' => ['bg' => 'bg-blue-100 dark:bg-blue-900/40', 'text' => 'text-blue-700 dark:text-blue-300', 'label' => 'Diproses'], 'menunggu_verifikasi' => ['bg' => 'bg-yellow-100 dark:bg-yellow-900/40', 'text' => 'text-yellow-700 dark:text-yellow-300', 'label' => 'Verifikasi'], ]; $paymentStatusStyle = $paymentStatusConfig[$paymentStatus] ?? ['bg' => 'bg-gray-100 dark:bg-gray-700/50', 'text' => 'text-gray-700 dark:text-gray-300', 'label' => ucfirst($paymentStatus)]; @endphp {{ $paymentStatusStyle['label'] }}
@if($production->submitted_at)
Diajukan: {{ $production->submitted_at->format('d/m/Y') }}
@endif
@include('admin.master.productions.partials.timeline', ['production' => $production]) {{-- ============================================== --}} {{-- REQUEST ITEM DARI TEKNISI - URGENT NOTIFICATION --}} {{-- ============================================== --}} @php $itemRequests = $production->itemRequests ?? collect(); $pendingRequests = $itemRequests->where('status', 'pending'); @endphp @if($pendingRequests->count() > 0)

Request Item Menunggu Persetujuan

{{ $pendingRequests->count() }} request baru dari teknisi perlu ditinjau

{{ $pendingRequests->count() }} Pending
@foreach($pendingRequests as $request) @php $quantity = (int)$request->quantity; // Ambil harga: prioritas dari relasi material/sparepart, jika tidak ada cari di master berdasarkan nama, terakhir pakai estimated_price $estimatedPrice = 0; if ($request->item_type === 'material' && $request->material) { $estimatedPrice = $request->material->price ?? $request->estimated_price ?? 0; } elseif ($request->item_type === 'sparepart' && $request->sparepart) { $estimatedPrice = $request->sparepart->price ?? $request->estimated_price ?? 0; } else { // Item baru: coba cari di master barang berdasarkan nama if ($request->item_name) { if ($request->item_type === 'material') { // Coba exact match dulu $foundMaterial = \App\Models\Material::where('name', $request->item_name)->first(); // Jika tidak ada, coba partial match if (!$foundMaterial) { $foundMaterial = \App\Models\Material::where('name', 'LIKE', '%' . trim($request->item_name) . '%')->first(); } if ($foundMaterial) { $estimatedPrice = $foundMaterial->price ?? $request->estimated_price ?? 0; } else { $estimatedPrice = $request->estimated_price ?? 0; } } else { // Coba exact match dulu $foundSparepart = \App\Models\Sparepart::where('name', $request->item_name)->first(); // Jika tidak ada, coba partial match if (!$foundSparepart) { $foundSparepart = \App\Models\Sparepart::where('name', 'LIKE', '%' . trim($request->item_name) . '%')->first(); } if ($foundSparepart) { $estimatedPrice = $foundSparepart->price ?? $request->estimated_price ?? 0; } else { $estimatedPrice = $request->estimated_price ?? 0; } } } else { $estimatedPrice = $request->estimated_price ?? 0; } } $totalPrice = $quantity * $estimatedPrice; // Ambil stok terbaru dari database (fresh) $currentStock = 0; if ($request->item_type === 'material' && $request->material_id) { $material = \App\Models\Material::find($request->material_id); $currentStock = $material ? $material->stock : 0; } elseif ($request->item_type === 'sparepart' && $request->sparepart_id) { $sparepart = \App\Models\Sparepart::find($request->sparepart_id); $currentStock = $sparepart ? $sparepart->stock : 0; } $totalNeeded = $quantity * $orderQty; $stockStatus = 'available'; $stockStatusLabel = 'Tersedia'; $stockStatusClass = 'bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300'; $stockStatusIcon = 'check-circle'; if ($currentStock < $totalNeeded) { if ($currentStock == 0) { $stockStatus = 'pending_purchase'; $stockStatusLabel = 'Perlu Pembelian'; $stockStatusClass = 'bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300'; $stockStatusIcon = 'times-circle'; } else { $stockStatus = 'insufficient'; $stockStatusLabel = 'Perlu Pembelian (Kurang)'; $stockStatusClass = 'bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300'; $stockStatusIcon = 'exclamation-triangle'; } } @endphp @endforeach
Item Tipe Jumlah Satuan Harga/Unit Total Stok Status Ketersediaan Alasan Diminta Oleh Aksi
{{ $request->item_name_display }}
@if($request->is_new_item) Item Baru @endif
@if($request->item_type === 'material') Bahan @else Sparepart @endif {{ $quantity }} {{ $request->unit }} @if($estimatedPrice > 0) Rp {{ number_format($estimatedPrice, 0, ',', '.') }} @else - @endif @if($totalPrice > 0) Rp {{ number_format($totalPrice, 0, ',', '.') }} @else - @endif
{{ $currentStock }} Butuh: {{ $totalNeeded }}
{{ $stockStatusLabel }} @if($stockStatus !== 'available')
@if($stockStatus === 'insufficient') Kurang: {{ $totalNeeded - $currentStock }} {{ $request->unit }} @else Stok: 0 @endif
@endif
{{ Str::limit($request->reason, 50) }}
{{ $request->requester->name ?? 'N/A' }}
{{ $request->created_at->format('d/m/Y H:i') }}
@csrf
@endif {{-- ============================================== --}} {{-- TABEL USULAN PERTAMA, KEDUA, KETIGA (ADMIN) --}} {{-- ============================================== --}} @php $itemRequests = $production->itemRequests ?? collect(); $proposalGroups = $itemRequests->groupBy('proposal_number')->sortKeys(); $nonPendingRequests = $itemRequests->where('status', '!=', 'pending'); @endphp @if($proposalGroups->count() > 0)

Usulan Bahan & Sparepart

Dikelompokkan berdasarkan usulan pertama, kedua, ketiga @if($pendingRequests->count() > 0) · Item pending juga ada di notifikasi di atas @endif

@if($itemRequests->count() > 0)
@php $statusCounts = [ 'pending' => $itemRequests->where('status', 'pending')->count(), 'approved' => $itemRequests->where('status', 'approved')->count(), 'purchased' => $itemRequests->where('status', 'purchased')->count(), 'received' => $itemRequests->where('status', 'received')->count(), ]; @endphp
Total: {{ $itemRequests->count() }} item
@endif
@foreach($proposalGroups as $proposalNumber => $requests)

{{ $proposalNumber ?? '1' }} Usulan {{ $proposalNumber == 1 ? 'Pertama' : ($proposalNumber == 2 ? 'Kedua' : ($proposalNumber == 3 ? 'Ketiga' : 'Ke-' . $proposalNumber)) }} {{ $requests->count() }} item

@foreach($requests as $request) @php $quantity = (int)$request->quantity; // Ambil harga: prioritas dari relasi material/sparepart, jika tidak ada cari di master berdasarkan nama, terakhir pakai estimated_price $estimatedPrice = 0; if ($request->item_type === 'material' && $request->material) { $estimatedPrice = $request->material->price ?? $request->estimated_price ?? 0; } elseif ($request->item_type === 'sparepart' && $request->sparepart) { $estimatedPrice = $request->sparepart->price ?? $request->estimated_price ?? 0; } else { // Item baru: coba cari di master barang berdasarkan nama if ($request->item_name) { if ($request->item_type === 'material') { // Coba exact match dulu $foundMaterial = \App\Models\Material::where('name', $request->item_name)->first(); // Jika tidak ada, coba partial match if (!$foundMaterial) { $foundMaterial = \App\Models\Material::where('name', 'LIKE', '%' . trim($request->item_name) . '%')->first(); } if ($foundMaterial) { $estimatedPrice = $foundMaterial->price ?? $request->estimated_price ?? 0; } else { $estimatedPrice = $request->estimated_price ?? 0; } } else { // Coba exact match dulu $foundSparepart = \App\Models\Sparepart::where('name', $request->item_name)->first(); // Jika tidak ada, coba partial match if (!$foundSparepart) { $foundSparepart = \App\Models\Sparepart::where('name', 'LIKE', '%' . trim($request->item_name) . '%')->first(); } if ($foundSparepart) { $estimatedPrice = $foundSparepart->price ?? $request->estimated_price ?? 0; } else { $estimatedPrice = $request->estimated_price ?? 0; } } } else { $estimatedPrice = $request->estimated_price ?? 0; } } $totalPrice = $quantity * $estimatedPrice; // Ambil stok terbaru dari database (fresh) $currentStock = 0; if ($request->item_type === 'material' && $request->material_id) { $material = \App\Models\Material::find($request->material_id); $currentStock = $material ? $material->stock : 0; } elseif ($request->item_type === 'sparepart' && $request->sparepart_id) { $sparepart = \App\Models\Sparepart::find($request->sparepart_id); $currentStock = $sparepart ? $sparepart->stock : 0; } $totalNeeded = $quantity * $orderQty; $stockStatus = 'available'; $stockStatusLabel = 'Tersedia'; $stockStatusClass = 'bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300'; $stockStatusIcon = 'check-circle'; if ($currentStock < $totalNeeded) { if ($currentStock == 0) { $stockStatus = 'pending_purchase'; $stockStatusLabel = 'Perlu Pembelian'; $stockStatusClass = 'bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300'; $stockStatusIcon = 'times-circle'; } else { $stockStatus = 'insufficient'; $stockStatusLabel = 'Perlu Pembelian (Kurang)'; $stockStatusClass = 'bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300'; $stockStatusIcon = 'exclamation-triangle'; } } @endphp @endforeach
Item Tipe Jumlah Satuan Harga/Unit Total Stok Status Ketersediaan Alasan Status Aksi
{{ $request->item_name_display }} @if($request->status === 'pending') Pending @endif
@if($request->is_new_item) Item Baru @endif
@if($request->item_type === 'material') Bahan @else Sparepart @endif {{ $quantity }} {{ $request->unit }} @if($estimatedPrice > 0) Rp {{ number_format($estimatedPrice, 0, ',', '.') }} @else - @endif @if($totalPrice > 0) Rp {{ number_format($totalPrice, 0, ',', '.') }} @else - @endif
{{ $currentStock }} Butuh: {{ $totalNeeded }}
{{ $stockStatusLabel }} @if($stockStatus !== 'available')
@if($stockStatus === 'insufficient') Kurang: {{ $totalNeeded - $currentStock }} {{ $request->unit }} @else Stok: 0 @endif
@endif
{{ Str::limit($request->reason, 50) }} @if($request->status === 'pending') @elseif($request->status === 'approved') @elseif($request->status === 'rejected') @elseif($request->status === 'purchased') @elseif($request->status === 'sent') @elseif($request->status === 'received') @endif {{ $request->status_label }}
@if($request->status === 'pending')
@csrf
@elseif($request->status === 'approved' && !$request->purchase_id) @elseif($request->status === 'purchased' && $request->purchase_id)
@csrf
@elseif($request->status === 'sent') Menunggu Konfirmasi @endif
@endforeach
@endif {{-- ============================================== --}} {{-- ADMIN INPUT SUGGESTED BAHAN/SPAREPART --}} {{-- ============================================== --}} @php $hasUnsentMaterials = $production->productionMaterials->where('is_admin_suggested', true)->whereNull('sent_to_teknisi_at')->count() > 0; $hasUnsentSpareparts = $production->productionSpareparts->where('is_admin_suggested', true)->whereNull('sent_to_teknisi_at')->count() > 0; $hasUnsentItems = $hasUnsentMaterials || $hasUnsentSpareparts; @endphp @if(!in_array($production->status, ['selesai', 'dibatalkan']) && (!$production->teknisi_id || $production->planning_status === 'planning'))

Input Bahan & Sparepart Suggested

Admin bisa input bahan dan sparepart sebagai "suggested" untuk teknisi.

@csrf

Bahan Suggested

Sparepart Suggested

@if($production->teknisi_id && $hasUnsentItems)

Ada item yang belum dikirim ke teknisi

@csrf
@endif
@endif

Daftar Bahan & Sparepart

{{ $production->productionMaterials->count() + $production->productionSpareparts->count() }} item · {{ $orderQty }} unit produk

@php $allItems = collect(); $orderQty = $production->quantity ?? $production->order->quantity ?? 1; $isProductionCompleted = in_array($production->status, ['selesai', 'dibatalkan']); foreach($production->productionMaterials as $pm) { $totalNeeded = $pm->quantity * $orderQty; $currentStock = $pm->material->stock ?? 0; // Jika produksi sudah selesai, tampilkan status yang sesuai if ($isProductionCompleted) { $stockStatus = 'completed'; $stockStatusLabel = 'Sudah Digunakan'; $stockStatusClass = 'bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300'; $stockStatusIcon = 'check-double'; // Untuk produksi selesai, tampilkan jumlah yang digunakan, bukan stok saat ini $currentStock = $totalNeeded; } else { // Logika untuk produksi yang belum selesai $stockStatus = 'available'; $stockStatusLabel = 'Tersedia/Jumlah Mencukupi'; $stockStatusClass = 'bg-green-100 text-green-700'; $stockStatusIcon = 'check-circle'; // Untuk item request yang sudah diterima (is_additional = true dan is_received = true) // Stok di master barang sudah dikurangi saat admin kirim, jadi stok yang ditampilkan // adalah stok yang "tersedia untuk produksi" (quantity yang sudah diterima) if ($pm->is_additional && $pm->is_received) { // Item request yang sudah diterima: stok yang tersedia = quantity yang sudah diterima $currentStock = $pm->quantity * $orderQty; $stockStatus = 'available'; $stockStatusLabel = 'Tersedia (Diterima)'; $stockStatusClass = 'bg-green-100 text-green-700'; $stockStatusIcon = 'check-circle'; } elseif ($currentStock < $totalNeeded) { if ($currentStock == 0) { $stockStatus = 'pending_purchase'; $stockStatusLabel = 'Perlu Pembelian'; $stockStatusClass = 'bg-red-100 text-red-700'; $stockStatusIcon = 'times-circle'; } else { $stockStatus = 'insufficient'; $stockStatusLabel = 'Perlu Pembelian (Kurang)'; $stockStatusClass = 'bg-amber-100 text-amber-700'; $stockStatusIcon = 'exclamation-triangle'; } } } $allItems->push([ 'id' => $pm->id, 'item_id' => $pm->material_id, 'type' => 'material', 'name' => $pm->material->name ?? 'N/A', 'quantity' => $pm->quantity, 'unit' => $pm->unit, 'unit_cost' => $pm->unit_cost, 'total_cost' => $pm->total_cost, 'stock' => $currentStock, 'total_needed' => $totalNeeded, 'stock_ok' => $currentStock >= $totalNeeded, 'stock_status' => $stockStatus, 'stock_status_label' => $stockStatusLabel, 'stock_status_class' => $stockStatusClass, 'stock_status_icon' => $stockStatusIcon, 'is_received' => $pm->is_received ?? false, 'material_id' => $pm->material_id, 'sparepart_id' => null, ]); } foreach($production->productionSpareparts as $ps) { $totalNeeded = $ps->quantity * $orderQty; $currentStock = $ps->sparepart->stock ?? 0; // Jika produksi sudah selesai, tampilkan status yang sesuai if ($isProductionCompleted) { $stockStatus = 'completed'; $stockStatusLabel = 'Sudah Digunakan'; $stockStatusClass = 'bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300'; $stockStatusIcon = 'check-double'; // Untuk produksi selesai, tampilkan jumlah yang digunakan, bukan stok saat ini $currentStock = $totalNeeded; } else { // Logika untuk produksi yang belum selesai $stockStatus = 'available'; $stockStatusLabel = 'Tersedia/Jumlah Mencukupi'; $stockStatusClass = 'bg-green-100 text-green-700'; $stockStatusIcon = 'check-circle'; // Untuk item request yang sudah diterima (is_additional = true dan is_received = true) // Stok di master barang sudah dikurangi saat admin kirim, jadi stok yang ditampilkan // adalah stok yang "tersedia untuk produksi" (quantity yang sudah diterima) if ($ps->is_additional && $ps->is_received) { // Item request yang sudah diterima: stok yang tersedia = quantity yang sudah diterima $currentStock = $ps->quantity * $orderQty; $stockStatus = 'available'; $stockStatusLabel = 'Tersedia (Diterima)'; $stockStatusClass = 'bg-green-100 text-green-700'; $stockStatusIcon = 'check-circle'; } elseif ($currentStock < $totalNeeded) { if ($currentStock == 0) { $stockStatus = 'pending_purchase'; $stockStatusLabel = 'Perlu Pembelian'; $stockStatusClass = 'bg-red-100 text-red-700'; $stockStatusIcon = 'times-circle'; } else { $stockStatus = 'insufficient'; $stockStatusLabel = 'Perlu Pembelian (Kurang)'; $stockStatusClass = 'bg-amber-100 text-amber-700'; $stockStatusIcon = 'exclamation-triangle'; } } } $allItems->push([ 'id' => $ps->id, 'item_id' => $ps->sparepart_id, 'type' => 'sparepart', 'name' => $ps->sparepart->name ?? 'N/A', 'quantity' => $ps->quantity, 'unit' => $ps->unit, 'unit_cost' => $ps->unit_cost, 'total_cost' => $ps->total_cost, 'stock' => $currentStock, 'total_needed' => $totalNeeded, 'stock_ok' => $currentStock >= $totalNeeded, 'stock_status' => $stockStatus, 'stock_status_label' => $stockStatusLabel, 'stock_status_class' => $stockStatusClass, 'stock_status_icon' => $stockStatusIcon, 'is_received' => $ps->is_received ?? false, 'material_id' => null, 'sparepart_id' => $ps->sparepart_id, ]); } $receivedCount = $allItems->where('is_received', true)->count(); $totalItems = $allItems->count(); @endphp @if($allItems->count() > 0)
@if(!$isProductionCompleted) @else @endif @if($production->planning_status === 'approved') @endif @if(!$isProductionCompleted) @endif @foreach($allItems as $item) @if(!$isProductionCompleted) @else @endif @if($production->planning_status === 'approved') @endif @if(!$isProductionCompleted) @endif @endforeach @if(!$isProductionCompleted) @else @endif @if($production->planning_status === 'approved') @endif
Nama Item Tipe Jumlah Satuan Harga/Unit TotalStok Status KetersediaanJumlah Digunakan StatusDiterimaAksi
{{ $item['name'] }} @if($item['type'] === 'material') Bahan @else Sparepart @endif {{ $item['quantity'] }} {{ $item['unit'] }} Rp {{ number_format($item['unit_cost'], 0, ',', '.') }} Rp {{ number_format($item['total_cost'], 0, ',', '.') }}
{{ $item['stock'] }} Butuh: {{ $item['total_needed'] }}
{{ $item['stock_status_label'] }} @if($item['stock_status'] !== 'available' && $item['stock_status'] !== 'completed')
@if($item['stock_status'] === 'insufficient') Kurang: {{ $item['total_needed'] - $item['stock'] }} {{ $item['unit'] }} @else Stok: 0 @endif
@endif
{{ $item['total_needed'] }} {{ $item['unit'] }}
{{ $item['stock_status_label'] }} @if($item['is_received']) Ya @else Belum @endif @if(in_array($item['stock_status'], ['pending_purchase', 'insufficient'])) @else - @endif
Bahan: Rp {{ number_format($materialTotal, 0, ',', '.') }} Sparepart: Rp {{ number_format($sparepartTotal, 0, ',', '.') }} @if(!$isProductionCompleted) @php $insufficientStock = $allItems->filter(fn($i) => !$i['stock_ok'])->count(); @endphp @if($insufficientStock > 0) {{ $insufficientStock }} item perlu pembelian @endif @endif
Total: Rp {{ number_format($directTotal, 0, ',', '.') }} {{ $receivedCount }}/{{ $totalItems }}
@else

Belum ada bahan atau sparepart ditambahkan

Teknisi akan menginput bahan dan sparepart setelah ditugaskan

@endif
@if($laborTotal > 0)

Biaya Tenaga Kerja

Upah untuk {{ $orderQty }} unit @if($production->servicePackage)
{{ $production->servicePackage->name }} @endif

Rp {{ number_format($laborTotal, 0, ',', '.') }}

Per unit: Rp {{ number_format($laborTotal / max($orderQty, 1), 0, ',', '.') }}

@if($production->labor_package_count && $production->labor_package_count != $orderQty)

Jumlah paket: {{ $production->labor_package_count }}

@endif
@endif

Total Biaya Produksi

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, ',', '.') }}

@if(!in_array($production->status, ['selesai', 'dibatalkan']))

Catatan Produksi

@if($production->notes)

{{ $production->notes }}

@else

Belum ada catatan

@endif
@else @if($production->notes)

Catatan Produksi

{{ $production->notes }}

@endif @endif @endsection