@extends('temple.layouts.app') @section('title', 'Receipt Printing & Payments') @section('content')
{{-- Flash Notifications --}} @if(session('success'))
{{ session('success') }}
@endif {{-- Page Header --}}

Receipt Printing & Counter Payments

Print devotee pooja vouchers, update payment statuses, and manage counters

{{-- Stats Summary Row --}}
{{ $totalCount }} Total Receipts
{{ $paidCount }} Fully Paid
{{ $pendingCount }} Pending / Partial
₹{{ number_format($totalCollected, 2) }} Collected Amount
{{-- Filter Card / Search Form --}}
Reset
{{-- Receipts Printing & Payment Table Card --}}
@forelse ($receipts as $receipt) @php $pStatus = strtolower($receipt->payment_status ?? 'pending'); // Devotees: always a Collection $devotees = $receipt->devotees ?? collect(); if (! $devotees instanceof \Illuminate\Support\Collection) { $devotees = collect($devotees); } // Grand total from all devotee items (fallback when total_amount is empty) $grandTotal = 0; foreach ($devotees as $devoteeRow) { $rowItems = $devoteeRow->items ?? collect(); if (! $rowItems instanceof \Illuminate\Support\Collection) { $rowItems = collect($rowItems); } $grandTotal += $rowItems->sum(function ($rowItem) { return (float) ($rowItem->amount ?? 0); }); } @endphp @empty @endforelse
Receipt No Devotee & Star Receipt Date Total Amount Payment Status Method Actions
{{ $receipt->receipt_number ?: '#RC-' . str_pad($receipt->id, 6, '0', STR_PAD_LEFT) }} @forelse($devotees as $devotee)
{{ $devotee->devotee_name }} @if(!empty($devotee->nakshatram)) {{ $devotee->nakshatram }} @endif
@empty {{-- Old data fallback --}}
{{ $receipt->devotee_name ?: 'N/A' }} @if(!empty($receipt->nakshatram)) {{ $receipt->nakshatram }} @endif
@endforelse
{{-- Full date, e.g. 24 September 2026 (display_date is cast to Carbon in the model) --}} {{ $receipt->display_date?->format('d F Y') ?? 'N/A' }}
₹{{ number_format((float) ($receipt->total_amount ?: $grandTotal), 2) }} {{ $receipt->payment_status_label }} @if(!empty($receipt->payment_method)) 💳 {{ strtoupper($receipt->payment_method) }} @else — @endif

No Receipts Found

No receipt records matched your filter or search query. Try adjusting your search keywords.

Clear Search Filters
{{-- Pagination Footer --}} @if ($receipts instanceof \Illuminate\Pagination\AbstractPaginator && $receipts->hasPages())
Showing {{ $receipts->firstItem() }} to {{ $receipts->lastItem() }} of {{ $receipts->total() }} records
{{ $receipts->links() }}
@endif
@endsection