@push('header') @endpush
{{-- Summary Cards --}}
Total Movements
{{ number_format($movements->total()) }}
Total Inward
{{ number_format($totals['total_inward'] ?? 0) }}
Total Outward
{{ number_format($totals['total_outward'] ?? 0) }}
Total Value
{{ number_format($totals['total_value'] ?? 0, 2) }}
{{-- Current Stock Summary --}} @if($currentStock->count() > 0)

Current Stock Balance

@foreach($currentStock as $stock)
{{ $stock->product->product_name }}
{{ number_format($stock->quantity_on_hand) }} @ {{ number_format($stock->average_cost, 2) }}
@endforeach
@endif

Moon Traders
Vehicle Stock Ledger - {{ $vehicle->vehicle_number }}
{{ $vehicle->make ?? '' }} {{ $vehicle->model ?? '' }} @if($vehicle->driver) | Driver: {{ $vehicle->driver->name ?? '-' }} @endif
@if($dateFrom && $dateTo) For the period {{ \Carbon\Carbon::parse($dateFrom)->format('d-M-Y') }} to {{ \Carbon\Carbon::parse($dateTo)->format('d-M-Y') }} @else All Movements @endif
Printed by: {{ auth()->user()->name }} | {{ now()->format('d-M-Y h:i A') }}

@forelse ($movements as $index => $movement) @empty @endforelse
Sr# Date Product Type Reference In (+) Out (-) Balance Unit Cost
{{ $movements->firstItem() + $index }} {{ \Carbon\Carbon::parse($movement->movement_date)->format('d-m-Y') }} {{ $movement->product?->product_name ?? '-' }} @if($movement->product?->product_code)
{{ $movement->product->product_code }}
@endif
{{ ucwords(str_replace('_', ' ', $movement->movement_type)) }} @if($movement->reference) @php $refClass = class_basename($movement->reference_type); @endphp {{ $refClass }}: {{ $movement->reference->reference_number ?? $movement->reference->id ?? '-' }} @else - @endif {{ $movement->quantity > 0 ? number_format($movement->quantity) : '-' }} {{ $movement->quantity < 0 ? number_format(abs($movement->quantity)) : '-' }} {{ number_format($movement->running_balance ?? 0) }} {{ number_format($movement->unit_cost, 2) }}
No stock movements found for this vehicle. Try adjusting your filters.
Page Total ({{ $movements->count() }} movements) {{ number_format($movements->where('quantity', '>', 0)->sum('quantity')) }} {{ number_format(abs($movements->where('quantity', '<', 0)->sum('quantity'))) }}
@if ($movements->hasPages())
{{ $movements->links() }}
@endif