@section('title', $isEditMode ? 'Edit Order' : 'Add Order') @section('heading', $isEditMode ? 'Edit Order' : 'Add Order') @section('top-menu-items') @endsection
Order ID : {{ $order->id }}
Order Status : @if ($order->is_refund) Issue Refund {{ $order->status ?? '' }} @else {{ $order->status ?? '' }} @endif
  
Order Date : {{ $order->order_date }}
{{ $order->id }}

@if($selectedPartnerId) Partner selected. Customers will be filtered. @else No partner selected. Showing customers without partner. @endif
@error('orderable_id') {{ $message }} @enderror
{{-- @if ($order->orderable->partner)
{{ $order->orderable->partner->organization_name ?? 'N/A' }}
@endif --}}
@if ($order->bookings->isNotEmpty())

{{ $order->bookings->count() }}

@else

0

@endif
@if ($order->bookings->isNotEmpty())

{{ $order->bookings->sum(fn($b) => $b->passengers->count()) }}

@else

0

@endif
{{--
@error('before_stay_address') {{ $message }} @enderror
--}} {{--
@error('after_stay_address') {{ $message }} @enderror
--}} @php $hasBookings = $order->bookings()->exists(); $currentDate = now()->toDateString(); if ($hasBookings) { $hasBookingToday = $order ->bookings() ->whereDate('booking_date', '>=', $currentDate) ->exists(); } else { $hasBookingToday = $order->order_date->format('Y-m-d') >= $currentDate; } @endphp {{-- @if (!in_array($order->status, ['No Show', 'Weathered', 'Completed']) || $hasBookingToday) --}} {{-- @if (!in_array($order->status, ['No Show', 'Weathered']) || $hasBookingToday) --}}
@error('order_date') {{ $message }} @enderror
@php $currentDate = now()->toDateString(); $hasBookings = $order->bookings()->exists(); if ($hasBookings) { $hasFutureOrTodayBooking = $order->bookings() ->whereDate('booking_date', '>=', $currentDate) ->exists(); } else { $hasFutureOrTodayBooking = $order->order_date->format('Y-m-d') >= $currentDate; } @endphp @error('status') {{ $message }} @enderror
@error('partner_ref_id') {{ $message }} @enderror
@if ($order->primaryContact)
{{ $order->primaryContact->first_name ?? 'N/A' }} {{ $order->primaryContact->last_name ?? '' }}
{{ $order->primaryContact->email ?? 'N/A' }}
{{ $order->primaryContact->phone ?? 'N/A' }}
@endif

Name: {{ $order->customer_first_name ?? 'N/A' }} {{ $order->customer_last_name ?? '' }}
Contact: {{ $order->customer_email ?? 'N/A' }} | {{ $order->customer_phone ?? '' }}
Residential Address: {{ $order->customer_residential_address ?? 'N/A' }}
Stay Night Before: {{ $order->before_stay_address ?? 'N/A' }}
Stay Night After: {{ $order->after_stay_address ?? 'N/A' }}
Referral Source: {{ $order->customer_referral_source ?? 'N/A' }}
@if ($order->orderable?->partner_id)

Organization Name : {{ $order->partner_organization_name ?? 'N/A' }}
{!! $order->partner_commission_percentage !== null ? 'Commission Partnership Billing: ' . $order->partner_commission_percentage . '%' : ($order->partner_discount_percentage !== null ? 'Discount Partnership Billing: ' . $order->partner_discount_percentage . '%' : 'N/A') !!}
Office Phone Number: {{ $order->partner_phone_number ?? 'N/A' }}
Mailing Address: {{ $order->partner_address_line1 ?? '' }} {{ $order->partner_address_line2 ?? '' }} {{ $order->partner_country ?? '' }} {{ $order->partner_postal_code ?? '' }}
Sales Rep Contact: {{ $order->partner_first_name ?? '' }} {{ $order->partner_last_name ?? '' }} {{ $order->partner_email ?? '' }}
Accounting Contact: {{ $order->partner_accountant_first_name ?? '' }} {{ $order->partner_accountant_last_name ?? '' }} {{ $order->partner_billing_email_address ?? '' }}
@endif
@if ($order->created_by === 'partner')
{{-- @forelse($partnerCustomers as $customer)
FIT Name : {{ $customer->first_name ?? 'N/A' }}
Email Address : {{ $customer->email ?? 'N/A' }}
Residential Address : {{ $customer->residential_address ?? 'N/A' }}
@empty
No partner customers found.
@endforelse --}}
@endif
@forelse ($selectedOrderAddons ?? [] as $addon) @php // TODO: @endphp
Item Name Type Price Qty Participant Actions
{{ $addon->name ?? 'N/A' }} {{ $addon->type ?? 'N/A' }} {{ $addon->price ?? 'N/A' }} {{ $addon->passenger_name ?? 'N/A' }} Actions