@extends('layouts.app') @section('title', $invoice->invoice_no) @php $statusBadge = [ 'pending' => 'bg-warning-transparent', 'partial' => 'bg-info-transparent', 'paid' => 'bg-success-transparent', 'overdue' => 'bg-danger-transparent', 'waived' => 'bg-secondary-transparent', 'cancelled' => 'bg-secondary-transparent', ]; $subBadge = [ 'active' => 'bg-success-transparent', 'grace' => 'bg-warning-transparent', 'restricted' => 'bg-danger-transparent', 'suspended' => 'bg-dark-transparent', 'cancelled' => 'bg-secondary-transparent', ]; $sub = $invoice->subscription; $outstanding = max(0, $invoice->total_amount - $invoice->paid_amount); @endphp @section('content')

{{ $invoice->invoice_no }} {{ ucfirst($invoice->status) }}

{{ optional($invoice->organization)->name }} • {{ optional($invoice->period_start)->format('d M') }} – {{ optional($invoice->period_end)->format('d M Y') }}

{{ _lang('Back') }}
@include('partials.alerts')
{{ _lang('Invoice') }}
{{ _lang('Plan') }}{{ $invoice->plan_name }} ({{ _lang('up to') }} {{ $invoice->max_members }})
{{ _lang('Peak members in cycle') }}{{ $invoice->peak_members }} @if($invoice->over_limit){{ _lang('Over limit') }}@endif
{{ _lang('Interval') }}{{ ucfirst($invoice->billing_interval) }}
{{ _lang('Base amount') }}৳{{ number_format($invoice->base_amount / 100) }}
{{ _lang('Discount') }}− ৳{{ number_format($invoice->discount_amount / 100) }}
{{ _lang('Waived') }}− ৳{{ number_format($invoice->waived_amount / 100) }}
{{ _lang('Total') }}৳{{ number_format($invoice->total_amount / 100) }}
{{ _lang('Paid') }}৳{{ number_format($invoice->paid_amount / 100) }}
{{ _lang('Outstanding') }}৳{{ number_format($outstanding / 100) }}
{{ _lang('Issued') }}{{ optional($invoice->issued_on)->format('d M Y') }}
{{ _lang('Due') }}{{ optional($invoice->due_on)->format('d M Y') }}
@if ($invoice->note)
{{ $invoice->note }}
@endif
{{ _lang('Payments') }}
@forelse ($invoice->payments as $p) @empty @endforelse
{{ _lang('Date') }}{{ _lang('Method') }}{{ _lang('Amount') }}{{ _lang('Status') }}{{ _lang('Trx') }}
{{ optional($p->created_at)->format('d M Y, h:i A') }} {{ ucfirst($p->method) }} ৳{{ number_format($p->amount / 100) }} {{ ucfirst($p->status) }} {{ $p->gateway_trx_id ?? '—' }}
{{ _lang('No payments yet.') }}
@unless ($invoice->isSettled())
{{ _lang('Record Payment') }}
@csrf
{{ _lang('Discount / Waiver') }}
@csrf
@csrf
@endunless @if ($sub)
{{ _lang('Subscription') }}
{{ ucfirst($sub->status) }}

{{ _lang('Interval') }}: {{ ucfirst($sub->billing_interval) }} • {{ _lang('Next invoice') }}: {{ optional($sub->current_period_end)->format('d M Y') }}

{{-- Standing discount for this business (auto-applies to future invoices) --}}
@csrf
@if ($sub->status === 'suspended')
@csrf
@else
@csrf
@endif
@csrf
@endif
@endsection