@extends('layouts.app') @section('title', 'Billing Details - ' . $billing->billing_number) @section('content')
Billing Date: {{ $billing->billing_date->format('M d, Y') }} | Due Date: {{ $billing->due_date->format('M d, Y') }}
{{ $billing->client->name }}
Account: {{ $billing->client->account_number }}
Meter: {{ $billing->client->meter_number ?? 'N/A' }}
{{ $billing->client->address ?? '' }}
Status:
{{ ucfirst(str_replace('_', ' ', $billing->status)) }}
Amount Due: ₱{{ number_format($billing->total_amount_due, 2) }}
Amount Paid: ₱{{ number_format($billing->amount_paid, 2) }}
Balance:
@if ($billing->balance > 0)
₱{{ number_format($billing->balance, 2) }}
@else
₱0.00
@endif
Due Date: {{ $billing->due_date->format('M d, Y') }}
@if($billing->disconnection_date)
Disconnection Date: {{ $billing->disconnection_date->format('M d, Y') }}
@endif
Carried over from the old system — no meter reading is attached to this billing.
@else
Previous Reading: {{ number_format($billing->previous_reading, 2) }} cu.m
Current Reading: {{ number_format($billing->current_reading, 2) }} cu.m
Units Consumed: {{ number_format($billing->units_consumed, 2) }} cu.m
| Subtotal | ₱{{ number_format($billing->subtotal, 2) }} |
| Tax | ₱{{ number_format($billing->tax, 2) }} |
| Other Charges | ₱{{ number_format($billing->other_charges, 2) }} |
| Penalties | ₱{{ number_format($billing->penalties, 2) }} |
| Less: Amount Paid on This Billing | - ₱{{ number_format($billing->amount_paid, 2) }} |
| Add: Previous Balance {{ $statement['previousLines']->count() }} earlier unpaid billing/s | ₱{{ number_format($statement['previousBalance'], 2) }} |
| Total Amount Due @if ($statement['previousBalance'] > 0) this reading + previous balance @endif | ₱{{ number_format($statement['totalOutstanding'], 2) }} |
| Billing No. | Period | Due Date | Amount Due | Paid | Penalties | Balance | Status |
|---|---|---|---|---|---|---|---|
| {{ $line['billing_number'] }} | {{ $line['billing_period'] }} | {{ $line['due_date'] }} @if ($line['is_overdue']) {{ $line['days_overdue'] }} day(s) overdue @endif | ₱{{ number_format($line['total_amount_due'], 2) }} | ₱{{ number_format($line['amount_paid'], 2) }} | ₱{{ number_format($line['penalties'], 2) }} | ₱{{ number_format($line['balance'], 2) }} | {{ ucfirst(str_replace('_', ' ', $line['status'])) }} |
| PREVIOUS BALANCE ({{ $statement['previousLines']->count() }} unpaid billing/s) | ₱{{ number_format($statement['previousBalance'], 2) }} | ||||||
| + THIS BILLING ({{ $billing->billing_number }}) | ₱{{ number_format($statement['currentBalance'], 2) }} | ||||||
| TOTAL AMOUNT DUE | ₱{{ number_format($statement['totalOutstanding'], 2) }} | ||||||
| Reference # | Billing No. | Amount | Method | Date |
|---|---|---|---|---|
| {{ $statementPayment->reference_number }} | {{ $statementPayment->billing?->billing_number ?? '—' }} | ₱{{ number_format($statementPayment->amount, 2) }} | {{ ucfirst(str_replace('_', ' ', $statementPayment->payment_method)) }} | {{ $statementPayment->payment_date?->format('M d, Y') ?? '—' }} |
| TOTAL RECEIVED | ₱{{ number_format($statement['payments']->sum('amount'), 2) }} | |||
| Reference # | Type | Amount | Date Added | Status |
|---|---|---|---|---|
| {{ $charge->reference_number }} | {{ ucfirst(str_replace('_', ' ', $charge->type)) }} | ₱{{ number_format($charge->amount, 2) }} | {{ ($charge->charged_at ?? $charge->created_at)->format('M d, Y') }} | {{ ucfirst($charge->status) }} |
| Reference # | Amount | Method | Date | Status |
|---|---|---|---|---|
| {{ $payment->reference_number }} | ₱{{ number_format($payment->amount, 2) }} | {{ ucfirst(str_replace('_', ' ', $payment->payment_method)) }} | {{ $payment->payment_date->format('M d, Y') }} | {{ ucfirst($payment->status) }} |