@vite(['resources/css/app.css', 'resources/js/app.js']) @php $categories = $items->pluck('category')->filter()->unique()->sort()->values(); $salesmanName = $salesman->name ?? 'Salesman'; $salesmanEmail = $salesman->email ?? ''; $salesmanPhone = $salesman->phone ?? $salesman->mobile ?? $salesman->whatsapp ?? ''; $whatsappNumber = preg_replace('/[^0-9]/', '', $salesmanPhone); @endphp

{{ $catalog->title }}

{{ $items->where('qty', '>', 0)->count() }} products @if(!empty($latestImport?->updated_at)) • Updated {{ \Carbon\Carbon::parse($latestImport->updated_at)->format('Y-m-d H:i') }} @endif

@foreach($categories as $category) @endforeach
@if($items->where('qty', '>', 0)->count() == 0)
S

No Stock Available Yet

This salesman catalog is ready, but no inventory has been uploaded yet.

@if($whatsappNumber) Contact Salesman @endif
@else
@foreach($items as $item) @php $name = data_get($item, 'name', ''); $sku = data_get($item, 'sku', ''); $barcode = data_get($item, 'barcode', ''); $category = data_get($item, 'category', ''); $image = data_get($item, 'image', ''); $price = (float) data_get($item, 'price', 0); $priceUpdatedAt = data_get($item, 'price_updated_at'); $oldPrice = data_get($item, 'old_price'); $productId = data_get($item, 'product_id'); $salesmanVanQty = $productId ? (float) ($salesmanVanQtyMap[$productId] ?? 0) : 0; $qty = (float) data_get($item, 'qty', data_get($item, 'quantity', 0)); $specification = data_get($item, 'specification', ''); $isClearance = (bool) data_get($item, 'is_clearance', false); @endphp @if($qty > 0)
@if($image) @else
P
No Image
@endif
{{ $price > 0 ? 'AED ' . number_format($price, 2) : 'Ask Price' }}
@if($priceUpdatedAt)
UPDATED
@endif @if($isClearance)
CLEARANCE · IN VAN
@endif @if(auth()->check() && auth()->user()->role === 'salesman' && $salesmanVanQty > 0)
VAN: {{ number_format($salesmanVanQty) }}
@endif
Qty: {{ number_format($qty) }}

{{ $name ?: '-' }}

SKU: {{ $sku ?: '-' }}
Barcode: {{ $barcode ?: '-' }}
Category: {{ $category ?: '-' }}
@if(auth()->check() && auth()->user()->role === 'salesman' && $salesmanVanQty > 0)
Van: {{ number_format($salesmanVanQty) }}
@endif @if($priceUpdatedAt)
Price updated @if($oldPrice && (float)$oldPrice != $price) • Old: AED {{ number_format((float)$oldPrice, 2) }} @endif
@endif
@if($specification)
Specifications
{!! nl2br(e($specification)) !!}
@endif
@endif @endforeach
@endif