@hotelSettings Front Desk Dashboard - {{ hotelName() }} @php use Illuminate\Support\Facades\Storage; // ============ Define helper function for room images ============ if (!function_exists('getRoomImageUrl')) { function getRoomImageUrl($imagePath) { if (empty($imagePath)) { return null; } if (strpos($imagePath, 'http') === 0) { return $imagePath; } if (strpos($imagePath, 'storage/') === 0) { return asset($imagePath); } if (strpos($imagePath, '/') === 0) { return asset($imagePath); } if (file_exists(public_path('storage/' . $imagePath))) { return asset('storage/' . $imagePath); } return Storage::url($imagePath); } } @endphp

Front Desk Dashboard

Manage guest check-ins, check-outs, and room status

@php $totalCheckins = $reservations->where('status', 'checked_in')->count(); $totalCheckouts = $reservations->where('status', 'checked_out')->count(); $currentGuests = $reservations->where('status', 'checked_in')->count(); $today = \Carbon\Carbon::now()->startOfDay(); $checkedInReservations = $reservations->where('status', 'checked_in'); $overstayCount = $checkedInReservations->filter(function($reservation) use ($today) { $checkOutDate = \Carbon\Carbon::parse($reservation->check_out)->startOfDay(); return $today->greaterThan($checkOutDate); })->count(); @endphp
{{ $totalCheckins }}
Total Check-ins
{{ $totalCheckouts }}
Total Check-outs
{{ $currentGuests }}
Current Guests
{{ $overstayCount }}
Overstay Alerts
@php $overstayCount = 0; $today = \Carbon\Carbon::now()->startOfDay(); @endphp @foreach($reservations->where('status', '!=', 'checked_out') as $reservation) @php $room = $reservation->room; $roomImageUrl = null; if ($room) { if (isset($room->images) && !empty($room->images)) { $roomImages = is_string($room->images) ? json_decode($room->images, true) : $room->images; if (is_array($roomImages) && count($roomImages) > 0) { $roomImageUrl = getRoomImageUrl(reset($roomImages)); } } if (!$roomImageUrl && isset($room->image) && !empty($room->image)) { $roomImageUrl = getRoomImageUrl($room->image); } } $guest = $reservation->guest; $roomType = $room->roomType ?? null; $displayGuestName = $guest ? ($guest->first_name . ' ' . $guest->last_name) : 'Guest #' . $reservation->id; $isWalkIn = $reservation->is_walk_in ?? false; if ($isWalkIn) { $reservationNumber = $reservation->walk_in_number ?? 'WLK' . str_pad($reservation->id, 8, '0', STR_PAD_LEFT); } else { $reservationNumber = $reservation->reservation_number ?? 'RES' . str_pad($reservation->id, 8, '0', STR_PAD_LEFT); } // USE PRE-CALCULATED DATA FROM CONTROLLER $totalAmount = $reservation->calculated_total ?? 0; $paidAmount = $reservation->calculated_paid ?? 0; $balance = $reservation->calculated_balance ?? 0; $isFullyPaid = $reservation->calculated_is_fully_paid ?? false; $paymentHistory = $reservation->calculated_payment_history ?? []; $installmentCount = $reservation->calculated_installment_count ?? 0; $nights = $reservation->calculated_nights ?? 1; $roomPrice = $reservation->calculated_room_price ?? 0; $roomCharges = $reservation->calculated_room_charges ?? 0; $vatAmount = $reservation->calculated_vat_amount ?? 0; $subtotal = $reservation->calculated_subtotal ?? 0; $overstayDays = $reservation->calculated_overstay_days ?? 0; $overstayFees = $reservation->calculated_overstay_fees ?? 0; $totalWithOverstay = $reservation->calculated_total ?? ($subtotal + $overstayFees); $overstayBadgeType = 'overstay-normal'; $overstayMessage = 'On schedule'; if ($overstayDays > 2) { $overstayBadgeType = 'overstay-badge'; $overstayMessage = 'OVERSTAY: ' . $overstayDays . ' days'; $overstayCount++; } elseif ($overstayDays > 0) { $overstayBadgeType = 'overstay-warning'; $overstayMessage = 'Overstay: ' . $overstayDays . ' day' . ($overstayDays > 1 ? 's' : ''); $overstayCount++; } @endphp
@if($overstayDays > 0)
{{ $overstayMessage }}
@endif
@if($roomImageUrl) Room {{ $room->room_number ?? '' }} @else
Room {{ $room->room_number ?? '' }}
{{ $roomType->name ?? 'Deluxe Room' }}
@endif
{{ ucfirst($room->status ?? 'available') }} @if($isWalkIn) Walk-in @endif
Room {{ $room->room_number ?? 'N/A' }}
{{ $roomType->name ?? 'N/A' }}
{{ $room->category ?? 'N/A' }} {{ $currencySymbol ?? 'UGX' }} {{ number_format($room->price_per_night ?? 0, 0) }}/night
@php $guestInitial = $guest ? strtoupper(substr(trim($guest->first_name . ' ' . $guest->last_name), 0, 1)) : 'G'; @endphp {{ $guestInitial }}
{{ $displayGuestName }} @if($isWalkIn) Walk-in @endif @if($installmentCount > 1) {{ $installmentCount }} payments @endif
@if($reservation->status === 'confirmed') Expected Guest @elseif($reservation->status === 'checked_in') Current Guest @endif
{{ $reservation->check_in->format('M j, Y') }}
{{ $reservation->check_out->format('M j, Y') }}
{{ $guest->phone ?? 'N/A' }}
ID: {{ $reservationNumber }}
Status: {{ ucfirst($reservation->status) }}
Payment: {{ $isFullyPaid ? 'Paid' : 'Balance: ' . ($currencySymbol ?? 'UGX') . ' ' . number_format($balance, 0) }} @if($installmentCount > 0)
{{ $installmentCount }} payment{{ $installmentCount != 1 ? 's' : '' }} @endif
@if($overstayDays > 0)
Overstay: {{ $overstayDays }} days (+{{ $currencySymbol ?? 'UGX' }} {{ number_format($overstayFees, 0) }})
@endif
@endforeach @if($reservations->where('status', '!=', 'checked_out')->count() === 0)
No active reservations found

