@extends('layouts.app') @section('title', 'Notifications') @section('no-page-header') @section('content')

Needs attention

Alerts disappear after renewal, payment or appointment completion. Refresh to update the list.

Refresh
All ({{ array_sum(array_column($groups, 'count')) }}) @foreach ($groups as $key => $group) {{ $group['label'] }} ({{ $group['count'] }}) @endforeach
Reset
@if (in_array($category, ['all', 'overdue']))

Invoices without a saved due date use 30 days from the invoice date.

@endif
@foreach (['Alert', 'Customer', 'Safebox / Reference', 'Date / Time', 'Details', 'Action'] as $heading) @endforeach @forelse ($alerts as $alert) @php $date = \Carbon\Carbon::parse($alert->alert_date)->startOfDay(); $days = (int) abs(today()->diffInDays($date)); @endphp @empty @endforelse
{{ $heading }}
{{ $groups[$alert->category]['label'] }}
{{ $alert->customer }}
ID {{ $alert->client_id }} · {{ $alert->phone }}
{{ $alert->safebox ?? '—' }}
{{ $alert->reference }}
{{ $date->format('d-m-Y') }}@if ($alert->appointment_time)
{{ \Carbon\Carbon::parse($alert->appointment_time)->format('g:i A') }}
@endif
@if ($alert->category === 'overdue')
RM {{ number_format($alert->amount, 2) }} outstanding
{{ $days }} days overdue
@elseif ($alert->category === 'expired') Expired {{ $days }} days ago @elseif ($alert->category === 'expiring') {{ $days === 0 ? 'Expires today' : 'Expires in ' . $days . ' days' }} @else Scheduled today @endif
@if (in_array($alert->category, ['expired', 'expiring'])) Renew @elseif ($alert->category === 'appointments') View Appointment @elseif (auth()->user()->can('access_customers') && $alert->registration_id) View / Pay Invoice @else View Invoice @endif
No outstanding alerts match this selection.
{{ $alerts->links() }}
@endsection