@extends('layouts.user_type.auth') @php $money = fn($v) => $currency . number_format((float) $v, 2); $short = function ($v) use ($currency) { $v = (float) $v; if ($v >= 10000000) return $currency . round($v / 10000000, 1) . 'Cr'; if ($v >= 100000) return $currency . round($v / 100000, 1) . 'L'; if ($v >= 1000) return $currency . round($v / 1000, 1) . 'k'; return $currency . round($v); }; $pmStatus = request('status'); $pmTabs = ['' => 'All', 'success' => 'Paid', 'pending' => 'Pending', 'failed' => 'Failed']; $pmTones = ['success' => 'z-badge--success', 'pending' => 'z-badge--warning', 'failed' => 'z-badge--danger']; $pmLabels = ['success' => 'Paid', 'pending' => 'Pending', 'failed' => 'Failed']; $pmIcons = ['Credit Card' => 'ri-bank-card-line', 'Debit Card' => 'ri-bank-card-2-line', 'UPI' => 'ri-qr-code-line', 'Cash Payment' => 'ri-money-rupee-circle-line']; $pmFiltered = request()->hasAny(['search', 'method', 'from', 'to', 'status']) && collect(request()->only(['search', 'method', 'from', 'to', 'status']))->filter()->isNotEmpty(); $chartMax = max(1, $months->max('amount')); $chartTotal = $months->sum('amount'); $trend = $kpi->last_month > 0 ? round(($kpi->this_month - $kpi->last_month) / $kpi->last_month * 100) : null; $canEdit = hasPermission('payments', 'insert'); @endphp @section('pageActions') Export CSV @if (hasPermission('subscriptionPackage', 'view')) Subscriptions @endif @endsection @section('payments')
| Invoice | Client | Plan | Method | Amount | Status | |
|---|---|---|---|---|---|---|
| {{ $p->invoice_number }} {{ $pDate->format('d M Y') }} |
{{ $cInit }}
{{ $cName }}
{{ $co->email ?? ($co->city ?? '—') }}
|
{{ $sp?->package->package_name ?? '—' }} | {{ $p->payment_method }} @if ($p->transaction_id){{ $p->transaction_id }}@endif | {{ $money($p->amount) }} | {{ $pmLabels[$p->payment_status] ?? ucfirst($p->payment_status) }} | |
|
{{ $pmFiltered ? 'No payments match' : 'No payments yet' }}
{{ $pmFiltered ? 'Try another status, method, date range or search.' : 'Payments are recorded when you add or renew a subscription.' }}
@if ($pmFiltered)
@endif
| ||||||
| {{ $totals->cnt }} {{ \Illuminate\Support\Str::plural('payment', $totals->cnt) }} {{ $pmFiltered ? 'matching the filters' : 'in total' }} | {{ $money($totals->total) }} | {{ $money($totals->collected) }} paid @if ($totals->pending > 0){{ $money($totals->pending) }} pending@endif | ||||