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)
| No |
Material Code |
Material Description |
Qty |
Price/Unit |
Total |
@foreach($group['materials'] as $matIndex => $material)
| {{ $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']) }} |
@endforeach
|
Subtotal Group #{{ $groupIndex + 1 }}:
|
{{ \App\Helpers\CasegoodHelper::formatRupiah($group['subtotal']) }}
|
@endforeach
{{-- ✅ NEW: TAMBAHAN MANUAL (Standalone - Tanpa Group) --}}
@if(!empty($manualItems))
| No |
Material Code |
Material Description |
Qty |
Price/Unit |
Total |
@foreach($manualItems as $itemIndex => $item)
| {{ $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']) }} |
@endforeach
|
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) }}