Features: - Implement two fee types: entrance fee and annual fee (both NT$1,000) - Add 50% discount for disability certificate holders - Add disability certificate upload in member profile - Integrate disability verification into cashier approval workflow - Add membership fee settings in system admin Document permissions: - Fix hard-coded role logic in Document model - Use permission-based authorization instead of role checks Additional features: - Add announcements, general ledger, and trial balance modules - Add income management and accounting entries - Add comprehensive test suite with factories - Update UI translations to Traditional Chinese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
329 lines
23 KiB
PHP
329 lines
23 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->member->full_name }}
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-4xl sm:px-6 lg:px-8 space-y-6">
|
|
|
|
@if (session('status'))
|
|
<div class="rounded-md bg-green-50 p-4 dark:bg-green-900/30 border-l-4 border-green-400 dark:border-green-500">
|
|
<p class="text-sm text-green-800 dark:text-green-200">{{ session('status') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
@if (session('error'))
|
|
<div class="rounded-md bg-red-50 p-4 dark:bg-red-900/30 border-l-4 border-red-400 dark:border-red-500">
|
|
<p class="text-sm text-red-800 dark:text-red-200">{{ session('error') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Payment Details --}}
|
|
<div class="bg-white shadow sm:rounded-lg dark:bg-gray-800 px-4 py-5 sm:p-6">
|
|
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-4">付款詳情</h3>
|
|
|
|
<dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2">
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">會員</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $payment->member->full_name }}<br>
|
|
<span class="text-gray-500 dark:text-gray-400">{{ $payment->member->email }}</span>
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">狀態</dt>
|
|
<dd class="mt-1">
|
|
<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>
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">會費類型</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $payment->fee_type_label }}</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">繳納金額</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">TWD {{ number_format($payment->amount, 0) }}</dd>
|
|
</div>
|
|
|
|
@if($payment->base_amount)
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">原始金額</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">TWD {{ number_format($payment->base_amount, 0) }}</dd>
|
|
</div>
|
|
@endif
|
|
|
|
@if($payment->disability_discount)
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">身心障礙優惠</dt>
|
|
<dd class="mt-1 text-sm text-green-600 dark:text-green-400">-TWD {{ number_format($payment->discount_amount, 0) }}</dd>
|
|
</div>
|
|
@endif
|
|
|
|
@if($payment->final_amount)
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">應繳金額</dt>
|
|
<dd class="mt-1 text-sm font-semibold text-indigo-600 dark:text-indigo-400">TWD {{ number_format($payment->final_amount, 0) }}</dd>
|
|
</div>
|
|
@endif
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">付款日期</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $payment->paid_at->format('Y-m-d') }}</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">付款方式</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $payment->payment_method_label }}</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">參考編號</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $payment->reference ?? '—' }}</dd>
|
|
</div>
|
|
|
|
<div class="sm:col-span-2">
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">提交者</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $payment->submittedBy->name }} on {{ $payment->created_at->format('Y-m-d H:i') }}
|
|
</dd>
|
|
</div>
|
|
|
|
@if($payment->notes)
|
|
<div class="sm:col-span-2">
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">備註</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100 whitespace-pre-line">{{ $payment->notes }}</dd>
|
|
</div>
|
|
@endif
|
|
|
|
@if($payment->receipt_path)
|
|
<div class="sm:col-span-2">
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">付款收據</dt>
|
|
<dd class="mt-1">
|
|
<a href="{{ route('admin.payment-verifications.download-receipt', $payment) }}" target="_blank"
|
|
class="inline-flex items-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:bg-gray-700 dark:text-gray-100 dark:ring-gray-600 dark:hover:bg-gray-600">
|
|
<svg class="-ml-0.5 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
</svg>
|
|
下載收據
|
|
</a>
|
|
</dd>
|
|
</div>
|
|
@endif
|
|
</dl>
|
|
</div>
|
|
|
|
{{-- Verification History --}}
|
|
<div class="bg-white shadow sm:rounded-lg dark:bg-gray-800 px-4 py-5 sm:p-6">
|
|
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-4">驗證歷史</h3>
|
|
|
|
<div class="flow-root">
|
|
<ul role="list" class="-mb-8">
|
|
@if($payment->verifiedByCashier)
|
|
<li>
|
|
<div class="relative pb-8">
|
|
<div class="relative flex space-x-3">
|
|
<div><span class="h-8 w-8 rounded-full bg-green-500 flex items-center justify-center ring-8 ring-white dark:ring-gray-800">
|
|
<svg class="h-5 w-5 text-white" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" /></svg>
|
|
</span></div>
|
|
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
|
|
<div><p class="text-sm text-gray-500 dark:text-gray-400">出納已驗證: <span class="font-medium text-gray-900 dark:text-gray-100">{{ $payment->verifiedByCashier->name }}</span></p></div>
|
|
<div class="whitespace-nowrap text-right text-sm text-gray-500 dark:text-gray-400">{{ $payment->cashier_verified_at->format('Y-m-d H:i') }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
@endif
|
|
|
|
@if($payment->verifiedByAccountant)
|
|
<li>
|
|
<div class="relative pb-8">
|
|
<div class="relative flex space-x-3">
|
|
<div><span class="h-8 w-8 rounded-full bg-green-500 flex items-center justify-center ring-8 ring-white dark:ring-gray-800">
|
|
<svg class="h-5 w-5 text-white" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" /></svg>
|
|
</span></div>
|
|
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
|
|
<div><p class="text-sm text-gray-500 dark:text-gray-400">會計已驗證: <span class="font-medium text-gray-900 dark:text-gray-100">{{ $payment->verifiedByAccountant->name }}</span></p></div>
|
|
<div class="whitespace-nowrap text-right text-sm text-gray-500 dark:text-gray-400">{{ $payment->accountant_verified_at->format('Y-m-d H:i') }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
@endif
|
|
|
|
@if($payment->verifiedByChair)
|
|
<li>
|
|
<div class="relative pb-8">
|
|
<div class="relative flex space-x-3">
|
|
<div><span class="h-8 w-8 rounded-full bg-green-500 flex items-center justify-center ring-8 ring-white dark:ring-gray-800">
|
|
<svg class="h-5 w-5 text-white" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" /></svg>
|
|
</span></div>
|
|
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
|
|
<div><p class="text-sm text-gray-500 dark:text-gray-400">主席最終核准: <span class="font-medium text-gray-900 dark:text-gray-100">{{ $payment->verifiedByChair->name }}</span></p></div>
|
|
<div class="whitespace-nowrap text-right text-sm text-gray-500 dark:text-gray-400">{{ $payment->chair_verified_at->format('Y-m-d H:i') }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
@endif
|
|
|
|
@if($payment->rejectedBy)
|
|
<li>
|
|
<div class="relative pb-8">
|
|
<div class="relative flex space-x-3">
|
|
<div><span class="h-8 w-8 rounded-full bg-red-500 flex items-center justify-center ring-8 ring-white dark:ring-gray-800">
|
|
<svg class="h-5 w-5 text-white" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
|
|
</span></div>
|
|
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
|
|
<div>
|
|
<p class="text-sm text-gray-500 dark:text-gray-400">拒絕者: <span class="font-medium text-gray-900 dark:text-gray-100">{{ $payment->rejectedBy->name }}</span></p>
|
|
@if($payment->rejection_reason)
|
|
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $payment->rejection_reason }}</p>
|
|
@endif
|
|
</div>
|
|
<div class="whitespace-nowrap text-right text-sm text-gray-500 dark:text-gray-400">{{ $payment->rejected_at->format('Y-m-d H:i') }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
@endif
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Verification Actions --}}
|
|
@if(!$payment->isRejected() && !$payment->isFullyApproved())
|
|
<div class="bg-white shadow sm:rounded-lg dark:bg-gray-800 px-4 py-5 sm:p-6">
|
|
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-4">驗證操作</h3>
|
|
|
|
<div class="space-y-4">
|
|
@if($payment->canBeApprovedByCashier() && Auth::user()->can('verify_payments_cashier'))
|
|
<form method="POST" action="{{ route('admin.payment-verifications.approve-cashier', $payment) }}" class="border-l-4 border-green-400 pl-4">
|
|
@csrf
|
|
|
|
{{-- Disability Certificate Verification (if applicable) --}}
|
|
@if($payment->member->hasDisabilityCertificate() && $payment->member->isDisabilityPending())
|
|
<div class="mb-6 p-4 bg-yellow-50 dark:bg-yellow-900/30 rounded-lg">
|
|
<h4 class="text-sm font-semibold text-yellow-800 dark:text-yellow-200 mb-3">身心障礙手冊審核</h4>
|
|
<p class="text-sm text-yellow-700 dark:text-yellow-300 mb-3">此會員已上傳身心障礙手冊,請一併審核:</p>
|
|
|
|
<a href="{{ route('admin.members.disability-certificate', $payment->member) }}" target="_blank"
|
|
class="inline-flex items-center mb-4 text-sm text-indigo-600 dark:text-indigo-400 hover:underline">
|
|
<svg class="w-4 h-4 mr-1" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
|
</svg>
|
|
檢視身心障礙手冊
|
|
</a>
|
|
|
|
<div class="space-y-2">
|
|
<label class="flex items-center">
|
|
<input type="radio" name="disability_action" value="approve" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 dark:border-gray-600">
|
|
<span class="ml-2 text-sm text-gray-700 dark:text-gray-300">通過 - 確認為有效身心障礙手冊</span>
|
|
</label>
|
|
<label class="flex items-center">
|
|
<input type="radio" name="disability_action" value="reject" class="h-4 w-4 text-red-600 focus:ring-red-500 border-gray-300 dark:border-gray-600">
|
|
<span class="ml-2 text-sm text-gray-700 dark:text-gray-300">駁回</span>
|
|
</label>
|
|
</div>
|
|
|
|
<div id="disability_rejection_reason_container" class="mt-3 hidden">
|
|
<label for="disability_rejection_reason" class="block text-sm font-medium text-gray-700 dark:text-gray-300">駁回原因</label>
|
|
<input type="text" name="disability_rejection_reason" id="disability_rejection_reason"
|
|
class="mt-1 block w-full 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"
|
|
placeholder="請說明駁回原因">
|
|
</div>
|
|
|
|
<p class="mt-3 text-xs text-yellow-600 dark:text-yellow-400">* 通過後,會員未來繳費將自動享有 50% 優惠</p>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="mb-3">
|
|
<label for="cashier_notes" class="block text-sm font-medium text-gray-700 dark:text-gray-300">備註(選填)</label>
|
|
<textarea name="notes" id="cashier_notes" rows="2" class="mt-1 block w-full 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"></textarea>
|
|
</div>
|
|
<button type="submit" class="inline-flex justify-center rounded-md bg-green-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-green-500 dark:hover:bg-green-400">
|
|
出納核准
|
|
</button>
|
|
</form>
|
|
@endif
|
|
|
|
@if($payment->canBeApprovedByAccountant() && Auth::user()->can('verify_payments_accountant'))
|
|
<form method="POST" action="{{ route('admin.payment-verifications.approve-accountant', $payment) }}" class="border-l-4 border-green-400 pl-4">
|
|
@csrf
|
|
<div class="mb-3">
|
|
<label for="accountant_notes" class="block text-sm font-medium text-gray-700 dark:text-gray-300">備註(選填)</label>
|
|
<textarea name="notes" id="accountant_notes" rows="2" class="mt-1 block w-full 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"></textarea>
|
|
</div>
|
|
<button type="submit" class="inline-flex justify-center rounded-md bg-green-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-green-500 dark:hover:bg-green-400">
|
|
會計核准
|
|
</button>
|
|
</form>
|
|
@endif
|
|
|
|
@if($payment->canBeApprovedByChair() && Auth::user()->can('verify_payments_chair'))
|
|
<form method="POST" action="{{ route('admin.payment-verifications.approve-chair', $payment) }}" class="border-l-4 border-green-400 pl-4">
|
|
@csrf
|
|
<div class="mb-3">
|
|
<label for="chair_notes" class="block text-sm font-medium text-gray-700 dark:text-gray-300">備註(選填)</label>
|
|
<textarea name="notes" id="chair_notes" rows="2" class="mt-1 block w-full 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"></textarea>
|
|
</div>
|
|
<button type="submit" class="inline-flex justify-center rounded-md bg-green-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-green-500 dark:hover:bg-green-400">
|
|
主席最終核准
|
|
</button>
|
|
</form>
|
|
@endif
|
|
|
|
{{-- Reject Form --}}
|
|
<form method="POST" action="{{ route('admin.payment-verifications.reject', $payment) }}" class="border-l-4 border-red-400 pl-4" onsubmit="return confirm('您確定要拒絕此付款嗎?')">
|
|
@csrf
|
|
<div class="mb-3">
|
|
<label for="rejection_reason" class="block text-sm font-medium text-gray-700 dark:text-gray-300">拒絕原因 <span class="text-red-500">*</span></label>
|
|
<textarea name="rejection_reason" id="rejection_reason" rows="3" required class="mt-1 block w-full 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"></textarea>
|
|
</div>
|
|
<button type="submit" class="inline-flex justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500 dark:hover:bg-red-400">
|
|
拒絕付款
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Back Button --}}
|
|
<div>
|
|
<a href="{{ route('admin.payment-verifications.index') }}" class="inline-flex items-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:bg-gray-700 dark:text-gray-100 dark:ring-gray-600 dark:hover:bg-gray-600">
|
|
← 返回列表
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@push('scripts')
|
|
<script>
|
|
// Toggle disability rejection reason field
|
|
document.querySelectorAll('input[name="disability_action"]').forEach(function(radio) {
|
|
radio.addEventListener('change', function() {
|
|
const container = document.getElementById('disability_rejection_reason_container');
|
|
if (this.value === 'reject') {
|
|
container.classList.remove('hidden');
|
|
document.getElementById('disability_rejection_reason').required = true;
|
|
} else {
|
|
container.classList.add('hidden');
|
|
document.getElementById('disability_rejection_reason').required = false;
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
@endpush
|
|
</x-app-layout> |