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>
235 lines
17 KiB
PHP
235 lines
17 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
收入管理
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8 space-y-4">
|
|
@if (session('status'))
|
|
<div class="rounded-md bg-green-50 dark:bg-green-900/30 p-4">
|
|
<p class="text-sm font-medium text-green-800 dark:text-green-200">{{ session('status') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
@if (session('error'))
|
|
<div class="rounded-md bg-red-50 dark:bg-red-900/30 p-4">
|
|
<p class="text-sm font-medium text-red-800 dark:text-red-200">{{ session('error') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Statistics Cards --}}
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">待確認收入</dt>
|
|
<dd class="mt-1 text-2xl font-semibold text-yellow-600 dark:text-yellow-400">
|
|
{{ $statistics['pending_count'] }} 筆
|
|
</dd>
|
|
<dd class="text-sm text-gray-500 dark:text-gray-400">
|
|
NT$ {{ number_format($statistics['pending_amount'], 2) }}
|
|
</dd>
|
|
</div>
|
|
</div>
|
|
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">已確認收入</dt>
|
|
<dd class="mt-1 text-2xl font-semibold text-green-600 dark:text-green-400">
|
|
{{ $statistics['confirmed_count'] }} 筆
|
|
</dd>
|
|
<dd class="text-sm text-gray-500 dark:text-gray-400">
|
|
NT$ {{ number_format($statistics['confirmed_amount'], 2) }}
|
|
</dd>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex justify-between items-center">
|
|
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">收入記錄列表</h3>
|
|
<div class="flex space-x-2">
|
|
<a href="{{ route('admin.incomes.statistics') }}" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
<svg class="mr-2 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
|
|
</svg>
|
|
統計報表
|
|
</a>
|
|
@can('record_income')
|
|
<a href="{{ route('admin.incomes.create') }}" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 dark:bg-indigo-500 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
|
<svg class="mr-2 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
|
|
</svg>
|
|
新增收入
|
|
</a>
|
|
@endcan
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Filters --}}
|
|
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<form method="GET" action="{{ route('admin.incomes.index') }}" class="grid grid-cols-1 gap-4 sm:grid-cols-5">
|
|
{{-- 狀態篩選 --}}
|
|
<div>
|
|
<label for="status" class="block text-sm font-medium text-gray-700 dark:text-gray-300">狀態</label>
|
|
<select name="status" id="status" class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-900 dark:text-gray-300">
|
|
<option value="">全部狀態</option>
|
|
<option value="pending" @selected(request('status') == 'pending')>待確認</option>
|
|
<option value="confirmed" @selected(request('status') == 'confirmed')>已確認</option>
|
|
<option value="cancelled" @selected(request('status') == 'cancelled')>已取消</option>
|
|
</select>
|
|
</div>
|
|
|
|
{{-- 收入類型篩選 --}}
|
|
<div>
|
|
<label for="income_type" class="block text-sm font-medium text-gray-700 dark:text-gray-300">收入類型</label>
|
|
<select name="income_type" id="income_type" class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-900 dark:text-gray-300">
|
|
<option value="">全部類型</option>
|
|
<option value="membership_fee" @selected(request('income_type') == 'membership_fee')>會費</option>
|
|
<option value="entrance_fee" @selected(request('income_type') == 'entrance_fee')>入會費</option>
|
|
<option value="donation" @selected(request('income_type') == 'donation')>捐款</option>
|
|
<option value="activity" @selected(request('income_type') == 'activity')>活動收入</option>
|
|
<option value="grant" @selected(request('income_type') == 'grant')>補助款</option>
|
|
<option value="interest" @selected(request('income_type') == 'interest')>利息收入</option>
|
|
<option value="other" @selected(request('income_type') == 'other')>其他</option>
|
|
</select>
|
|
</div>
|
|
|
|
{{-- 付款方式篩選 --}}
|
|
<div>
|
|
<label for="payment_method" class="block text-sm font-medium text-gray-700 dark:text-gray-300">付款方式</label>
|
|
<select name="payment_method" id="payment_method" class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-900 dark:text-gray-300">
|
|
<option value="">全部方式</option>
|
|
<option value="cash" @selected(request('payment_method') == 'cash')>現金</option>
|
|
<option value="bank_transfer" @selected(request('payment_method') == 'bank_transfer')>銀行轉帳</option>
|
|
<option value="check" @selected(request('payment_method') == 'check')>支票</option>
|
|
</select>
|
|
</div>
|
|
|
|
{{-- 日期範圍 --}}
|
|
<div>
|
|
<label for="date_from" class="block text-sm font-medium text-gray-700 dark:text-gray-300">起始日期</label>
|
|
<input type="date" name="date_from" id="date_from" value="{{ request('date_from') }}" class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-900 dark:text-gray-300">
|
|
</div>
|
|
|
|
{{-- 篩選按鈕 --}}
|
|
<div class="flex items-end space-x-2">
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
篩選
|
|
</button>
|
|
<a href="{{ route('admin.incomes.index') }}" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
重設
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Table --}}
|
|
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700" role="table">
|
|
<thead class="bg-gray-50 dark:bg-gray-700">
|
|
<tr>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
收入編號
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
標題
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
收入類型
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
金額
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
付款方式
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
狀態
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
日期
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
<span class="sr-only">操作</span>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 dark:divide-gray-700 bg-white dark:bg-gray-800">
|
|
@forelse ($incomes as $income)
|
|
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
<div class="font-mono text-xs">{{ $income->income_number }}</div>
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
<div class="font-medium">{{ $income->title }}</div>
|
|
@if ($income->member)
|
|
<div class="text-xs text-gray-500 dark:text-gray-400">
|
|
會員:{{ $income->member->full_name }}
|
|
</div>
|
|
@elseif ($income->payer_name)
|
|
<div class="text-xs text-gray-500 dark:text-gray-400">
|
|
付款人:{{ $income->payer_name }}
|
|
</div>
|
|
@endif
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $income->getIncomeTypeText() }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
<span class="font-semibold">NT$ {{ number_format($income->amount, 2) }}</span>
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $income->getPaymentMethodText() }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm">
|
|
@if ($income->isCancelled())
|
|
<span class="inline-flex rounded-full bg-red-100 dark:bg-red-900 px-2 text-xs font-semibold leading-5 text-red-800 dark:text-red-200">
|
|
{{ $income->getStatusText() }}
|
|
</span>
|
|
@elseif ($income->isConfirmed())
|
|
<span class="inline-flex rounded-full bg-green-100 dark:bg-green-900 px-2 text-xs font-semibold leading-5 text-green-800 dark:text-green-200">
|
|
{{ $income->getStatusText() }}
|
|
</span>
|
|
@else
|
|
<span class="inline-flex rounded-full bg-yellow-100 dark:bg-yellow-900 px-2 text-xs font-semibold leading-5 text-yellow-800 dark:text-yellow-200">
|
|
{{ $income->getStatusText() }}
|
|
</span>
|
|
@endif
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $income->income_date->format('Y-m-d') }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-right text-sm">
|
|
<a href="{{ route('admin.incomes.show', $income) }}" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300">
|
|
檢視
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="8" class="px-4 py-8 text-center text-sm text-gray-500 dark:text-gray-400">
|
|
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
</svg>
|
|
<p class="mt-2 text-sm font-semibold">尚無收入記錄</p>
|
|
<p class="mt-1 text-sm">點選「新增收入」開始建立。</p>
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="mt-4">
|
|
{{ $incomes->links() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|