158 lines
11 KiB
PHP
158 lines
11 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
{{ __('Payment Verification Dashboard') }}
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
|
|
@if (session('status'))
|
|
<div class="mb-4 rounded-md bg-green-50 p-4 dark:bg-green-900/30 border-l-4 border-green-400">
|
|
<p class="text-sm text-green-800 dark:text-green-200">{{ session('status') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
@if (session('error'))
|
|
<div class="mb-4 rounded-md bg-red-50 p-4 dark:bg-red-900/30 border-l-4 border-red-400">
|
|
<p class="text-sm text-red-800 dark:text-red-200">{{ session('error') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Tabs --}}
|
|
<div class="mb-4 border-b border-gray-200 dark:border-gray-700">
|
|
<nav class="-mb-px flex space-x-8">
|
|
<a href="{{ route('admin.payment-verifications.index', ['tab' => 'all']) }}"
|
|
class="border-b-2 py-4 px-1 text-sm font-medium {{ $tab === 'all' ? 'border-indigo-500 text-indigo-600 dark:text-indigo-400' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300' }}">
|
|
{{ __('All Payments') }}
|
|
</a>
|
|
|
|
@can('verify_payments_cashier')
|
|
<a href="{{ route('admin.payment-verifications.index', ['tab' => 'cashier']) }}"
|
|
class="border-b-2 py-4 px-1 text-sm font-medium {{ $tab === 'cashier' ? 'border-indigo-500 text-indigo-600 dark:text-indigo-400' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300' }}">
|
|
{{ __('Cashier Queue') }}
|
|
@if($counts['pending'] > 0)
|
|
<span class="ml-2 rounded-full bg-red-100 px-2 py-0.5 text-xs font-medium text-red-800 dark:bg-red-900 dark:text-red-200">
|
|
{{ $counts['pending'] }}
|
|
</span>
|
|
@endif
|
|
</a>
|
|
@endcan
|
|
|
|
@can('verify_payments_accountant')
|
|
<a href="{{ route('admin.payment-verifications.index', ['tab' => 'accountant']) }}"
|
|
class="border-b-2 py-4 px-1 text-sm font-medium {{ $tab === 'accountant' ? 'border-indigo-500 text-indigo-600 dark:text-indigo-400' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300' }}">
|
|
{{ __('Accountant Queue') }}
|
|
@if($counts['cashier_approved'] > 0)
|
|
<span class="ml-2 rounded-full bg-red-100 px-2 py-0.5 text-xs font-medium text-red-800 dark:bg-red-900 dark:text-red-200">
|
|
{{ $counts['cashier_approved'] }}
|
|
</span>
|
|
@endif
|
|
</a>
|
|
@endcan
|
|
|
|
@can('verify_payments_chair')
|
|
<a href="{{ route('admin.payment-verifications.index', ['tab' => 'chair']) }}"
|
|
class="border-b-2 py-4 px-1 text-sm font-medium {{ $tab === 'chair' ? 'border-indigo-500 text-indigo-600 dark:text-indigo-400' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300' }}">
|
|
{{ __('Chair Queue') }}
|
|
@if($counts['accountant_approved'] > 0)
|
|
<span class="ml-2 rounded-full bg-red-100 px-2 py-0.5 text-xs font-medium text-red-800 dark:bg-red-900 dark:text-red-200">
|
|
{{ $counts['accountant_approved'] }}
|
|
</span>
|
|
@endif
|
|
</a>
|
|
@endcan
|
|
|
|
<a href="{{ route('admin.payment-verifications.index', ['tab' => 'approved']) }}"
|
|
class="border-b-2 py-4 px-1 text-sm font-medium {{ $tab === 'approved' ? 'border-indigo-500 text-indigo-600 dark:text-indigo-400' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300' }}">
|
|
{{ __('Approved') }} ({{ $counts['approved'] }})
|
|
</a>
|
|
|
|
<a href="{{ route('admin.payment-verifications.index', ['tab' => 'rejected']) }}"
|
|
class="border-b-2 py-4 px-1 text-sm font-medium {{ $tab === 'rejected' ? 'border-indigo-500 text-indigo-600 dark:text-indigo-400' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300' }}">
|
|
{{ __('Rejected') }} ({{ $counts['rejected'] }})
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
|
|
{{-- Search --}}
|
|
<div class="mb-4">
|
|
<form method="GET" action="{{ route('admin.payment-verifications.index') }}" class="flex gap-2">
|
|
<input type="hidden" name="tab" value="{{ $tab }}">
|
|
<input type="text" name="search" value="{{ request('search') }}" placeholder="{{ __('Search by member name, email, or reference...') }}"
|
|
class="flex-1 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
<button type="submit" class="inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500">
|
|
{{ __('Search') }}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
{{-- Payment List --}}
|
|
<div class="bg-white shadow sm:rounded-lg dark:bg-gray-800">
|
|
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg dark:ring-gray-700">
|
|
<table class="min-w-full divide-y divide-gray-300 dark:divide-gray-600">
|
|
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
<tr>
|
|
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">{{ __('Member') }}</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">{{ __('Amount') }}</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">{{ __('Payment Date') }}</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">{{ __('Method') }}</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">{{ __('Status') }}</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">{{ __('Submitted') }}</th>
|
|
<th scope="col" class="relative py-3.5 pl-3 pr-4"><span class="sr-only">{{ __('Actions') }}</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 bg-white dark:divide-gray-700 dark:bg-gray-800">
|
|
@forelse($payments as $payment)
|
|
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm">
|
|
<div class="font-medium text-gray-900 dark:text-gray-100">{{ $payment->member->full_name }}</div>
|
|
<div class="text-gray-500 dark:text-gray-400">{{ $payment->member->email }}</div>
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-100">
|
|
TWD {{ number_format($payment->amount, 0) }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $payment->paid_at->format('Y-m-d') }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $payment->payment_method_label }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm">
|
|
<span class="inline-flex items-center rounded-full px-2 py-1 text-xs font-medium
|
|
@if($payment->status === 'pending') bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200
|
|
@elseif($payment->status === 'approved_chair') bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200
|
|
@elseif($payment->status === 'rejected') bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200
|
|
@else bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200
|
|
@endif">
|
|
{{ $payment->status_label }}
|
|
</span>
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 dark:text-gray-400">
|
|
{{ $payment->created_at->format('Y-m-d H:i') }}
|
|
</td>
|
|
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium">
|
|
<a href="{{ route('admin.payment-verifications.show', $payment) }}" class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300">
|
|
{{ __('View & Verify') }}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="7" class="px-3 py-8 text-center text-sm text-gray-500 dark:text-gray-400">
|
|
{{ __('No payments found') }}
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="px-4 py-3">
|
|
{{ $payments->links() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|