@push('header') @endpush
{{-- Summary Cards --}}
Total Vehicles with Stock
{{ $totals['total_vehicles'] }}
Total Quantity on Hand
{{ number_format($totals['total_quantity']) }}
Total Stock Value
PKR {{ number_format($totals['total_value'], 2) }}

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

@forelse($stocks as $vehicleId => $vehicleStocks) @php $vehicle = $vehicleStocks->first()->vehicle; $vehicleTotal = $vehicleStocks->sum(function($stock) { return $stock->quantity_on_hand * $stock->average_cost; }); @endphp
{{ $vehicle->vehicle_number }} {{ $vehicle->vehicle_number }} {{ $vehicle->model ?? '' }} {{ $vehicle->make ?? '' }} @if($vehicle->driver) | Driver: {{ $vehicle->driver->name ?? '-' }} @endif
PKR {{ number_format($vehicleTotal, 2) }}
@foreach($vehicleStocks as $index => $stock) @endforeach
Sr# Code Product Opening Bal Qty on Hand Avg Cost Total Value Last Updated
{{ $index + 1 }} {{ $stock->product->product_code ?? '-' }} {{ $stock->product->product_name }} {{ number_format($stock->opening_balance) }} {{ number_format($stock->quantity_on_hand) }} {{ number_format($stock->average_cost, 2) }} {{ number_format($stock->quantity_on_hand * $stock->average_cost, 2) }} {{ $stock->last_updated ? \Carbon\Carbon::parse($stock->last_updated)->format('d-m-Y') : '-' }}
Vehicle Total ({{ $vehicleStocks->count() }} products) {{ number_format($vehicleStocks->sum('opening_balance')) }} {{ number_format($vehicleStocks->sum('quantity_on_hand')) }} {{ number_format($vehicleTotal, 2) }}
@empty

No van stock balances found

Issue goods to vehicles to see stock here

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