{{-- Page Header & Breadcrumbs --}}
Season Transaction Report
{{-- Quick KPI Metric Summary Cards --}} {{--
Total Amount (Filtered)

RM {{ number_format($totalAmount, 2) }}

Sum of all filtered records
Total Records

{{ number_format($totalCount) }}

Matching transactions
Approved Revenue

RM {{ number_format($approvedAmount, 2) }}

{{ $approvedCount }} paid / approved
Pending Approval

{{ $pendingCount }} (RM {{ number_format($pendingAmount, 2) }})

Requires admin verification
--}} {{-- Filters Card --}}
{{-- Start Date --}}
{{-- End Date --}}
{{-- Site Filter --}}
{{-- Status Filter --}}
{{-- Payment Method --}}
{{-- Search --}}
{{-- Action Buttons & Per Page Row --}}
{{-- Filter Button --}} {{-- Clear Button --}} {{-- Export Excel --}} {{-- Export PDF --}}
{{-- Total Amount & Per Page Select --}}
Total : RM {{ number_format($totalAmount, 2) }}
@if ($selectedDate !== null)
Rows:
@endif
{{-- Data Table Card: Daily Summary OR Day Details --}}
@if ($selectedDate === null) {{-- MODE 1: DAILY SUMMARY TABLE --}}
Daily Transaction Summary

Total amount and transaction count grouped by day. Click View Details to see individual records.

Showing all {{ $dailySummary->count() }} days
@foreach ($configuredRates as $rate) @endforeach @forelse ($dailySummary as $row) @php $carbonDate = \Carbon\Carbon::parse($row->trx_date); @endphp @foreach ($configuredRates as $rate) @php $rateData = $row->rate_breakdown[$rate->key] ?? ['amount' => 0, 'count' => 0]; @endphp @endforeach @empty @endforelse @if ($dailySummary->isNotEmpty()) @php $colTotals = []; foreach ($configuredRates as $rate) { $colTotals[$rate->key] = [ 'amount' => $dailySummary->sum(fn($row) => $row->rate_breakdown[$rate->key]['amount'] ?? 0), 'count' => $dailySummary->sum(fn($row) => $row->rate_breakdown[$rate->key]['count'] ?? 0), ]; } $othersTotalAmount = $dailySummary->sum(fn($row) => $row->others['amount'] ?? 0); $othersTotalCount = $dailySummary->sum(fn($row) => $row->others['count'] ?? 0); @endphp @foreach ($configuredRates as $rate) @endforeach @endif
Date @if ($sortDirection === 'asc') @else @endif
{{ $rate->label }} (RM/Count) Others (RM/Count) Total (RM/Count) Action
{{ $carbonDate->format('d/m/Y') }} {{ $carbonDate->format('l') }}
@if ($rateData['count'] > 0) {{ number_format($rateData['amount'], 2) }} ({{ $rateData['count'] }}) @else 0.00 (0) @endif @if (($row->others['count'] ?? 0) > 0) {{ number_format($row->others['amount'], 2) }} ({{ $row->others['count'] }}) @else 0.00 (0) @endif @if ($row->total_count > 0)
{{ number_format($row->total_amount, 2) }} {{ $row->total_count }}
@else 0.00 (0) @endif
@if ($row->total_count > 0) @else @endif

No season transaction records found matching this filter.

Overall Total: {{ number_format($colTotals[$rate->key]['amount'], 2) }} ({{ $colTotals[$rate->key]['count'] }}) {{ number_format($othersTotalAmount, 2) }} ({{ $othersTotalCount }})
RM {{ number_format($totalAmount, 2) }} {{ $totalCount }}
@else {{-- MODE 2: DAY DETAILED TRANSACTIONS TABLE --}}
Transactions on {{ \Carbon\Carbon::parse($selectedDate)->format('d/m/Y (l)') }}
Showing all transactions recorded on this day.
Day Total: RM {{ number_format($selectedDateTotal, 2) }} ({{ $selectedDateCount }} records)
@forelse ($transactions as $txn) @php $st = strtolower($txn->payment_status); $stBadge = match ($st) { 'approved', 'success', 'paid' => 'bg-success text-white', 'pending', 'pending_approval' => 'bg-warning text-dark', 'failed', 'rejected' => 'bg-danger text-white', default => 'bg-secondary text-white', }; @endphp @empty @endforelse @if ($transactions->isNotEmpty()) @endif
Invoice / Ref @if ($sortField === 'invoice_no') {{ $sortDirection === 'asc' ? '▲' : '▼' }} @endif
Parking Site @if ($sortField === 'site_id') {{ $sortDirection === 'asc' ? '▲' : '▼' }} @endif
Customer @if ($sortField === 'customer_name') {{ $sortDirection === 'asc' ? '▲' : '▼' }} @endif
Coverage Period (Billing Month) Method
Amount @if ($sortField === 'amount') {{ $sortDirection === 'asc' ? '▲' : '▼' }} @endif
Payment Time @if ($sortField === 'created_at') {{ $sortDirection === 'asc' ? '▲' : '▼' }} @endif
Status Action
{{ $txn->invoice_no ?: $txn->external_transaction_id }} @if ($txn->reference_no)
Ref: {{ $txn->reference_no }}
@endif
{{ $txn->site->site_name ?? 'Site #' . $txn->site_id }}
{{ $txn->customer_name }}
@if ($txn->period_start && $txn->period_end) @if ($txn->period_start->format('Y-m') === $txn->period_end->format('Y-m')) {{ $txn->period_start->format('F Y') }} @else {{ $txn->period_start->format('M Y') }} – {{ $txn->period_end->format('M Y') }} @endif
{{ $txn->period_start->format('d/m/Y') }} → {{ $txn->period_end->format('d/m/Y') }}
@elseif ($txn->billing_month) {{ \Carbon\Carbon::parse($txn->billing_month)->format('F Y') }} @else - @endif
{{ ucwords(str_replace('_', ' ', (string) $txn->payment_method)) }} RM {{ number_format($txn->amount, 2) }} {{ $txn->payment_date ? $txn->payment_date->format('H:i') : ($txn->submitted_at ? $txn->submitted_at->format('H:i') : optional($txn->created_at)?->format('H:i')) }} {{ ucwords(str_replace('_', ' ', $st)) }} Details

No transactions found for this date.

Total for {{ \Carbon\Carbon::parse($selectedDate)->format('d/m/Y') }}: RM {{ number_format($selectedDateTotal, 2) }}
@if ($transactions->hasPages())
{{ $transactions->links() }}
@endif @endif