@extends('layouts.app') @section('title', 'Correct Meter Reading') @section('content')

Correct Meter Reading

{{ $reading->client->name }} ({{ $reading->client->account_number }}) · Meter {{ $reading->client->meter_number ?? 'N/A' }}

@if ($errors->any())
@endif @if ($reading->status === 'approved')
This reading is already approved. @if ($activeBilling) Correcting it recalculates billing #{{ $activeBilling->billing_number }} (currently ₱{{ number_format($activeBilling->total_amount_due, 2) }}). @if ($requiresVoidCode) That bill has ₱{{ number_format($activeBilling->amount_paid, 2) }} collected against it, so it must be voided and reissued — the payments will be reversed and the company owner's 6-digit code is required. @else Nothing has been paid on it, so it keeps the same billing number. @endif @else No billing stands against it right now, so only the reading itself changes. @endif
@endif
@csrf @method('PUT')
cu.m
The last good reading for this client. The corrected value cannot be below it.
cu.m @error('reading_value')
{{ $message }}
@enderror
Recorded as {{ number_format($reading->reading_value, 2) }} cu.m ({{ number_format($reading->units_consumed ?? 0, 2) }} cu.m consumed).
{{-- Bounded so a correction cannot introduce the mistyped year it exists to fix; matches the check in update(). --}} @php $dateFloor = $reading->reading_date->year === now()->year - 1 ? now()->startOfYear()->subYear() : now()->startOfYear(); @endphp Between {{ $dateFloor->format('M d, Y') }} and now. @error('reading_date')
{{ $message }}
@enderror
@error('correction_reason')
{{ $message }}
@enderror
Recorded in the activity log against your account.
@error('notes')
{{ $message }}
@enderror
@if ($requiresVoidCode)
@error('void_code')
{{ $message }}
@enderror
Required because the bill has already taken money. Voiding reverses those payments.
@unless ($hasVoidAuthorizer)
No company owner has set an authorization code, so this billing cannot be voided. Ask the owner to set their void code in their profile first.
@endunless @endif
Cancel
@endsection