@extends('layouts.app') @section('title', $vehicle->stock_id) @section('heading', $vehicle->stock_id) @section('content') @php $v = $vehicle; @endphp

{{ $v->display_name }}

{{ $v->branch->name }} In inventory:

@if ($v->status === \App\Enums\VehicleStatus::Reserved)

Reserved for {{ $v->reserved_for }} until {{ $v->reserved_until?->format('d M Y, H:i') }} @if ($v->reservation_expired)(hold has expired)@endif

@endif
Print label @can('listing.manage')Website listing@endcan @can('vehicles.edit')Edit@endcan @can('vehicles.delete') @if (in_array($v->status, [\App\Enums\VehicleStatus::InTransit, \App\Enums\VehicleStatus::InStock]))
@csrf @method('DELETE')
@endif @endcan
{{-- Status actions: one disclosure per allowed move --}} @can('vehicles.edit') @if (count($v->status->allowedNext()))

Move this vehicle

@foreach ($v->status->allowedNext() as $next) @continue($v->status === \App\Enums\VehicleStatus::Sold && ! auth()->user()->can('vehicles.reverse_sale'))
{{ $next->actionLabel() }}
@csrf @if ($next === \App\Enums\VehicleStatus::Reserved)
@elseif ($next === \App\Enums\VehicleStatus::Sold)
@endif
@endforeach
@endif @endcan

Profile

@foreach ([ 'VIN / chassis' => $v->vin, 'Registration' => $v->registration_no ?: 'Not registered', 'Color' => $v->color, 'Transmission' => config('inventory.transmissions')[$v->transmission] ?? $v->transmission, 'Fuel' => config('inventory.fuel_types')[$v->fuel_type] ?? $v->fuel_type, 'Engine' => $v->engine_cc ? number_format($v->engine_cc).' cc' : 'Not set', 'Mileage' => number_format($v->mileage).' '.$v->mileage_unit, 'Body' => config('inventory.body_types')[$v->body_type] ?? 'Not set', 'Drive' => config('inventory.drive_types')[$v->drive_type] ?? 'Not set', 'Condition' => config('inventory.conditions')[$v->condition] ?? $v->condition, 'Duty status' => config('inventory.duty_statuses')[$v->duty_status] ?? $v->duty_status, 'Supplier' => $v->supplier?->name ?? 'None', 'Auction lot / grade' => trim(($v->auction_lot_no ?: '').' '.($v->auction_grade ? '· grade '.$v->auction_grade : '')) ?: 'Not set', ] as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
Shipment
@if ($v->shipment)@can('shipments.view'){{ $v->shipment->reference }}@else{{ $v->shipment->reference }}@endcan @else None @endif
@if ($v->notes)

{{ $v->notes }}

@endif

Pricing

Selling price
@include('partials.kes', ['amount' => $v->selling_price])
Minimum price
@include('partials.kes', ['amount' => $v->minimum_price])
@if ($v->status === \App\Enums\VehicleStatus::Sold)
Sold for
@include('partials.kes', ['amount' => $v->sold_price]) on {{ $v->sold_at?->format('d M Y') }}
@endif @can('vehicles.view_cost')
Landed cost
@include('partials.kes', ['amount' => $v->landed_cost])
@if ($v->expected_margin !== null)
Margin at asking price
@include('partials.kes', ['amount' => $v->expected_margin])
@endif @endcan
@can('vehicles.view_cost')

Landed cost breakdown

@foreach ($breakdown as $label => $amount)
{{ $label }}
@include('partials.kes', ['amount' => $amount])
@endforeach
@forelse ($v->costs as $c) @empty @endforelse
Cost lines
DateTypeDescription OriginalKESActions
{{ $c->incurred_on->format('d M Y') }} {{ $c->cost_type->label() }} {{ $c->description }} {{ $c->currency_code }} {{ number_format($c->amount, 2) }}@if ($c->currency_code !== 'KES')@ {{ rtrim(rtrim($c->exchange_rate, '0'), '.') }}@endif {{ number_format($c->amount_kes, 2) }} @can('vehicles.manage_costs') @if ($c->is_allocated)From shipment @else
@csrf @method('DELETE')
@endif @endcan
No costs recorded yet.
@can('vehicles.manage_costs')
@csrf
@endcan
@endcan

Status history

    @foreach ($v->statusHistories as $h)
  1. {{ $h->from_status ? $h->from_status->label().' → ' : '' }}{{ $h->to_status->label() }} {{ $h->user?->name ?? 'System' }}{{ $h->note ? ' · '.$h->note : '' }}
  2. @endforeach
@endsection