@include('Partials.sidebar')
@include('Partials.header')
{{-- Page title --}}

Bookings

  1. โ€บ
  2. Bookings
{{-- Flash --}} @foreach(['success', 'error'] as $t) @if(session($t))
{{ session($t) }}
@endif @endforeach {{-- Stats cards --}}
@php $cards = [ ['label' => 'Total Bookings', 'value' => $stats['total'], 'icon' => 'fa-bookmark', 'color' => 'primary'], ['label' => 'Pending', 'value' => $stats['pending'], 'icon' => 'fa-clock', 'color' => 'warning'], ['label' => 'Confirmed', 'value' => $stats['confirmed'], 'icon' => 'fa-check-circle', 'color' => 'success'], ['label' => 'Commission Pending', 'value' => $stats['commission_pending'], 'icon' => 'fa-coins', 'color' => 'info', 'suffix' => ' bookings'], ['label' => 'Total Commission Earned', 'value' => $currency . number_format($stats['commission_total'], 2), 'icon' => 'fa-rupee-sign', 'color' => 'dark'], ]; @endphp @foreach($cards as $c)
{{ $c['label'] }}
{{ $c['value'] }}{{ $c['suffix'] ?? '' }}
@endforeach
{{-- Filters --}}
{{-- Table --}}
@forelse($bookings as $b) @php // booked_by_broker_id is shared by brokers AND sales agents โ€” // only the related user's role tells them apart. $bAgentRole = $b->broker->role ?? null; $bIsSales = $bAgentRole === 'sales'; $bIsBroker = $bAgentRole === 'broker'; @endphp @empty @endforelse
# Unit Client Agent Plan Price Commission Booking Status Commission Status Date Actions
{{ $loop->iteration }}
{{ $b->plot_number }} @if(in_array($b->id, $pendingManualBookingIds)) Pending Payment @endif
{{ $b->plot_type }} ยท {{ $b->block->block_name }} . {{ $b->project->project_name }}
{{ $b->displayClientName() }}
{{ $b->displayClientPhone() }}
@if(($bIsSales || $bIsBroker) && $b->client_email)
{{ $b->client_email }}
@endif
@if($bIsBroker) ๐Ÿค {{ $b->broker->name }} @elseif($bIsSales) ๐Ÿ“ˆ {{ $b->broker->name }} @else โ€” @endif {{ $b->paymentPlan?->name ?? 'โ€”' }}
{{ $b->price }}
@if($b->total_amount)
Total: {{ $currency }} {{ number_format($b->total_amount, 2) }}
@endif
@if($b->commission_amount)
{{ $currency }} {{ number_format($b->commission_amount, 2) }}
{{ $b->commission_rate }}%
@else โ€” @endif
{!! $b->bookingStatusBadge() !!} @if($b->commission_amount) {!! $b->commissionStatusBadge() !!} @if($b->commission_paid_at)
{{ $b->commission_paid_at->format('d M Y') }}
@endif @else โ€” @endif
{{ $b->created_at->format('d M Y') }}
No bookings found.
@if($bookings->hasPages()) @endif
@include('Partials.footer')