@extends('layouts.app') @section('content') @if(in_array(auth()->user()->role->name, ['super_admin', 'company_admin', 'company_owner']))

Disconnection Management

Manage overdue accounts, disconnections, and reconnections

{{-- Without these a refused action redirected back in silence and the button looked broken. Raising a disconnection can legitimately be refused — an opposing job already open, a settled balance — and the office has to be told which. --}} @if(session('success')) @endif @if(session('error')) @endif @if(session('info')) @endif @if($errors->any()) @endif

Overdue Accounts

{{ $overdueCount ?? 0 }}

Pending Notices

{{ $pendingNoticesCount ?? 0 }}

Disconnected

{{ $disconnectedCount ?? 0 }}

Total Late Fees

₱{{ number_format($totalLateFees ?? 0, 2) }}

@forelse($overdueClients ?? [] as $billing) @empty @endforelse
Client Billing Amount Days Overdue Overdue Balance Account Total Due Late Fees Due Date Actions
{{ substr($billing->client->name ?? 'N/A', 0, 1) }}

{{ $billing->client->name ?? 'Unknown' }}

{{ $billing->client->account_number ?? 'N/A' }}

₱{{ number_format($billing->balance ?? 0, 2) }} @php $daysOverdue = $billing->getDaysOverdue() ?? 0; @endphp {{ $daysOverdue }} days ₱{{ number_format($billing->balance ?? 0, 2) }} @php $acct = ($accountTotals ?? collect())->get($billing->client_id); @endphp ₱{{ number_format($acct->total_due ?? 0, 2) }} {{ $acct->unpaid_count ?? 0 }} unpaid billing/s ₱{{ number_format($billing->penalties ?? 0, 2) }} {{ $billing->due_date ? $billing->due_date->format('M d, Y') : 'N/A' }} View @if(($billing->disconnection_status ?? 'none') === 'none')
@csrf
@endif {{-- Deliberately no Raise Disconnection here. A notice is served first; the account then appears under Pending Notices, which is where the disconnection is raised from. Keeping the two steps in that order is the office's policy, not an oversight. --}} Print Notice Thermal
No overdue billings found.
@if($overdueClients ?? null) @endif
@forelse($pendingNotices ?? [] as $billing) @empty @endforelse
Client Billing Amount Account Total Due Days Overdue Notice Date Actions
{{ substr($billing->client->name ?? 'N/A', 0, 1) }}

{{ $billing->client->name ?? 'Unknown' }}

{{ $billing->client->account_number ?? 'N/A' }}

₱{{ number_format($billing->balance ?? 0, 2) }} @php $acct = ($accountTotals ?? collect())->get($billing->client_id); @endphp ₱{{ number_format($acct->total_due ?? 0, 2) }} {{ $acct->unpaid_count ?? 0 }} unpaid billing/s {{ $billing->getDaysOverdue() ?? 0 }} days {{ $billing->updated_at ? $billing->updated_at->format('M d, Y') : 'N/A' }} Print Notice Thermal {{-- Raises a disconnection job order; the water does not go off until a field worker completes it and the office verifies it. --}}
@csrf
No pending notices.
@if($pendingNotices ?? null) @endif
@forelse($disconnectedBillings ?? [] as $billing) @empty @endforelse
Client Overdue Balance Account Total Due Days Overdue Disconnected Date Actions
{{ substr($billing->client->name ?? 'N/A', 0, 1) }}

{{ $billing->client->name ?? 'Unknown' }}

{{ $billing->client->account_number ?? 'N/A' }}

₱{{ number_format($billing->balance ?? 0, 2) }} @php $acct = ($accountTotals ?? collect())->get($billing->client_id); @endphp ₱{{ number_format($acct->total_due ?? 0, 2) }} {{ $acct->unpaid_count ?? 0 }} unpaid billing/s {{ $billing->getDaysOverdue() ?? 0 }} days {{ $billing->updated_at ? $billing->updated_at->format('M d, Y H:i') : 'N/A' }} View Details
No disconnected services.
@if($disconnectedBillings ?? null) @endif
@else

Access Denied

Only Super Admin and Company Admin users can access the Disconnection Management system.

Back to Dashboard
@endif @endsection