@extends('layouts.app') @section('title', 'Company Dashboard') @section('content')
Company Dashboard - {{ $company->name }} Welcome, {{ Auth::user()->name }}
{{-- No void can happen anywhere in the company until the owner sets a code --}} @if($ownerNeedsVoidCode ?? false)
Set your void authorization code

No billing in {{ $company->name }} can be voided until you set your 6-digit code. Company admins must ask you for it before they can void anything.

Set my void code
@endif
{{ $totalClients }}
Total Clients
{{ $totalBillings }}
Billings
₱{{ number_format($totalRevenue, 2) }}
Revenue
₱{{ number_format($totalCollected, 2) }}
Collected
₱{{ number_format($totalDue, 2) }}
Total Due
{{ $paidBillings }}
Paid Billings
{{ $unpaidBillings }}
Unpaid Billings
{{ $disconnectedClients }}
Disconnected
₱{{ number_format($completedPayments, 2) }}
Completed Payments
Overall Water Usage
Company Settings
@if($company->logo_path) Company Logo @else
@endif

{{ $company->name }}

{{ $company->email }}

{{ $company->phone }}

{{ $company->city }}, {{ $company->country }}

Currency: ₱ Philippine Peso

Edit Profile
Staff Management

Total Staff Members: {{ $staffCount }}

Add Staff Member View All Staff
Pricing Tiers
@if($tiers && $tiers->count() > 0)
@php $tierGroups = $company->tierGroups()->get(); @endphp @forelse($tierGroups as $tierGroup)
{{ $tierGroup->name }}
{{ $tierGroup->tiers->count() }} tiers • {{ $tierGroup->clients->count() }} clients
{{ $tierGroup->is_active ? 'Active' : 'Inactive' }}
@empty

No tier groups configured

@endforelse
@else

No pricing tiers configured yet. Create your first tier group

@endif
{{ $totalApplications }}
Total Applications
{{ $newApplications }}
New Applications
{{ $paymentPendingApplications }}
Payment Pending
{{ $installationPendingApplications }}
Installation Pending
Recent Applications
View All
@if($recentApplications && $recentApplications->count() > 0)
@foreach($recentApplications as $app) @endforeach
Applicant Name Email/Phone Status Applied Date Action
{{ $app->full_name }} {{ $app->email }}
{{ $app->phone }}
@switch($app->status) @case('submitted') Submitted @break @case('approved') Approved @break @case('payment_pending') Payment Pending @break @case('payment_completed') Paid @break @case('meter_assigned') Meter Assigned @break @case('installation_pending') Installation @break @case('active') Active @break @endswitch {{ $app->created_at->format('M d, Y') }}
@else

No applications yet. Start new application

@endif
Recent Clients
@if($recentClients->count() > 0)
@foreach($recentClients as $client) @endforeach
Name Account Meter # Location Status
{{ $client->name }} {{ $client->account_number }} {{ $client->meter_number ?? 'N/A' }} {{ $client->city }}, {{ $client->province }} {{ ucfirst($client->status) }}
@else

No clients yet.

@endif
Overdue Billings {{ $totalOverdueBillings }}
View All
@if($overdueBillings && $overdueBillings->count() > 0)
@foreach($overdueBillings as $billing) @endforeach
Client Account # Overdue Overdue Since Amount Due
{{ $billing->client->name }} {{ $billing->client->account_number }} {{ $billing->overdueForHumans() }} {{ $billing->overdueSince()?->format('M d, Y') ?? '—' }} ₱{{ number_format($billing->balance, 2) }}
@else

No overdue billings

@endif
Disconnection Eligible {{ $totalDisconnectionEligible }}
Manage
@if($disconnectionEligible && $disconnectionEligible->count() > 0)
@foreach($disconnectionEligible as $billing) @endforeach
Client Account # Disconnect Date Amount Due
{{ $billing->client->name }} {{ $billing->client->account_number }} {{ $billing->getEffectiveDisconnectionDate()?->format('M d, Y') ?? 'N/A' }} ₱{{ number_format($billing->balance, 2) }}
@else

No billings eligible for disconnection

@endif
Recent Late Fees Applied
@if($recentLateFees && $recentLateFees->count() > 0)
@foreach($recentLateFees as $payment) @endforeach
Client Amount Date Applied
{{ $payment->billing?->client->name ?? 'N/A' }} ₱{{ number_format($payment->amount, 2) }} {{ $payment->created_at->format('M d, Y H:i') }}
@else

No late fees applied

@endif
Disconnection Notices Sent
@if($disconnectionNotices && $disconnectionNotices->count() > 0)
@foreach($disconnectionNotices as $notice) @endforeach
Client Amount Notice Date
{{ $notice->billing?->client->name ?? 'N/A' }} ₱{{ number_format($notice->billing?->balance, 2) ?? '0.00' }} {{ $notice->created_at->format('M d, Y H:i') }}
@else

No disconnection notices sent

@endif
Activity Logs
@forelse($activityLogs as $log) @empty @endforelse
User Action Model Type Description Timestamp
@if($log->user) {{ $log->user->name }} @else System @endif @if($log->action === 'created') CREATE @elseif($log->action === 'updated') UPDATE @elseif($log->action === 'deleted') DELETE @else {{ strtoupper($log->action) }} @endif {{ $log->model_type }} {{ Str::limit($log->description, 50) }} {{ $log->created_at->diffForHumans() }}
No activity logs found
@if($activityLogs->hasPages()) @endif
{{-- Void ledger: voided bills had their payments reversed, so this is the one place the money that left the books is visible at a glance. --}} @can('void-billings')
Recent Voids @if(($voidedThisMonth ?? 0) > 0) {{ $voidedThisMonth }} this month ₱{{ number_format($voidedAmountThisMonth ?? 0, 2) }} reversed @endif
View all
@if(($recentVoids ?? collect())->count() > 0)
@foreach($recentVoids as $void) @endforeach
Billing # Client Amount Voided By Authorized By Reason
{{ $void->billing_number }} {{ $void->client->name ?? 'N/A' }} ₱{{ number_format($void->total_amount_due, 2) }} {{ $void->voided_at?->format('M d, Y g:i A') ?? '—' }} {{ $void->voidedByUser->name ?? '—' }} {{ $void->voidAuthorizedByUser->name ?? '—' }} {{ $void->void_reason ?? '—' }}
@else

No billings have been voided yet.

@endif
@endcan @endsection @section('styles') @endsection @section('scripts') @endsection