@extends('layouts.app') @section('title', 'Folio & POS Reconciliation') @php use App\Http\Controllers\Hotel\PosReconciliationController as Recon; $exceptionCount = $summary['exceptions']->count(); $query = array_filter([ 'start_date' => $filters['start']->toDateString(), 'end_date' => $filters['end']->toDateString(), 'outlet_id' => $filters['outlet_id'], 'sale_type' => $filters['sale_type'], 'status' => $filters['status'], ]); @endphp @section('content') {{-- Filters --}}
@if ($exceptionCount > 0 && $filters['status'] !== 'exceptions')
{{ $exceptionCount }} {{ Str::plural('sale', $exceptionCount) }} in this period {{ $exceptionCount === 1 ? "doesn't reconcile and needs" : "don't reconcile and need" }} review. Show exceptions
@endif
{{-- Letterhead: what a printed / PDF copy carries --}}
{{ $company?->company_name }}
@if ($company?->company_address)
{!! nl2br(e($company->company_address)) !!}
@endif
POS & Folio Reconciliation
{{ $subtitle }}
@if ($company?->company_logo){{ $company->company_name }}@endif
@foreach ([ ['Total revenue', $summary['revenue'], $summary['count'] . ' ' . Str::plural('transaction', $summary['count']), 'bi-cash-stack', '#eef2ff', '#4f46e5'], ['Walk-in · GL posted', $summary['walk_in'], 'Settled at point of sale', 'bi-check2-circle', '#dcfce7', '#15803d'], ['Room charges · pending', $summary['pending'], 'Awaiting guest checkout', 'bi-hourglass-split', '#fef3c7', '#b45309'], ['Room charges · settled', $summary['settled'], 'Billed & posted at checkout', 'bi-door-closed', '#e0e7ff', '#4338ca'], ] as [$label, $amount, $hint, $icon, $bg, $fg])
{{ $label }} ₦{{ number_format($amount, 2) }} {{ $hint }}
@endforeach
@php $canReceipt = app(\App\Services\PermissionService::class)->canAccessModule('pos_terminal', \App\Http\Controllers\Hotel\PosTerminalController::FALLBACK_ROLES); $canCorrect = app(\App\Services\PermissionService::class)->can('edit', Recon::MODULE); @endphp @forelse ($sales as $sale) @php [$statusLabel, $statusClass] = Recon::STATUS_LABELS[$sale->settlement]; $itemsText = $sale->items->map(fn ($i) => rtrim(rtrim(number_format((float) $i->quantity, 2), '0'), '.') . '× ' . $i->item_name)->implode(', '); @endphp @empty @endforelse @if ($sales->isNotEmpty()) @endif
Sale Outlet Customer / Room Items Payment Settlement Amount
@if ($canReceipt)#{{ $sale->sale_id }} @else #{{ $sale->sale_id }} @endif
{{ $sale->created_at?->format('M d, H:i') }}
{{ $sale->outlet_name }}
{{ $sale->sale_type === 'room_charge' ? 'Room charge' : 'Walk-in' }}
@if ($sale->sale_type === 'room_charge')
Room {{ $sale->booking?->room?->room_number ?? '?' }}
{{ $sale->booking?->guest_name ?? 'Unknown guest' }}@if ($sale->booking_id) · #{{ $sale->booking_id }}@endif
@else {{ $sale->customer_name ?: 'Walk-in' }} @endif
{{ $itemsText ?: '—' }} {{ $sale->payment_method }} {{ $statusLabel }} @if ($sale->posted_entry_id)
JE #{{ $sale->posted_entry_id }}
@endif
₦{{ number_format((float) $sale->total_amount, 2) }} {{-- Walk-ins and room charges still on the folio can be corrected; a sale billed at check-out or voided can't. --}} @if ($canCorrect && in_array($sale->settlement, ['posted', 'unposted', 'pending'], true)) @endif
{{ $filters['status'] === 'exceptions' ? 'No exceptions — every sale in this period reconciles.' : 'No POS sales match these filters.' }}
Total ₦{{ number_format($summary['revenue'], 2) }}
@endsection