{{-- resources/views/invoices/index.blade.php --}} @extends('layouts.app') @section('content')

Invoices

Create Invoice
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Summary Cards --}}

Total Invoices

{{ $invoices->total() }}

Paid

{{ $invoices->where('payment_status', 'paid')->count() }}

Pending

{{ $invoices->where('payment_status', 'pending')->count() }}

Total Amount

৳{{ number_format($invoices->sum('total_payable'), 2) }}

{{-- Filters --}}
Clear
{{-- Invoices Table --}}
@foreach($invoices as $invoice) @endforeach
Invoice # Subscriber Package Type Total Paid Due Status Date Actions
{{ $invoice->invoice_number }}
{{ substr($invoice->subscriber->name, 0, 1) }}

{{ $invoice->subscriber->name }}

{{ $invoice->subscriber->email }}

{{ $invoice->subscription->package->name ?? 'N/A' }} {{ ucfirst($invoice->invoice_type) }} ৳{{ number_format($invoice->total_payable, 2) }} ৳{{ number_format($invoice->total_paid, 2) }} ৳{{ number_format($invoice->due_amount, 2) }} {{ str_replace('_', ' ', ucfirst($invoice->payment_status)) }} {{ $invoice->created_at->format('d M Y') }} @if($invoice->payment_status == 'pending') @endif @if(in_array($invoice->payment_status, ['paid', 'partially_paid'])) @endif @if($invoice->payments->count() == 0 && $invoice->refunds->count() == 0)
@csrf @method('DELETE')
@endif
{{ $invoices->withQueryString()->links() }}
@endsection