@extends('layouts.admin') @section('title', 'Booking '.$booking->reference()) @section('content') @php $canJobs = auth()->user()->hasPermission('transport.manage_jobs'); @endphp

{{ $booking->reference() }} @include('partials.status', ['status' => $booking->status_id]) @include('partials.status', ['status' => $booking->payment_status_id])

Booked {{ ist($booking->created_at) }} via {{ $booking->workflow?->name ?? $booking->source_channel }} @if ($booking->reschedule_count) · rescheduled {{ $booking->reschedule_count }}× @endif
@if (isset($actions['cancel'])) @endif
@if ($booking->cancelled_at)
Cancelled {{ ist($booking->cancelled_at) }} — {{ $booking->cancellationReason?->label }}: {{ $booking->cancellation_note }}
@endif
{{-- Next step for operations --}} @if ($canJobs) @if ($code === 'requested' && isset($actions['accept']))
Waiting for acceptance. Accepting confirms the booking and gives it a reference number.
@csrf
@elseif ($code === 'confirmed')
Assign vehicle and driver

Showing verified vehicles of active operators that can carry {{ $booking->total_weight_kg ? indian_number($booking->total_weight_kg).' kg' : 'the load' }} and are free from {{ ist($window[0], 'd M h:i A') }} to {{ ist($window[1], 'h:i A') }}.

@if ($vehicles->isEmpty())
No suitable vehicle is free for this slot. Verify more vehicles, or contact the customer to reschedule.
@else
@csrf
@endif
@elseif ($code === 'vehicle_assigned')
Vehicle assigned. Mark the pickup when the driver loads the goods.
@csrf
@elseif ($code === 'in_transit')
In transit.
@csrf
@elseif ($code === 'delivered')
Delivered. Record the cash collected, then complete the booking.
@csrf
@endif @endif
Route
    @foreach ($booking->stops as $s)
  • {{ ucfirst($s->stop_type) }}: {{ $s->place_name }}
    {{ collect([$s->address_text, $s->locality_name, $s->district_name, $s->state_name])->filter()->unique()->join(', ') }}
    @if ($s->contact_name || $s->contact_phone)
    {{ $s->contact_name }} {{ $s->contact_phone }}
    @endif @if ($s->scheduled_at)
    Scheduled {{ ist($s->scheduled_at) }}
    @endif
  • @endforeach
Pickup time
{{ ist($booking->pickup_scheduled_at) }} @if ($booking->original_pickup_scheduled_at && $booking->original_pickup_scheduled_at != $booking->pickup_scheduled_at)(first asked {{ ist($booking->original_pickup_scheduled_at) }})@endif
Distance
{{ $booking->distance_km ? $booking->distance_km.' km' : '—' }} {{ $booking->estimated_duration_minutes ? '· about '.$booking->estimated_duration_minutes.' min' : '' }}
Contact
{{ $booking->contact_name }} {{ $booking->contact_phone }}
Load
@foreach ($booking->items as $i) @endforeach
MaterialPackagingPackagesEachTotalNeeds
{{ $i->material_name }} {{ $i->materialType?->label }} {{ $i->packagingType?->label ?? '—' }}{{ $i->package_count ?? '—' }} {{ $i->weight_per_package_kg ? (float) $i->weight_per_package_kg.' kg' : '—' }} {{ indian_number($i->total_weight_kg) }} kg {{ collect([$i->requires_cover ? 'Cover' : null, $i->requires_refrigeration ? 'Cold' : null])->filter()->join(', ') ?: '—' }}
Total weight{{ indian_number($booking->total_weight_kg) }} kg
@if ($booking->loading_instructions)
Loading instructions: {{ $booking->loading_instructions }}
@endif
Tracking
@forelse ($booking->trackingEvents as $e) @if ($loop->first)
    @endif
  • {{ $e->eventType?->label }} {{ $e->location_label ? '· '.$e->location_label : '' }} @if ($e->note)
    {{ $e->note }}
    @endif
    {{ ist($e->recorded_at) }} · {{ humanize($e->source) }} @if ($e->eta_at) · ETA {{ ist($e->eta_at, 'h:i A') }} @endif
  • @if ($loop->last)
@endif @empty
No tracking updates yet. Live GPS arrives in Release 2.
@endforelse
@if ($booking->assignments->isNotEmpty())
Assignment history
@foreach ($booking->assignments as $a) @endforeach
{{ $a->vehicle?->registration_number }}{{ $a->driver?->displayName() }} {{ ist($a->assigned_at) }} by {{ $a->assignedBy?->displayName() ?? 'system' }} {!! $a->is_current ? 'Current' : 'Released '.e(ist($a->released_at)).' — '.e($a->release_reason) !!}
@endif
Customer
{{ $booking->customer->displayName() }}
{{ $booking->customer->fullPhone() }}
Vehicle and driver
@if ($booking->vehicle_registration_snapshot)
Vehicle
{{ $booking->vehicle_label_snapshot }} {{ $booking->vehicle_type_name_snapshot }}
Registration
{{ $booking->vehicle_registration_snapshot }}
Capacity
{{ indian_number($booking->vehicle_capacity_kg_snapshot) }} kg {{ $booking->vehicle_body_type_snapshot ? '· '.$booking->vehicle_body_type_snapshot : '' }}
Operator
@if ($booking->transport_operator_id && auth()->user()->hasPermission('transport.verify')){{ $booking->operator_name_snapshot }}@else{{ $booking->operator_name_snapshot }}@endif
Driver
{{ $booking->driver_name_snapshot }} {{ $booking->driver?->fullPhone() }}
@else
Not assigned yet. Customer asked for: {{ $booking->requestedVehicleType?->name ?? 'any vehicle' }}.
@endif
Fare
Transport fare
{{ inr($booking->fare_amount, true) }}
Service fee
{{ inr($booking->service_fee_amount, true) }}
Tax
{{ inr($booking->tax_amount, true) }}
@if ((float) $booking->discount_amount)
Discount
−{{ inr($booking->discount_amount, true) }}
@endif
{{ $booking->is_fare_estimate ? 'Estimated total' : 'Total' }}
{{ inr($booking->estimated_total_amount, true) }}
@if ($booking->final_total_amount !== null)
Final total
{{ inr($booking->final_total_amount, true) }}
@endif
Payment
{{ $booking->paymentMethod?->name ?? '—' }} · {{ $booking->paymentTiming?->label ?? '—' }}
@if ($booking->fare_inclusions_snapshot)
Includes: {{ $booking->fare_inclusions_snapshot }}. {{ $booking->loading_by_customer ? 'Loading and unloading arranged by the customer.' : '' }}
@endif
The agreed fare is frozen at confirmation (BRL-09).
@if ($canJobs && in_array($code, ['delivered', 'completed']) && \App\Models\Status::find_($booking->payment_status_id)?->code === 'unpaid')
@csrf
₹
@endif @foreach ($payments as $p)
{{ inr($p->amount, true) }} {{ $p->method?->name }} · @include('partials.status', ['status' => $p->status_id]) {{ ist($p->paid_at) }}
@endforeach
@if ($tickets->isNotEmpty())
Support tickets
@endif @include('partials.history', ['history' => $history, 'domain' => 'transport_booking'])
{{-- Cancel --}} {{-- Release vehicle --}} @endsection @push('scripts') @endpush