@extends('layouts.app') @section('title', 'Cashier Dashboard') @section('content')
Cashier Dashboard - {{ $company->name }} Welcome, {{ Auth::user()->name }}
{{ $totalClients }}
Total Clients
{{ $totalBillings }}
Billings
{{ $currencySymbol }}{{ number_format($totalCollected, 2) }}
Collected
{{ $currencySymbol }}{{ number_format($totalDue, 2) }}
Total Due
{{ $paidBillings }}
Paid Billings
{{ $unpaidBillings }}
Unpaid Billings
{{ $overdueBillings }}
Overdue
{{ $disconnectedClients }}
Disconnected
Quick Actions
Recent Payments
@if($recentPayments->count() > 0)
@foreach($recentPayments as $payment) @endforeach
Date Client Billing # Amount Method Status
{{ $payment->created_at ? \Carbon\Carbon::parse($payment->created_at)->format('M d, Y') : 'N/A' }} {{ $payment->billing?->client?->name ?? 'N/A' }} {{ $payment->billing->billing_number ?? 'N/A' }} {{ $currencySymbol }}{{ number_format($payment->amount, 2) }} {{ ucfirst(str_replace('_', ' ', $payment->payment_method)) }} {{ ucfirst($payment->status) }}
@else

No payments recorded yet.

@endif
Quick Summary
Collections Today: {{ $currencySymbol }}{{ number_format($todayCollections, 2) }}

Pending Billings: {{ $pendingBillings }}
Overdue Billings: {{ $overdueBillings }}

{{ $company->name }}

{{ $company->city ?? 'N/A' }}, {{ $company->country ?? 'N/A' }}

Currency: {{ $currencySymbol }}

Collection Methods
@php $paymentMethods = \App\Models\Payment::whereIn('billing_id', \App\Models\Billing::whereIn('client_id', $company->clients()->pluck('id'))->pluck('id') )->whereDate('created_at', today())->groupBy('payment_method')->selectRaw('payment_method, COUNT(*) as count')->get(); @endphp @if($paymentMethods->count() > 0)
@foreach($paymentMethods as $method)
{{ ucfirst(str_replace('_', ' ', $method->payment_method)) }} {{ $method->count }}
@endforeach
@else

No collections recorded today

@endif
Overdue Billings {{ $totalOverdueBillings }}
View All
@if($overdueBillingsList && $overdueBillingsList->count() > 0)
@foreach($overdueBillingsList 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') ?? '—' }} {{ $currencySymbol }}{{ number_format($billing->balance, 2) }}
@else

No overdue billings

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

No billings eligible for disconnection

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

No late fees applied

@endif
@endsection