All rooms are currently available

@endif
@foreach($reservations->where('status', 'checked_in') as $reservation) @php $guest = $reservation->guest; $room = $reservation->room; $displayGuestName = $guest ? ($guest->first_name . ' ' . $guest->last_name) : 'Guest #' . $reservation->id; // USE PRE-CALCULATED DATA FROM CONTROLLER $paidAmount = $reservation->calculated_paid ?? 0; $balance = $reservation->calculated_balance ?? 0; $isFullyPaid = $reservation->calculated_is_fully_paid ?? false; $totalWithOverstay = $reservation->calculated_total ?? 0; $paymentHistory = $reservation->calculated_payment_history ?? []; $installmentCount = $reservation->calculated_installment_count ?? 0; $roomPrice = $reservation->calculated_room_price ?? 0; $nights = $reservation->calculated_nights ?? 0; $roomCharges = $reservation->calculated_room_charges ?? 0; $vatAmount = $reservation->calculated_vat_amount ?? 0; $subtotal = $reservation->calculated_subtotal ?? 0; $overstayDays = $reservation->calculated_overstay_days ?? 0; $overstayFees = $reservation->calculated_overstay_fees ?? 0; @endphp @endforeach @if($reservations->where('status', 'checked_in')->count() === 0) @endif
Guest Room Check-in Check-out Status Balance Receipt Actions
{{ strtoupper(substr($displayGuestName, 0, 1)) }}
{{ $displayGuestName }}
@if($reservation->is_walk_in)Walk-in@endif @if($overstayDays > 0)Overstay {{ $overstayDays }}d@endif
{{ $room->room_number ?? 'N/A' }} {{ $reservation->check_in->format('M j, Y') }} {{ $reservation->check_out->format('M j, Y') }} @if($overstayDays > 0)
+{{ $overstayDays }} days@endif
@if($overstayDays > 0) OVERSTAY @else {{ $balance <= 0 ? 'On schedule' : 'Balance due' }} @endif {{ $currencySymbol ?? 'UGX' }} {{ number_format($balance, 0) }} @if($installmentCount > 0)
{{ $installmentCount }} payment{{ $installmentCount != 1 ? 's' : '' }} @endif
@if($balance > 0) @endif @if($balance <= 0) @else @endif
No current guests found
Expected Check-ins
@php $today = \Carbon\Carbon::today(); $expectedCheckins = $reservations->filter(function($r) use ($today) { return $r->status === 'confirmed' && \Carbon\Carbon::parse($r->check_in)->isSameDay($today); }); @endphp @foreach($expectedCheckins as $reservation) @php $guest = $reservation->guest; $room = $reservation->room; // USE PRE-CALCULATED DATA FROM CONTROLLER $paid = $reservation->calculated_paid ?? 0; $balance = $reservation->calculated_balance ?? 0; $total = $reservation->calculated_total ?? 0; $nights = $reservation->calculated_nights ?? 1; $minHalfMet = $paid >= ($total / 2); @endphp @endforeach @if($expectedCheckins->count() === 0) @endif
Guest Name Room Time Payment Action
{{ $guest->first_name ?? '' }} {{ $guest->last_name ?? '' }} {{ $room->room_number ?? 'N/A' }} {{ $reservation->check_in->format('h:i A') }} @if($balance <= 0) Paid @elseif($minHalfMet) 50%+ Paid @else {{ $currencySymbol ?? 'UGX' }} {{ number_format($balance, 0) }} @endif @if($balance > 0) @endif @if($minHalfMet) @elseif($balance <= 0) @endif
No expected check-ins today
Expected Check-outs
@php $expectedCheckouts = $reservations->filter(function($r) use ($today) { return $r->status === 'checked_in' && \Carbon\Carbon::parse($r->check_out)->isSameDay($today); }); @endphp @foreach($expectedCheckouts as $reservation) @php $guest = $reservation->guest; $room = $reservation->room; // USE PRE-CALCULATED DATA FROM CONTROLLER $paid = $reservation->calculated_paid ?? 0; $balance = $reservation->calculated_balance ?? 0; $total = $reservation->calculated_total ?? 0; $nights = $reservation->calculated_nights ?? 1; @endphp @endforeach @if($expectedCheckouts->count() === 0) @endif
Guest Name Room Time Payment Action
{{ $guest->first_name ?? '' }} {{ $guest->last_name ?? '' }} {{ $room->room_number ?? 'N/A' }} {{ $reservation->check_out->format('h:i A') }} @if($balance <= 0) Paid @else {{ $currencySymbol ?? 'UGX' }} {{ number_format($balance, 0) }} @endif @if($balance > 0) @endif @if($balance <= 0) @else @endif
No expected check-outs today
Activity History
@forelse($historyRecords as $activity) @php $date = \Carbon\Carbon::parse($activity->created_at); @endphp
{{ $date->format('M j, Y h:i A') }}
@if($activity->type == 'checkin') Guest Checked In @elseif($activity->type == 'checkout') Guest Checked Out @elseif($activity->type == 'payment') Payment Received @elseif($activity->type == 'confirmation') Reservation Confirmed @elseif($activity->type == 'cancellation') Reservation Cancelled @else Activity: {{ ucfirst($activity->type) }} @endif

{{ $activity->guest_name }} - Room {{ $activity->room_number }}

@if(isset($activity->payment_method)) Method: {{ ucfirst($activity->payment_method) }} @endif @if($activity->notes)
{{ $activity->notes }} @endif
@if($activity->amount > 0)
{{ $currencySymbol ?? 'UGX' }} {{ number_format($activity->amount, 0) }}
@endif
@empty
No Activity History
@endforelse