@push('header') @endpush
{{-- Summary Cards --}}
Vehicles with Stock
{{ $stocks->count() }}
Total Qty on Hand
{{ number_format($totals['total_quantity'], 2) }}
Total Value (Cost)
PKR {{ number_format($totals['total_value_cost'], 2) }}
Total Value (Selling)
PKR {{ number_format($totals['total_value_selling'], 2) }}

Moon Traders
Van Stock by Batch
Total Vehicles: {{ $stocks->count() }} | Total Qty: {{ number_format($totals['total_quantity'], 2) }} | Total Value: PKR {{ number_format($totals['total_value_selling'], 2) }}
Printed by: {{ auth()->user()->name }} | {{ now()->format('d-M-Y h:i A') }}

@forelse($stocks as $vehicleId => $vehicleStocks) @php $vehicle = $vehicleStocks->first()->vehicle; $vehicleSellingValue = $vehicleStocks->sum(function($stock) { return $stock->quantity_on_hand * $stock->calculated_selling_price; }); @endphp
{{ $vehicle->vehicle_number }} {{ $vehicle->make_model ?? '' }} | Driver: {{ $vehicle->driver_name ?? 'N/A' }}
Stock Value (Selling)
PKR {{ number_format($vehicleSellingValue, 2) }}
@foreach($vehicleStocks as $index => $stock) @endforeach
Sr# Code Product Batch Qty Unit Cost Selling Price Total (Selling) Expiry
{{ $index + 1 }} {{ $stock->product->product_code ?? '-' }} {{ $stock->product->product_name }} {{ $stock->stockBatch->batch_code ?? 'N/A' }} {{ number_format($stock->quantity_on_hand, 2) }} {{ number_format($stock->calculated_unit_cost, 2) }} {{ number_format($stock->calculated_selling_price, 2) }} {{ number_format($stock->quantity_on_hand * $stock->calculated_selling_price, 2) }} @if($stock->stockBatch->expiry_date) $stock->stockBatch->expiry_date->isPast(), 'bg-orange-100 text-orange-700' => !$stock->stockBatch->expiry_date->isPast() && $stock->stockBatch->expiry_date->diffInDays(now()) < 30, 'bg-gray-100 text-gray-600' => $stock->stockBatch->expiry_date->isFuture() && $stock->stockBatch->expiry_date->diffInDays(now()) >= 30, ])> {{ $stock->stockBatch->expiry_date->format('d-m-Y') }} @else - @endif
Vehicle Total ({{ $vehicleStocks->count() }} items) {{ number_format($vehicleStocks->sum('quantity_on_hand'), 2) }} {{ number_format($vehicleSellingValue, 2) }}
@empty
No Van Stock Found

There is currently no batch-level stock recorded in any vans matching your filters.

@endforelse @if($stocks->count() > 0)
Grand Total ({{ $stocks->count() }} vehicles) {{ number_format($totals['total_quantity'], 2) }} {{ number_format($totals['total_value_cost'], 2) }} {{ number_format($totals['total_value_selling'], 2) }}
@endif