@extends('layouts.vendor') @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

@lang('messages.view_booking_details')

@lang('messages.user_details')

@lang('messages.customer_id')

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

@lang('messages.customer_name')

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

@lang('messages.street_house_number')

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

@lang('messages.zip_code')

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

@lang('messages.city')

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

@lang('messages.country')

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

@lang('messages.email_address')

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

@lang('messages.phone_number')

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

@lang('messages.note')

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

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

Car Details:

@lang('messages.brand')

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

@lang('messages.year')

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

@lang('messages.model')

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

@lang('messages.trailer_hitch')

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

@lang('messages.roof_type')

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

@lang('messages.product_details')

@lang('messages.product_id')

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

@lang('messages.product_name')

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

@lang('messages.size_variation')

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

@lang('messages.color')

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

@lang('messages.quantity')

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

@lang('messages.insurance')

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

@lang('messages.roof_rack_included')

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

@lang('messages.booking_details')

@lang('messages.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

@lang('messages.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' }}

@lang('messages.rental_days')

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

@lang('messages.pickup_datetime')

{{ $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' }}

@lang('messages.dropoff_datetime')

{{ $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' }}

@lang('messages.sa_spo_change_reason')

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

@lang('messages.roof_rack_information')

@lang('messages.length'): {{ !empty($item->carrier_length) ? preg_replace('/\s*mm$/i', '', $item->carrier_length) : 'N/A' }} @if(!empty($item->foot_sku)) @lang('messages.foot'): {{ $item->foot_sku }} @endif @if(!empty($item->footkit_sku)) @lang('messages.foot_kit'): {{ $item->footkit_sku }} @endif

@lang('messages.payment_method')

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

@lang('messages.payment_status')

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

@lang('messages.booking_status')

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

@lang('messages.total_amount')

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

@lang('messages.discount')

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

@lang('messages.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' }}

@lang('messages.return_information')

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

@lang('messages.already_booked_warning')

@endif
@lang('messages.damaged_products')

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

@lang('messages.new_dropoff_date')

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

@lang('messages.new_dropoff_time')

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

@lang('messages.delay_fees')

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

@lang('messages.additional_days')

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

@lang('messages.additional_days_rent')

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

@lang('messages.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