@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
Every bill per account with its meter reading, and every payment received against it
| 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']) }} | @if($row['payment_id']){{ $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']) }} | @elseNo payment recorded | @endif{{ $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) }} | |||||||||||||||||||||
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.