@extends('layouts.app') @section('content')
{{ ucfirst(str_replace('_', ' ', $type)) }} Payments
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
@if ($columnsToShow['initiated']) @endif @if ($columnsToShow['approved']) @endif @if ($columnsToShow['rejected']) @endif @if ($columnsToShow['paid']) @endif @forelse ($payments as $index => $payment) @if ($columnsToShow['initiated']) @endif @if ($columnsToShow['approved']) @endif @if ($columnsToShow['rejected']) @endif @if ($columnsToShow['paid']) @endif @empty @endforelse
SN
Amount
Status
Payment Date
Initiated By
Approved By
Rejected By
Paid By
Actions
{{ $index + 1 }}
TSh {{ number_format($payment->amount, 2) }} @php $statusClass = 'status-pending'; $icon = 'fa-hourglass-start'; if(stripos($payment->status, 'approved') !== false) { $statusClass = 'status-approved'; $icon = 'fa-check-double'; } if(stripos($payment->status, 'rejected') !== false) { $statusClass = 'status-rejected'; $icon = 'fa-ban'; } if(stripos($payment->status, 'paid') !== false) { $statusClass = 'status-paid'; $icon = 'fa-trophy'; } @endphp {{ ucfirst($payment->status) }}
{{ $payment->payment_date->format('M d, Y') }} {{ $payment->payment_date->diffForHumans() }}
@if($payment->initiatedBy)
{{ $payment->initiatedBy->name }} {{ optional($payment->initiatedBy->roles->first())->name ?? 'User' }}
@else
Pending
@endif
@if($payment->approvedBy)
{{ $payment->approvedBy->name }} {{ optional($payment->approvedBy->roles->first())->name ?? 'User' }}
@else
Pending
@endif
@if($payment->rejectedBy)
{{ $payment->rejectedBy->name }} {{ optional($payment->rejectedBy->roles->first())->name ?? 'User' }}
@else
Pending
@endif
@if($payment->paidBy)
{{ $payment->paidBy->name }} {{ optional($payment->paidBy->roles->first())->name ?? 'User' }}
@else
Pending
@endif
No {{ $type }} payments found

No payments in this category at this time.

@endsection