{{ config('app.name') }}

@yield('content') @isset($booking)
Booking Details
@if($booking->start_time && $booking->end_time) @endif
Booking ID #{{ $booking->external_id ?? $booking->id }}
Date {{ $booking->booking_date ? \Carbon\Carbon::parse($booking->booking_date)->format('M d, Y') : '-' }} @if($booking->end_date && $booking->end_date != $booking->booking_date) → {{ \Carbon\Carbon::parse($booking->end_date)->format('M d, Y') }} @endif
Time {{ $booking->start_time }} - {{ $booking->end_time }}
Guests {{ $booking->quantity ?? $booking->guests ?? 1 }} {{ ($booking->quantity ?? $booking->guests ?? 1) > 1 ? 'Units' : 'Unit' }}
Total Payment Rp {{ number_format($booking->total_price, 0, ',', '.') }}
Payment Status @php $paidStatuses = ['settlement', 'capture', 'success', 'paid']; $isPaidStatus = in_array(strtolower($booking->payment_status ?? 'pending'), $paidStatuses); @endphp {{ $isPaidStatus ? 'PAID' : 'UNPAID' }}
Booking Status {{ $booking->status }}
@if($booking->workspace)
@php $mainImage = $booking->workspace->calculated_main_image; // Ensure it's absolute if ($mainImage && !filter_var($mainImage, FILTER_VALIDATE_URL)) { $mainImage = asset('storage/' . ltrim($mainImage, '/')); } @endphp @if($mainImage) Workspace @endif
{{ $booking->workspace->categories->first()->name ?? $booking->workspace->category ?? 'Workspace' }}

{{ $booking->workspace->title }}

@if($booking->workspace->description)

{{ $booking->workspace->description }}

@endif @if($booking->workspace->cancellation_policy)
Cancellation Policy
@php $policyType = strtolower($booking->workspace->cancellation_policy); $refundPercent = $booking->workspace->cancellation_refund_percentage ?? 0; $deadline = $booking->workspace->cancellation_deadline_hours ?? 24; $policyTitle = 'No Refund'; if ($policyType === 'full') $policyTitle = 'Flexible (Full Refund)'; elseif ($policyType === 'partial') $policyTitle = "Moderate ({$refundPercent}% Refund)"; $policyDesc = "Booking is non-refundable."; if ($policyType === 'full') { $policyDesc = "Guests receive a full refund if they cancel at least {$deadline} hours before the scheduled check-in."; } elseif ($policyType === 'partial') { $policyDesc = "Guests receive a {$refundPercent}% refund if they cancel at least {$deadline} hours before the scheduled check-in."; } @endphp

{{ $policyTitle }}

{{ $policyDesc }}

@endif
@endif @if(isset($payout_calculation))
Payout Calculation
Subtotal (Base) Rp {{ number_format($payout_calculation['subtotal'], 0, ',', '.') }}
Platform Fee ({{ $payout_calculation['fee_percentage'] }}%) + Rp {{ number_format($payout_calculation['platform_fee'], 0, ',', '.') }}
Gross Total Rp {{ number_format($payout_calculation['total'], 0, ',', '.') }}
Est. Net Payout Rp {{ number_format($payout_calculation['net_payout'], 0, ',', '.') }}
@endif
@endisset