@extends('layouts.app') @section('title', 'Close Shift') @section('nav_shifts', 'bg-teal-50 text-teal-700 font-semibold') @section('page_title', 'Close Shift') @section('page_subtitle', 'Review your shift activity and hand over') @section('content') @if(session('info'))
{{ session('info') }}
@endif @php $paymentColors = [ 'Cash' => 'bg-green-50 text-green-700', 'GCash' => 'bg-blue-50 text-blue-700', 'Maya' => 'bg-purple-50 text-purple-700', 'Credit Card' => 'bg-amber-50 text-amber-700', 'Debit Card' => 'bg-orange-50 text-orange-700', 'Bank Transfer' => 'bg-teal-50 text-teal-700', 'Check' => 'bg-gray-50 text-gray-600', ]; @endphp {{-- Shift header --}}
{{ $shift->user->initials() }}

{{ $shift->user->name }}

{{ $shift->typeLabel() }} Shift · Started {{ $shift->started_at->format('g:i A') }}

Duration

{{ $shift->duration() }}

Date

{{ $shift->started_at->format('M j, Y') }}

{{-- Shift summary (left 3 cols) --}}
{{-- Check-in / Check-out --}}

Check-ins

{{ $summary['checkins']->count() }}

@if($summary['checkins']->isNotEmpty())
@foreach($summary['checkins'] as $log)

{{ $log->description }}

@endforeach
@endif

Check-outs

{{ $summary['checkouts']->count() }}

@if($summary['checkouts']->isNotEmpty())
@foreach($summary['checkouts'] as $log)

{{ $log->description }}

@endforeach
@endif
{{-- Payments collected --}}

Payments Collected

@if($summary['paymentsByMethod']->isEmpty() && $summary['posTotal'] == 0)

No payments during this shift.

@else
@foreach($summary['paymentsByMethod'] as $method => $amount)
{{ $method }} ₱{{ number_format($amount, 0) }}
@endforeach @if($summary['posTotal'] > 0)
POS Transactions ({{ $summary['posTxns']->count() }}) ₱{{ number_format($summary['posTotal'], 0) }}
@endif
Total Collected ₱{{ number_format($summary['payments']->sum('amount') + $summary['posTotal'], 0) }}
@endif
{{-- Other activity --}}

New Reservations

{{ $summary['newReservations'] }}

Rooms Cleaned

{{ $summary['roomsCleaned'] }}

Work Orders

{{ $summary['maintenance']->count() }}

{{-- Close shift form (right 2 cols) --}}
@csrf {{-- Cash reconciliation --}}

Cash Reconciliation

@if($shift->opening_cash !== null)
Opening float ₱{{ number_format($shift->opening_cash, 0) }}
@endif
Cash received (payments) ₱{{ number_format($summary['cashReceived'], 0) }}
@if($summary['posCash'] > 0)
Cash from POS ₱{{ number_format($summary['posCash'], 0) }}
@endif
Expected on hand ₱{{ number_format((float)($shift->opening_cash ?? 0) + $summary['totalCashIn'], 0) }}
{{-- Handover notes --}}
@endsection