@extends('backend.partials.master') @section('title') {{ ___('menus.my_bookings') }} @endsection @section('maincontent') @foreach($bookings as $b) @php $map = ['pending'=>'warning','confirmed'=>'info','paid'=>'success','cancelled'=>'danger']; $c = $map[$b->status] ?? 'warning'; $payable = in_array($b->status, ['pending', 'confirmed'], true) && (float) $b->amount > 0 && ! $b->isPaid() && $b->payment_status !== 'pending_verification'; $state = $reviewState[$b->id] ?? ['review' => null, 'reason' => 'Not reviewable.']; $review = $state['review']; $reviewReason = $state['reason']; @endphp BKG-{{ str_pad($b->id, 5, '0', STR_PAD_LEFT) }} {{ $b->package->title ?? $b->customer_name }} {{ $b->travel_date?->translatedFormat('d M Y') }} {{ $b->travelers }} {{ currency_symbol() }}{{ number_format($b->amount) }} @if($b->hasDiscount())
{{ currency_symbol() }}{{ number_format($b->grossAmount()) }} −{{ currency_symbol() }}{{ number_format($b->totalDiscount()) }} @if($b->coupon_code) ({{ $b->coupon_code }}) @endif @endif
{{ admin_label(ucfirst($b->status)) }} @if($b->payment_claimed_at || $b->payment_status === 'pending_verification') {{ ___('label.payment_claimed_awaiting') }} @endif @if($b->payment_status === 'rejected') Your last payment could not be verified. Please pay again. @endif {!! $b->paymentStatusBadge() !!} @if($b->supplier_status && $b->supplier_status !== 'not_required') {!! $b->supplierStatusBadge() !!} @endif
@if($payable) @endif {{-- Reviewable only once the trip is paid for and taken; ReviewService decided that, not this template. --}} @if($review) {{ $review->rating }}★ {{ admin_label(ucfirst($review->status)) }} @elseif(! $reviewReason) @elseif(! $payable) — @endif
@endforeach
@foreach($bookings as $b) @if(in_array($b->status, ['pending', 'confirmed'], true) && (float) $b->amount > 0 && ! $b->isPaid() && $b->payment_status !== 'pending_verification') @endif @endforeach @foreach($bookings as $b) @php // A null reason means ReviewService found nothing standing in the // way; any string is the explanation for why it did. $state = $reviewState[$b->id] ?? null; $canReview = $state && ! $state['review'] && $state['reason'] === null; @endphp @if($canReview) @endif @endforeach
@endsection