@include('Partials.sidebar')
@include('Partials.header')

Instant Bookings

Walk-in & manual bookings — confirm immediately without online payment

  1. Instant Bookings
@foreach(['success','error'] as $t) @if(session($t))
{{ session($t) }}
@endif @endforeach {{-- ── Milestone KPI Cards ── --}}
@php $kpis = [ ['label'=>'Overdue Milestones','value'=>$milestoneSummary['overdue'], 'icon'=>'fas fa-exclamation-circle','color'=>'#ef4444','bg'=>'rgba(239,68,68,0.08)','border'=>'rgba(239,68,68,0.2)'], ['label'=>'Due in 30 Days','value'=>$milestoneSummary['due_soon'], 'icon'=>'fas fa-clock','color'=>'#f59e0b','bg'=>'rgba(245,158,11,0.08)','border'=>'rgba(245,158,11,0.2)'], ['label'=>'Pending Collection','value'=>$currency.number_format($milestoneSummary['pending_amount'],0), 'icon'=>'fas fa-wallet','color'=>'#c9a96e','bg'=>'rgba(201,169,110,0.08)','border'=>'rgba(201,169,110,0.2)'], ['label'=>'Total Collected','value'=>$currency.number_format($milestoneSummary['paid_amount'],0), 'icon'=>'fas fa-check-circle','color'=>'#22c55e','bg'=>'rgba(34,197,94,0.08)','border'=>'rgba(34,197,94,0.2)'], ]; @endphp @foreach($kpis as $k)
{{ $k['value'] }}
{{ $k['label'] }}
@endforeach
{{-- ── New Instant Booking Form ── --}}
New Instant Booking
@csrf
{{-- Step 1: Unit --}}
1. Select Unit
@if($availablePlots->isEmpty()) No available units at the moment. @endif
{{-- Step 2: Payment Plan --}}
2. Payment Plan (optional)
Select a unit first to see available plans.
{{-- ── Fee Breakdown Card ── --}} {{-- Step 3: Client --}}
3. Client Details
{{-- Client type toggle --}}
{{-- Registered user fields --}}
{{-- Walk-in fields --}} {{-- Step 4: Payment --}}
4. Payment Details
⚠️ This will immediately confirm the booking and mark the unit as booked. The client will receive an in-app notification if they have an account.
{{-- ── Search ── --}}
{{-- ── Bookings Table ── --}}
{{ $bookings->total() }} Walk-in / Manual Bookings
@forelse($bookings as $b) @php $txn = $b->transactions?->first(); $ms = $b->milestones ?? collect(); $msPaid = $ms->where('status','paid'); $msPending = $ms->where('status','pending'); $msOverdue = $ms->where('status','overdue'); $hasMs = $ms->isNotEmpty(); $nextDue = $msPending->merge($msOverdue)->filter(fn($m)=>$m->due_date)->sortBy('due_date')->first(); @endphp {{-- Expandable milestone row --}} @if($hasMs) @endif @empty @endforelse
# Unit Client Account Payment Plan Amount Mode Date Actions
{{ $b->id }} Unit {{ $b->plot_number }}
{{ $b->plot_type }}{{ $b->area ? ' · '.$b->area.' sqft' : '' }}
{{ $b->client_name ?: $b->user?->name ?: '—' }}
{{ $b->client_phone ?: $b->user?->phone }}
@if(!$b->user_id) Walk-in @endif
@if($b->user)
{{ $b->user->name }}
{{ $b->user->email }}
@else No account @endif
@if($b->paymentPlan) {{ $b->paymentPlan->name }} @if($hasMs) @php $msTotal = $ms->count(); $msPaidCnt = $msPaid->count(); $msPct = $msTotal > 0 ? round($msPaidCnt/$msTotal*100) : 0; @endphp
{{ $msPaidCnt }}/{{ $msTotal }} paid @if($msOverdue->isNotEmpty()) · {{ $msOverdue->count() }} overdue @endif
@endif @else Full payment @endif
@php $collectedAmt = $hasMs && $msPaid->isNotEmpty() ? $msPaid->sum('amount') : ($b->down_payment_amount ?: $b->price); $totalAmt = $hasMs && $ms->isNotEmpty() ? $ms->sum('amount') : ($b->total_amount ?: $b->price); $overdueAmt = $msOverdue->sum('amount'); $pendingAmt = $msPending->sum('amount'); $outstandAmt = $pendingAmt + $overdueAmt; @endphp
{{ $currency }}{{ number_format($collectedAmt, 0) }} @if($collectedAmt >= $totalAmt) ✓ Paid @endif
of {{ $currency }}{{ number_format($totalAmt, 0) }}
@if($outstandAmt > 0)
{{ $overdueAmt > 0 ? '⚠ ' : '' }}Due: {{ $currency }}{{ number_format($outstandAmt, 0) }}
@endif
@if($txn) {{ $txn->mode }} @else @endif @if($nextDue)
{{ $nextDue->status==='overdue' ? '⚠ Overdue' : '🕐 Due' }} {{ \Carbon\Carbon::parse($nextDue->due_date)->format('d M Y') }}
@endif
{{ $b->created_at->format('d M Y') }}
{{ $b->created_at->format('H:i') }}
@if($hasMs) @endif @if($b->booking_status !== 'cancelled')
@csrf @method('DELETE')
@endif
No instant bookings yet. Use the form above to create one.
@if($bookings->hasPages()) @endif
{{-- Fee config data for JS ── passed from controller --}} @include('Partials.footer') {{-- ── Mark Paid Modal ── --}}