@extends('client::layouts.layout') @section('content')
{{-- HEADER --}}

Payments & Billing

View payment requests from Urban Metric, pay outstanding invoices, and manage your billing history

{{-- OVERDUE ALERT --}} @if($overdueCount > 0)

{{ $overdueCount }} overdue payment{{ $overdueCount>1?'s':'' }} — immediate action required

Service providers may pause work until outstanding amounts are cleared.

@endif {{-- STAT CARDS --}}

Payment Requests

{{ number_format($statRequests['amount'],2) }}

{{ $statRequests['count'] }} pending

Outstanding Invoices

{{ number_format($statOutstanding['amount'],2) }}

{{ $statOutstanding['count'] }} unpaid

Retainer Balance

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

Next due {{ $statRetainer['next_due'] }}

Paid This Year

{{ number_format($statPaid['amount'],2) }}

{{ $statPaid['count'] }} transactions
{{-- SEGMENTED TABS --}}
{{-- ============ REQUESTS ============ --}}
Payment Requests from Admin
Urban Metric is requesting your authorisation to pay service providers on your behalf
@php $urgentCount = $requests->where('status','overdue')->count(); @endphp @if($urgentCount) {{ $urgentCount }} urgent @endif
@forelse($requests as $req)
{{ $req->payment_reference }} @if($req->status==='overdue') Overdue @else Pending @endif {{ ucfirst($req->payment_category) }}

{{ $req->description }}

Due {{ $req->due_date?->format('Y-m-d') }} @if($req->reminder_count > 0) Reminder sent {{ $req->reminder_count }}x @endif

{{ $req->formatted_amount }}

{{ $req->currency }}
@empty

No payment requests at the moment.

@endforelse
{{-- ============ OUTSTANDING ============ --}}
Outstanding Invoices
Invoices that are yet to be settled
{{ $statOutstanding['count'] }} unpaid
@forelse($outstanding as $inv)

{{ $inv->payment_reference }} @if($inv->status==='overdue') Overdue @else Pending @endif

{{ $inv->description }}

Issued: {{ $inv->issue_date?->format('Y-m-d') }} | Due: {{ $inv->due_date?->format('Y-m-d') }}

{{ $inv->formatted_amount }}

@empty

No outstanding invoices 🎉

@endforelse
{{-- ============ ALL INVOICES ============ --}}
All Invoices
Complete list of issued invoices
@forelse($invoices as $inv)

{{ $inv->payment_reference }} @if($inv->status==='paid') Paid @elseif($inv->status==='overdue') Overdue @else Pending @endif

{{ $inv->description }}

Issued: {{ $inv->issue_date?->format('Y-m-d') }} | Due: {{ $inv->due_date?->format('Y-m-d') }}

{{ $inv->formatted_amount }}

@if($inv->status==='paid') @else @endif
@empty

No invoices yet.

@endforelse
{{-- ============ HISTORY ============ --}}
Payment History
{{ $statPaid['count'] }} transactions — {{ number_format($statPaid['amount'],2) }} paid this year
@forelse($history as $h)

{{ $h->description }}

{{ $h->paid_date?->format('Y-m-d') }} | via {{ $h->payment_gateway ?? 'Manual' }} @if($h->transaction_id) | {{ $h->transaction_id }} @endif

{{ $h->formatted_amount }}

@empty

No payment history yet.

@endforelse
{{-- ============ RETAINER ============ --}}
Retainer Status

Current Balance

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

Next Due

{{ $statRetainer['next_due'] }}

Retainer Payments
@forelse($retainer as $r)

{{ $r->description }}

{{ $r->status==='paid' ? 'Paid: '.$r->paid_date?->format('Y-m-d') : 'Due: '.$r->due_date?->format('Y-m-d') }}

{{ $r->formatted_amount }}

@if($r->status!=='paid') @else @endif
@empty

No retainer payments yet.

@endforelse
@endsection @push('scripts') @endpush