@extends('customer.layouts.app')
@section('title', 'Booking Details')
@section('content')
Service booking{{ $booking->booking_no }}
Submitted {{ $booking->created_at->format('d M Y, h:i A') }}
Back
Status{{ $booking->service_status }}
Service date{{ \Carbon\Carbon::parse($booking->service_date)->format('d M Y') }}
Service time{{ $booking->service_time ? \Carbon\Carbon::parse($booking->service_time)->format('h:i A') : 'To be confirmed' }}
@php
$trackingSteps = ['Booked', 'Assigned', 'In Progress', 'Completed'];
$trackingStatus = $booking->service_status;
$currentStep = array_search($trackingStatus, $trackingSteps, true);
$currentStep = $currentStep === false ? 0 : $currentStep;
@endphp
Booking Status Tracking
Updated {{ $booking->updated_at->format('d M Y, h:i A') }}
@if($trackingStatus === 'Cancelled')
This booking has been cancelled.
@else
@foreach($trackingSteps as $index => $step)
{{ $step }}
@endforeach
@endif
@if(session('success')){{ session('success') }}
@endif
@if(session('payment_error')){{ session('payment_error') }}
@endif
@if($errors->has('payment')){{ $errors->first('payment') }}
@endif
@if($booking->service_status === 'Completed' && $booking->invoice)
Invoice {{ $booking->invoice->invoice_no }}
Amount: ₹{{ number_format($booking->invoice->grand_total, 2) }} · Payment: {{ $booking->invoice->payment_status }}
@if($booking->invoice->payment_status !== 'Paid')
@else
Paid
@endif
@endif
Booking information
Technician status{{ $booking->latestAssignment?->work_status ?? 'Not assigned yet' }}
Service address{{ $booking->service_address }}
Remarks{{ $booking->remarks ?: 'No remarks added' }}
Uploaded images
{{ $booking->images->count() }}/5
@if($booking->images->isNotEmpty())
@foreach($booking->images as $image)
 }})
@endforeach
@else
No images were added to this booking.
@endif
Assigned Technician
@if($booking->latestAssignment){{ $booking->latestAssignment->work_status }}@endif
@if($booking->latestAssignment?->technician)
@php($technician = $booking->latestAssignment->technician)
Technician{{ $technician->technician_name }}Assigned for your pest-control service
Assigned date{{ $booking->latestAssignment->assigned_date ? \Carbon\Carbon::parse($booking->latestAssignment->assigned_date)->format('d M Y') : '-' }}
Assigned time{{ $booking->latestAssignment->assigned_time ? \Carbon\Carbon::parse($booking->latestAssignment->assigned_time)->format('h:i A') : 'To be confirmed' }}
@else
Technician not assigned yetTechnician contact and schedule details will appear here after assignment.
@endif
@endsection