@extends('layouts.admin') @section('content')
@if($booking->payment_status !== 'paid' && (!empty($booking->last_payment_link_sent_at) && now()->diffInHours($booking->last_payment_link_sent_at) >= 24))
@csrf
@endif

View Booking Details

User Details:

Customer ID

#{{ $booking->user_id ?? 'N/A' }}

Customer Name

@if($booking->userDetails) {{ trim($booking->userDetails->first_name . ' ' . $booking->userDetails->last_name) ?: 'N/A' }} @else N/A @endif

Street, House Number

{{ $booking->userDetails->address ?? 'N/A' }}

Zip Code

{{ $booking->userDetails->zip ?? 'N/A' }}

City

{{ $booking->userDetails->city ?? 'N/A' }}

Country

{{ $booking->userDetails->country ?? 'N/A' }}

Email Address

{{ $booking->userDetails->email ?? 'N/A' }}

Phone Number

{{ $booking->userDetails->phone ?? 'N/A' }}

Note

{{ $booking->notes ?? 'N/A' }}

@foreach($booking->items as $item) @if(!$item->related_item)

Car Details:

Brand

{{ $item->car_name ? explode(' ', $item->car_name)[0] : 'N/A' }}

Year

{{ $item->car_year ?? 'N/A' }}

Model

{{ $item->model ?? 'N/A' }}

Trailer Hitch

{{ isset($item->trailer_hitch) ? ($item->trailer_hitch ? 'Yes' : 'No') : 'N/A' }}

Roof Type

{{ $item->roof_type ?? 'N/A' }}

Product Details:

Product ID

#{{ $item->product_id ?? 'N/A' }}

Product Name

{{ $item->product_name ?? 'N/A' }}

Size / Variation

{{ $item->size ?? 'N/A' }}

Color

{{ $item->color ?? 'N/A' }}

Quantity

{{ $item->quantity ?? 1 }}

Insurance

{{ isset($item->is_insured) ? ($item->is_insured ? 'Yes' : 'No') : 'N/A' }}

Roof Rack Included

{{ isset($item->is_carrier_included) ? ($item->is_carrier_included ? 'Yes' : 'No') : 'N/A' }}

Booking Details:

Booking No.

#{{ $booking->id ?? 'N/A' }} @if(!empty($item->vendor_id)) @endif @if($item->user_timing==1) @endif @if($booking->delay || $item->damage == 1) @endif

Rental Period

{{ $item->pickup_date ? $item->pickup_date->format('d.m.Y') : 'N/A' }} - {{ $item->dropoff_date ? $item->dropoff_date->format('d.m.Y') : 'N/A' }}

Rental Days

{{ $item->days ?? 'N/A' }}

Pick-Up Date/Time

{{ $item->pickup_date ? $item->pickup_date->format('d.m.Y') : 'N/A' }} | {{ !empty($item->pickup_time) ? \Carbon\Carbon::parse($item->pickup_time)->format('H:i') : 'N/A' }}

Drop-off Date/Time

{{ $item->dropoff_date ? $item->dropoff_date->format('d.m.Y') : 'N/A' }} | {{ !empty($item->dropoff_time) ? \Carbon\Carbon::parse($item->dropoff_time)->format('H:i') : 'N/A' }}

SA/SPO Change Reason

{{ $item->change_reason ?? 'N/A' }}

Roof Rack Information

Length: {{ !empty($item->carrier_length) ? preg_replace('/\s*mm$/i', '', $item->carrier_length) : 'N/A' }} @if(!empty($item->foot_sku)) Foot: {{ $item->foot_sku }} @endif @if(!empty($item->footkit_sku)) Foot Kit: {{ $item->footkit_sku }} @endif

Payment Method

{{ $booking->payment_method ? ($booking->payment_method === 'stripe' ? 'Credit Card' : ucfirst($booking->payment_method)) : 'N/A' }}

Payment Status

{{ $booking->payment_status ? ucfirst($booking->payment_status) : 'N/A' }}

Booking Status

{{ $booking->status ? ucfirst($booking->status) : 'N/A' }}

Total Amount

€{{ number_format($booking->total ?? 0, 2, ',' , '.') }}

Discount

€{{ number_format($booking->discount ?? 0, 2 , ',' , '.') }}

PickUp Location
@php $pickupAddress = 'N/A'; $vendorId = (int) ($item->vendor_id ?? 0); if ($vendorId) { $v = $vendors->where('id', $vendorId)->first(); if ($v) { $pickupAddress = "{$v->street} {$v->zip_code} {$v->city}"; } } else { $pickupAddress = 'Esperantostr. 10, 70197 Stuttgart'; } @endphp

{{ $pickupAddress ?? 'N/A' }}

Return Information:

@php $hasAlreadyBooked = $booking->items->contains(fn($i) => !empty($i->already_booked) && $i->already_booked == true); @endphp @if($hasAlreadyBooked)

A booking has already been made against this booking. To avoid issues kindly check it.

@endif
Damaged Product(s)

@php $damagedProducts = $booking->items->where('damage', 1)->pluck('product_name')->toArray(); @endphp {{ !empty($damagedProducts) ? implode(', ', $damagedProducts) : 'N/A' }}

New Drop-off Date

{{ $booking->new_dropoff_date ? \Carbon\Carbon::parse($booking->new_dropoff_date)->format('d.m.Y') : 'N/A' }}

New Drop-off Time

{{ !empty($booking->items->first()->new_dropoff_time) ? \Carbon\Carbon::parse($booking->items->first()->new_dropoff_time)->format('H:i') : 'N/A' }}

Delay Fees

€{{ number_format($booking->delay_fees ?? 0, 2, ',', '.') }}

Additional Days

{{ $booking->additional_days ?? 'N/A' }}

Additional Days Rent

€{{ number_format($booking->additional_days_rent ?? 0, 2, ',', '.') }}

Extra Costs Paid

@if(($booking->additional_days_rent + $booking->delay_fees) == 0) N/A @elseif(isset($booking->delay_fees_paid)) {{ $booking->delay_fees_paid ? 'Paid' : 'Pending' }} @else N/A @endif

@endif @endforeach
@endsection