Add membership fee system with disability discount and fix document permissions
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>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
||||
製作付款單
|
||||
</h2>
|
||||
</x-slot>
|
||||
@@ -8,41 +8,41 @@
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-4xl sm:px-6 lg:px-8 space-y-4">
|
||||
@if (session('error'))
|
||||
<div class="rounded-md bg-red-50 p-4">
|
||||
<p class="text-sm font-medium text-red-800">{{ session('error') }}</p>
|
||||
<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
|
||||
|
||||
<!-- Finance Document Info -->
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 mb-4">財務申請單資訊</h3>
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-100 mb-4">報銷申請單資訊</h3>
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">申請標題</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $financeDocument->title }}</dd>
|
||||
<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">{{ $financeDocument->title }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">申請金額</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">NT$ {{ number_format($financeDocument->amount, 2) }}</dd>
|
||||
<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">NT$ {{ number_format($financeDocument->amount, 2) }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">申請類型</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $financeDocument->getRequestTypeText() }}</dd>
|
||||
<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">{{ $financeDocument->getRequestTypeText() }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">金額級別</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $financeDocument->getAmountTierText() }}</dd>
|
||||
<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">{{ $financeDocument->getAmountTierText() }}</dd>
|
||||
</div>
|
||||
@if($financeDocument->member)
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">關聯會員</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $financeDocument->member->full_name }}</dd>
|
||||
<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">{{ $financeDocument->member->full_name }}</dd>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">申請人</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $financeDocument->submittedBy->name }}</dd>
|
||||
<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">{{ $financeDocument->submittedBy->name }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -52,98 +52,98 @@
|
||||
<form method="POST" action="{{ route('admin.payment-orders.store', $financeDocument) }}" class="space-y-4">
|
||||
@csrf
|
||||
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 mb-4">付款單資訊</h3>
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-100 mb-4">付款單資訊</h3>
|
||||
|
||||
<div class="grid grid-cols-1 gap-6">
|
||||
<!-- Payee Name -->
|
||||
<div>
|
||||
<label for="payee_name" class="block text-sm font-medium text-gray-700">
|
||||
收款人姓名 <span class="text-red-500">*</span>
|
||||
<label for="payee_name" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
收款人姓名 <span class="text-red-500 dark:text-red-400">*</span>
|
||||
</label>
|
||||
<input type="text" name="payee_name" id="payee_name" required
|
||||
value="{{ old('payee_name', $financeDocument->member->full_name ?? '') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm @error('payee_name') border-red-300 @enderror">
|
||||
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300 @error('payee_name') border-red-300 dark:border-red-700 @enderror">
|
||||
@error('payee_name')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<!-- Payment Method -->
|
||||
<div>
|
||||
<label for="payment_method" class="block text-sm font-medium text-gray-700">
|
||||
付款方式 <span class="text-red-500">*</span>
|
||||
<label for="payment_method" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
付款方式 <span class="text-red-500 dark:text-red-400">*</span>
|
||||
</label>
|
||||
<select name="payment_method" id="payment_method" 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 @error('payment_method') border-red-300 @enderror">
|
||||
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300 @error('payment_method') border-red-300 dark:border-red-700 @enderror">
|
||||
<option value="">請選擇付款方式</option>
|
||||
<option value="bank_transfer" {{ old('payment_method') == 'bank_transfer' ? 'selected' : '' }}>銀行轉帳</option>
|
||||
<option value="check" {{ old('payment_method') == 'check' ? 'selected' : '' }}>支票</option>
|
||||
<option value="cash" {{ old('payment_method') == 'cash' ? 'selected' : '' }}>現金</option>
|
||||
</select>
|
||||
@error('payment_method')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<!-- Bank Information (shown when bank_transfer is selected) -->
|
||||
<div id="bank_info" class="space-y-4" style="display: none;">
|
||||
<div>
|
||||
<label for="payee_bank_name" class="block text-sm font-medium text-gray-700">
|
||||
<label for="payee_bank_name" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
銀行名稱
|
||||
</label>
|
||||
<input type="text" name="payee_bank_name" id="payee_bank_name"
|
||||
value="{{ old('payee_bank_name') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
|
||||
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="payee_bank_code" class="block text-sm font-medium text-gray-700">
|
||||
<label for="payee_bank_code" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
銀行代碼
|
||||
</label>
|
||||
<input type="text" name="payee_bank_code" id="payee_bank_code" maxlength="10"
|
||||
value="{{ old('payee_bank_code') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
|
||||
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="payee_account_number" class="block text-sm font-medium text-gray-700">
|
||||
<label for="payee_account_number" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
銀行帳號
|
||||
</label>
|
||||
<input type="text" name="payee_account_number" id="payee_account_number" maxlength="30"
|
||||
value="{{ old('payee_account_number') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
|
||||
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Payment Amount -->
|
||||
<div>
|
||||
<label for="payment_amount" class="block text-sm font-medium text-gray-700">
|
||||
付款金額 <span class="text-red-500">*</span>
|
||||
<label for="payment_amount" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
付款金額 <span class="text-red-500 dark:text-red-400">*</span>
|
||||
</label>
|
||||
<div class="relative mt-1 rounded-md shadow-sm">
|
||||
<div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3">
|
||||
<span class="text-gray-500 sm:text-sm">NT$</span>
|
||||
<span class="text-gray-500 dark:text-gray-400 sm:text-sm">NT$</span>
|
||||
</div>
|
||||
<input type="number" name="payment_amount" id="payment_amount" step="0.01" min="0" required
|
||||
value="{{ old('payment_amount', $financeDocument->amount) }}"
|
||||
class="block w-full rounded-md border-gray-300 pl-12 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm @error('payment_amount') border-red-300 @enderror">
|
||||
class="block w-full rounded-md border-gray-300 dark:border-gray-700 pl-12 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300 @error('payment_amount') border-red-300 dark:border-red-700 @enderror">
|
||||
</div>
|
||||
@error('payment_amount')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<!-- Notes -->
|
||||
<div>
|
||||
<label for="notes" class="block text-sm font-medium text-gray-700">
|
||||
<label for="notes" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
備註
|
||||
</label>
|
||||
<textarea name="notes" id="notes" rows="3"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">{{ old('notes') }}</textarea>
|
||||
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300">{{ old('notes') }}</textarea>
|
||||
@error('notes')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@@ -152,10 +152,10 @@
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div class="flex justify-end space-x-3">
|
||||
<a href="{{ route('admin.finance.show', $financeDocument) }}" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
<a href="{{ route('admin.finance.show', $financeDocument) }}" 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 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-600 focus:ring-offset-2 dark:focus:ring-offset-gray-800">
|
||||
取消
|
||||
</a>
|
||||
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
<button type="submit" 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 dark:focus:ring-indigo-600 focus:ring-offset-2 dark:focus:ring-offset-gray-800">
|
||||
製作付款單
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user