@extends('layouts.app') @section('title', 'Detail Invoice Hardware - Cost Furniture') @section('page-title', 'Detail Invoice Hardware') @section('content')
Invoice Hardware #{{ $invoiceHardware->id }}
Lihat BOM Edit Kembali
INVOICE BOM INFO
Product Name:
{{ $invoiceHardware->invoiceBom->product_name }}
Product Code:
{{ $invoiceHardware->invoiceBom->product_code }}
Product Type:
{{ $invoiceHardware->invoiceBom->product_type }}
Category:
{{ $invoiceHardware->invoiceBom->product_category }}
Tanggal Dibuat:
{{ $invoiceHardware->created_at->format('d M Y') }}
@php $hardwareData = json_decode($invoiceHardware->hardware_data, true); $groups = $hardwareData['groups'] ?? []; $manualItems = $hardwareData['manual_items'] ?? []; @endphp @foreach($groups as $groupIndex => $group)
Hardware Group #{{ $groupIndex + 1 }} - {{ $group['hardware_type'] }}
@foreach($group['materials'] as $matIndex => $material) @endforeach
No Material Code Material Description Qty Price/Unit Total
{{ $matIndex + 1 }} {{ $material['material_code'] ?? 'N/A' }} {{-- ✅ Badge MANUAL --}} @if(isset($material['is_manual']) && $material['is_manual']) MANUAL @endif {{ $material['material_description'] }} {{ $material['qty'] }} {{ \App\Helpers\CasegoodHelper::formatRupiah($material['price']) }} {{ \App\Helpers\CasegoodHelper::formatRupiah($material['total']) }}
Subtotal Group #{{ $groupIndex + 1 }}: {{ \App\Helpers\CasegoodHelper::formatRupiah($group['subtotal']) }}
@endforeach {{-- ✅ NEW: TAMBAHAN MANUAL (Standalone - Tanpa Group) --}} @if(!empty($manualItems))
TAMBAHAN MANUAL (Tanpa Group) - {{ count($manualItems) }} Item(s)
@foreach($manualItems as $itemIndex => $item) @endforeach
No Material Code Material Description Qty Price/Unit Total
{{ $itemIndex + 1 }} {{ $item['material_code'] ?? 'N/A' }} MANUAL {{ $item['material_description'] }} {{ $item['qty'] }} {{ \App\Helpers\CasegoodHelper::formatRupiah($item['price']) }} {{ \App\Helpers\CasegoodHelper::formatRupiah($item['total']) }}
Subtotal Tambahan Manual: @php $manualSubtotal = collect($manualItems)->sum('total'); @endphp {{ \App\Helpers\CasegoodHelper::formatRupiah($manualSubtotal) }}
@endif
GRAND TOTAL HARDWARE
Total dari {{ count($groups) }} Group(s) @if(!empty($manualItems)) + {{ count($manualItems) }} Manual Item(s) @endif

{{ \App\Helpers\CasegoodHelper::formatRupiah($invoiceHardware->grand_total) }}

Total Groups
{{ count($groups) }}
Total Materials
@php $totalMaterials = collect($groups)->sum(function($group) { return count($group['materials']); }); @endphp {{ $totalMaterials }}
Manual Items
{{ count($manualItems) }}
Grand Total
{{ \App\Helpers\CasegoodHelper::formatRupiah($invoiceHardware->grand_total) }}
@endsection