@extends('layouts.app') @section('title', 'Client Billing & Payment Details') @section('content') @php $cur = ($filters['currency'] ?? 'PHP') === 'PHP' ? '₱' : $filters['currency'] . ' '; $billStatusColor = [ 'paid' => 'success', 'partial' => 'info', 'sent' => 'primary', 'draft' => 'secondary', 'overdue' => 'danger', 'voided' => 'dark', 'cancelled' => 'dark', ]; $payStatusColor = [ 'completed' => 'success', 'voided' => 'dark', 'pending' => 'warning', ]; @endphp
Back to Reports

Client Billing & Payment Details

Every bill per account with its meter reading, and every payment received against it

@include('reports.partials.filter', ['route' => 'reports.client-details', 'showSearch' => true])
Billed

{{ $cur }}{{ number_format($totals['billed'], 2) }}

{{ number_format($totals['bills']) }} bills · {{ number_format($totals['accounts']) }} accounts
Collected

{{ $cur }}{{ number_format($totals['collected'], 2) }}

{{ number_format($totals['payments']) }} payments
Outstanding

{{ $cur }}{{ number_format($totals['balance'], 2) }}

still owed on these bills
Consumption

{{ number_format($totals['units'], 2) }}

cu.m billed in this range
Details by Account
{{ number_format($totals['accounts']) }} accounts, sorted by name
@forelse($paginated as $accountRows) @php $first = $accountRows->first(); $accountBilled = $accountRows->unique('billing_id') ->whereNotIn('billing_status', ['voided', 'cancelled'])->sum('total_due'); $accountPaid = $accountRows->where('payment_status', 'completed')->sum('payment_amount'); $accountBalance = $accountRows->unique('billing_id') ->whereNotIn('billing_status', ['voided', 'cancelled'])->sum('balance'); @endphp @foreach($accountRows as $row) @if($row['payment_id']) @else @endif @endforeach @empty @endforelse @if($rows->isNotEmpty()) @endif
Bill / Invoice # Bill Date Due Date Reading Date Previous Current Consumption Amount Due Late Fees Bill Status Payment Date Payment Method Reference # SI # / Date Received By Payment Status Balance
{{ $first['client_name'] }} · {{ $first['account_number'] }} Billed {{ $cur }}{{ number_format($accountBilled, 2) }} · Paid {{ $cur }}{{ number_format($accountPaid, 2) }} · Balance {{ $cur }}{{ number_format($accountBalance, 2) }}
{{ $row['billing_number'] }} {{ $row['billing_date']?->format('M d, Y') ?? '—' }} {{ $row['due_date']?->format('M d, Y') ?? '—' }} {{ $row['reading_date']?->format('M d, Y') ?? '—' }} {{ number_format($row['previous_reading'], 2) }} {{ number_format($row['current_reading'], 2) }} {{ number_format($row['units_consumed'], 2) }} {{ $cur }}{{ number_format($row['total_due'], 2) }} {{ $row['penalties'] > 0 ? $cur . number_format($row['penalties'], 2) : '—' }} {{ ucfirst($row['billing_status']) }} {{ $row['payment_date']?->format('M d, Y g:i A') ?? '—' }} {{ $cur }}{{ number_format($row['payment_amount'], 2) }} {{ ucfirst(str_replace('_', ' ', $row['payment_method'] ?? '—')) }} {{ $row['reference_number'] ?: '—' }} {{ $row['sales_invoice_number'] ?: '—' }} @if($row['sales_invoice_date'])
{{ $row['sales_invoice_date']->format('M d, Y') }} @endif
{{ $row['received_by'] ?: '—' }} {{ ucfirst($row['payment_status']) }} No payment recorded {{ $row['balance'] > 0 ? $cur . number_format($row['balance'], 2) : '—' }}
No bills in this period.
All Accounts {{ $cur }}{{ number_format($totals['billed'], 2) }} {{ $cur }}{{ number_format($totals['collected'], 2) }} {{ $cur }}{{ number_format($totals['balance'], 2) }}
@if($paginated->hasPages()) @endif

Bills are selected by bill date; a payment made outside the range still appears against its bill. Late fee and disconnection notice records are charges, not collections, so they are shown in the Late Fees column rather than as payments. Voided and cancelled bills, and voided payments, are listed for audit but excluded from the totals. Use Export CSV for the full unpaginated list, one line per payment.

@endsection