@extends('layouts.platform') @section('title', 'Invoice '.$invoice->invoice_ref) @section('header', 'Invoice '.$invoice->invoice_ref) @section('content') @if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif

{{ $invoice->school->name }}

Subscription period: {{ $invoice->period_start->format('d M Y') }} → {{ $invoice->period_end->format('d M Y') }}

Plan: {{ $invoice->subscription?->plan?->name ?? '—' }} ({{ $invoice->subscription?->plan?->billing_period ?? '—' }})

@if ($invoice->isIssued())
@csrf
@else {{ ucfirst($invoice->status) }} @endif
@foreach ($invoice->line_items ?? [] as $item)
{{ $item['label'] ?? $item['type'] }} ₦{{ number_format((float) ($item['amount'] ?? 0), 2) }}
@endforeach
Total due ₦{{ number_format((float) $invoice->total, 2) }}

Pishon accounting snapshot

Base ₦{{ number_format((float) $invoice->base_amount, 2) }} · Service charge ₦{{ number_format((float) $invoice->service_charge, 2) }} · Estimated gateway processing fee ₦{{ number_format((float) $invoice->gateway_fee, 2) }}

@if ($invoice->transactions->isNotEmpty())

Payment transactions

@foreach ($invoice->transactions as $tx) @endforeach
Reference Provider Amount Status Ledger postings
{{ $tx->reference }} {{ $tx->provider }} ₦{{ number_format((float) $tx->amount, 2) }} {{ ucfirst($tx->status) }} {{ $tx->ledger_entries->count() }} entries
@endif
← Back to billing
@endsection