@section('page-title', 'Product Details')

Product Information

Product Name
{{ $product->name }}
Product Code
{{ $product->code }}
SKU
{{ $product->sku }}
KKM Registration
{{ $product->kkm }}
Halal Certification Date
{{ $product->halal_status ? $product->halal_status->format('M d, Y') : 'N/A' }}
Manufacture Date
{{ $product->manufacture_dt ? $product->manufacture_dt->format('M d, Y') : 'N/A' }}
Expiry Date
{{ $product->expiry_dt ? $product->expiry_dt->format('M d, Y') : 'N/A' }}

Tagged Customers ({{ $product->customers->count() }})

@if($product->customers->count() > 0)
@foreach($product->customers as $customer)

{{ $customer->name }}

{{ $customer->email }}

{{ $customer->contact }}

@if($customer->pivot->notes)

Note: {{ $customer->pivot->notes }}

@endif

Tagged: {{ $customer->pivot->created_at->diffForHumans() }}

@endforeach
@else

No customers tagged yet. Tag customers now

@endif

Assigned QR Codes

Manage QR Codes
@if($product->qr_codes_count > 0)

Total Assigned

{{ number_format($product->qr_codes_count) }}

@php $usedCount = \App\Models\QrCode::where('product_id', $product->id)->where('status', 'used')->count(); $unusedCount = \App\Models\QrCode::where('product_id', $product->id)->where('status', 'unused')->count(); @endphp

Unused Codes

{{ number_format($unusedCount) }}

Used Codes

{{ number_format($usedCount) }}

Performance Optimized: For large datasets (50k+ codes), use the "Manage QR Codes" button above to view, search, and manage all assigned codes.

@else

No QR codes assigned to this product yet. Tag QR codes now

@endif