@extends('layouts.admin.app') @section('title', 'Chi tiết booking') @section('content') @php $backUrl = request()->filled('trip_id') ? route('admin.booking-management.trip-bookings', ['tripId' => (int) request('trip_id')]) : route('admin.booking-management.index'); $paymentMethod = $booking->payment?->payment_method; $paymentMethodLabel = match ($paymentMethod) { 'onboard' => 'Thanh toán khi lên xe', 'qr' => 'QR', default => $paymentMethod ? strtoupper($paymentMethod) : '-', }; $bookingStatusLabels = [ 'draft' => 'Nháp', 'reserved' => 'Đã giữ chỗ', 'awaiting_payment' => 'Chờ thanh toán', 'paid' => 'Đã thanh toán', 'cancelled' => 'Đã hủy', 'expired' => 'Hết hạn', ]; $paymentStatusLabels = [ 'pending' => 'Chờ xử lý', 'success' => 'Thành công', 'failed' => 'Thất bại', ]; $bookingStatusText = $bookingStatusLabels[$booking->booking_status] ?? $booking->booking_status; $paymentStatusText = $paymentStatusLabels[$booking->payment_status] ?? $booking->payment_status; $journeyTypeLabels = [ 'one_way' => 'Một chiều', 'round_trip' => 'Hai chiều', ]; $journeyDirectionLabels = [ 'outbound' => 'Chiều đi', 'return' => 'Chiều về', ]; $journeyTypeText = $journeyTypeLabels[$booking->journey_type] ?? 'Một chiều'; $journeyDirectionText = $booking->journey_direction ? $journeyDirectionLabels[$booking->journey_direction] ?? $booking->journey_direction : '-'; $bookingBadgeClass = match ($booking->booking_status) { 'paid' => 'bg-emerald-100 text-emerald-700', 'cancelled' => 'bg-rose-100 text-rose-700', 'expired' => 'bg-gray-200 text-gray-700', 'reserved', 'awaiting_payment' => 'bg-amber-100 text-amber-700', default => 'bg-blue-100 text-blue-700', }; $paymentBadgeClass = match ($booking->payment_status) { 'success' => 'bg-emerald-100 text-emerald-700', 'failed' => 'bg-rose-100 text-rose-700', default => 'bg-amber-100 text-amber-700', }; $canMarkNoShow = in_array($booking->booking_status, ['paid', 'reserved'], true) && !$booking->no_show; $isNoShow = (bool) $booking->no_show; $canDelete = !($booking->booking_status === 'paid' || $booking->payment_status === 'success'); @endphp
Chi tiết booking
Theo dõi thông tin khách, trạng thái thanh toán và xử lý đơn tập trung.
Khách hàng
{{ $booking->customer_name }}
Số điện thoại
{{ $booking->customer_phone }}
{{ $booking->customer_email ?: '-' }}
Tuyến
{{ $booking->trip?->route?->fromStation?->name }} - {{ $booking->trip?->route?->toStation?->name }}
Giờ chạy
{{ $booking->trip?->depart_at?->format('d/m/Y H:i') }}
Ghế đã đặt
{{ $booking->items->pluck('seat_code_snapshot')->implode(', ') }}
Phương thức thanh toán
{{ $paymentMethodLabel }}
Loại hành trình
{{ $journeyTypeText }}
Chiều
{{ $journeyDirectionText }}
Mã nhóm khứ hồi
{{ $booking->booking_group_code ?: '-' }}
Không lên xe
Lúc {{ $booking->no_show_at?->format('d/m/Y H:i') }}
Đơn này đã ở trạng thái cuối, không thể xử lý tiếp.
@elseif ($booking->booking_status === 'paid') {{-- Đã thu tiền: chỉ no-show --}}