@if($isSuperAdmin)
@endif
@if($clients->count() > 0)
| Name |
@if($isSuperAdmin)
Company |
@endif
Account # |
Block # |
Lot # |
Meter # |
City |
Status |
Overdue |
Late Pay |
Actions |
@foreach($clients as $client)
@php
// Calculate overdue and late payment info
$overdueCount = $client->billings()
->where('status', '!=', 'paid')
->where('due_date', '<', now())
->where('balance', '>', 0)
->count();
$latePaymentCount = \App\Models\BillingCharge::where('client_id', $client->id)
->lateFees()->where('status', '!=', 'voided')->count();
@endphp
| {{ $client->name }} |
@if($isSuperAdmin)
{{ $client->company->name }} |
@endif
{{ $client->account_number }} |
{{ $client->block_number ?? 'N/A' }} |
{{ $client->lot_number ?? 'N/A' }} |
{{ $client->meter_number ?? 'N/A' }} |
{{ $client->city }} |
@if($client->status === 'active')
Active
@elseif($client->status === 'inactive')
Inactive
@else
Disconnected
@endif
|
@if($overdueCount > 0)
{{ $overdueCount }}
@else
None
@endif
|
@if($latePaymentCount > 0)
{{ $latePaymentCount }}
@else
None
@endif
|
@if(Auth::user()->hasCompanyAdminAccess() || Auth::user()->isSuperAdmin())
@endif
|
@endforeach
@else
@endif