{{-- Résumé d'une course, identique en attente et en historique. --}}
@if ($booking->isImmediate()) {{ __('chauffeur.booking_mode_now') }} @else {{ $booking->scheduled_at?->translatedFormat('l j F Y — H\hi') }} @endif
{{ __('chauffeur.booking_reference') }} #{{ $booking->id }} · {{ $booking->created_at->translatedFormat('j M Y H:i') }}
{{ __('chauffeur.booking_status_' . $booking->status) }}
@if ($booking->isDishDelivery())
{{ __('chauffeur.delivery_type') }} {{ __('chauffeur.delivery_type_dish') }}
@endif @if ($booking->range_label)
{{ __('chauffeur.booking_range') }} {{ $booking->range_label }}
@endif
{{ $booking->isDishDelivery() ? __('chauffeur.delivery_pickup_restaurant') : __('chauffeur.booking_pickup') }} {{ $booking->pickup_address }}
@if ($booking->dropoff_address)
{{ __('chauffeur.booking_dropoff') }} {{ $booking->dropoff_address }}
@endif @if ($booking->estimated_km)
{{ __('chauffeur.booking_estimate') }} {{ number_format((float) $booking->estimated_km, 1, ',', ' ') }} km @if ($booking->estimated_amount) — {{ number_format((float) $booking->estimated_amount, 2, ',', ' ') }} {{ $booking->currency }} @endif
@endif @if ($booking->passengers)
{{ __('chauffeur.booking_passengers') }} {{ $booking->passengers }}
@endif @if ($booking->client_message)
{{ __('chauffeur.booking_message') }} {{ $booking->client_message }}
@endif @if ($booking->total_amount)
{{ __('chauffeur.booking_amount') }} {{ number_format((float) $booking->total_amount, 2, ',', ' ') }} {{ $booking->currency }}
@endif {{-- Le téléphone du client est utile dès la demande : le chauffeur peut avoir besoin de l'appeler avant même de répondre, notamment pour une course immédiate. --}}
{{ __('chauffeur.booking_client') }} {{ trim(($booking->client->first_name ?? '') . ' ' . ($booking->client->last_name ?? '')) ?: $booking->client?->name }} @if ($booking->client_phone ?: $booking->client?->phone) · {{ $booking->client_phone ?: $booking->client->phone }} @endif
{{-- Appel direct du client : sur un téléphone, le lien « tel: » ouvre l'application d'appel. Il accompagne le numéro, visible dès la demande. --}} @php $clientCallUrl = phone_tel_uri($booking->client_phone ?: $booking->client?->phone, $booking->client?->country); @endphp @if ($clientCallUrl)
{{ __('chauffeur.mail_call_client') }}
@endif @if ($booking->isPending() && $booking->chauffeur_deadline)

{{ __('chauffeur.booking_answer_before', ['time' => $booking->chauffeur_deadline->translatedFormat('j M H:i')]) }}

@endif {{-- Suivi du trajet réel : quatre étapes, chacune n'apparaît qu'une fois la précédente validée. Une course en attente ou refusée n'en a pas encore besoin — le suivi ne démarre qu'une fois la course confirmée. --}} {{-- Marqueur muet, lu par le JS de diffusion de position : tant que la course est en route (départ signalé, pas encore terminée), ce navigateur doit envoyer sa position pour alimenter la carte de suivi du client. --}} @if ($booking->livePositionAllowed()) @endif {{-- Navigation, une fois la course réellement commencée : le chauffeur choisit de suivre l'itinéraire dans le GPS de son téléphone, départ et arrivée préremplis, ou de rester dans l'application. --}} @php $navLinks = ($booking->started_at && ! $booking->completed_at) ? $booking->navigationLinks() : null; @endphp @if ($navLinks)

{{ __('chauffeur.nav_question') }}

{{ __('chauffeur.nav_tracking_note') }}

@endif {{-- Carte de la course, du côté du conducteur. Il voit exactement ce que voit son client : son approche jusqu'au point de départ, puis le trajet de la course, avec sa propre position qui avance dessus. Elle n'apparaît que pendant le trajet réel — avant le départ, il n'y a rien à suivre. --}} @if ($booking->ridePermitted() && ! $booking->completed_at)
{{ __('messages.carriers_track_driver_map_title') }}
{{-- État de la localisation : c'est elle qui alimente la carte du client. Rempli par le script de diffusion, pendant le trajet réel. --}} @if ($booking->livePositionAllowed())

@endif
@endif {{-- Acceptée, paiement du client attendu : les étapes sont déjà là, grisées, et la page se recharge d'elle-même dès que le client a payé. --}} @if ($booking->isAccepted() && ! $booking->paymentWindowExpired()) @php $awaitIcons = ['heading' => 'fa-route', 'arrived' => 'fa-location-dot', 'started' => 'fa-play', 'completed' => 'fa-flag-checkered']; $awaitPrefix = $booking->isDishDelivery() ? 'chauffeur.delivery_step_' : 'chauffeur.ride_step_'; $firstStep = $booking->rideSteps()[0]; @endphp

{{ __('chauffeur.booking_awaiting_payment', ['time' => $booking->payment_deadline?->translatedFormat('H:i')]) }}

{{ __('chauffeur.booking_steps_after_payment') }}

@endif @if ($booking->ridePermitted()) @php $rideIcons = [ 'heading' => 'fa-route', 'arrived' => 'fa-location-dot', 'started' => 'fa-play', 'completed' => 'fa-flag-checkered', ]; $nextStep = $booking->nextRideStep(); @endphp
@foreach (\App\Models\ChauffeurBooking::RIDE_STEPS as $step) @continue(! $booking->hasRideStep($step)) {{ __(($booking->isDishDelivery() ? 'chauffeur.delivery_step_' : 'chauffeur.ride_step_') . $step . '_past') }} @unless ($loop->last) @endunless @endforeach @if ($nextStep)
@csrf
@else {{ $booking->isDishDelivery() ? __('chauffeur.delivery_completed') : __('chauffeur.ride_completed') }} @endif
@endif {{-- Deux documents pour une même course : celle que le chauffeur émet vers son client, et celle que Vikishop lui adresse pour sa commission. --}} @if ($booking->isPaid())
{{ __('chauffeur.invoice_download') }} {{ __('chauffeur.commission_invoice_download') }}
@endif