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:
@@ -64,7 +64,18 @@
|
||||
<h3 id="membership-info-heading" class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-100">
|
||||
{{ __('Membership Information') }}
|
||||
</h3>
|
||||
{!! $member->membership_status_badge !!}
|
||||
@php
|
||||
$statusClasses = match($member->membership_status) {
|
||||
'pending' => 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200',
|
||||
'active' => 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200',
|
||||
'expired' => 'bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200',
|
||||
'suspended' => 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200',
|
||||
default => 'bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200',
|
||||
};
|
||||
@endphp
|
||||
<span class="inline-flex rounded-full px-2 text-sm font-semibold leading-5 {{ $statusClasses }}">
|
||||
{{ $member->membership_status_label }}
|
||||
</span>
|
||||
</div>
|
||||
@if ($member->user?->profilePhotoUrl())
|
||||
<div class="mt-4">
|
||||
|
||||
@@ -9,6 +9,46 @@
|
||||
<div class="mx-auto max-w-2xl sm:px-6 lg:px-8">
|
||||
<div class="bg-white shadow sm:rounded-lg dark:bg-gray-800 px-4 py-5 sm:p-6">
|
||||
|
||||
{{-- Fee Summary --}}
|
||||
<div class="mb-6 bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg p-4">
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-4">會費明細</h3>
|
||||
|
||||
<div class="space-y-2">
|
||||
<div class="flex justify-between text-sm">
|
||||
<span class="text-gray-600 dark:text-gray-400">會費類型</span>
|
||||
<span class="font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ $feeDetails['fee_type'] === 'entrance_fee' ? '入會會費' : '常年會費' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex justify-between text-sm">
|
||||
<span class="text-gray-600 dark:text-gray-400">原始金額</span>
|
||||
<span class="text-gray-900 dark:text-gray-100">NT$ {{ number_format($feeDetails['base_amount']) }}</span>
|
||||
</div>
|
||||
@if($feeDetails['disability_discount'])
|
||||
<div class="flex justify-between text-sm text-green-600 dark:text-green-400">
|
||||
<span>身心障礙優惠</span>
|
||||
<span>-NT$ {{ number_format($feeDetails['discount_amount']) }}</span>
|
||||
</div>
|
||||
@endif
|
||||
<div class="border-t border-gray-200 dark:border-gray-600 pt-2 mt-2">
|
||||
<div class="flex justify-between text-base font-semibold">
|
||||
<span class="text-gray-900 dark:text-gray-100">應繳金額</span>
|
||||
<span class="text-indigo-600 dark:text-indigo-400">NT$ {{ number_format($feeDetails['final_amount']) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(!$feeDetails['disability_discount'] && !$member->hasApprovedDisability())
|
||||
<div class="mt-4 p-3 bg-yellow-50 dark:bg-yellow-900/30 rounded-md">
|
||||
<p class="text-sm text-yellow-800 dark:text-yellow-200">
|
||||
<strong>提示:</strong>若您持有身心障礙手冊,請先至
|
||||
<a href="{{ route('profile.edit') }}" class="underline">個人資料頁面</a>
|
||||
上傳手冊以享有 50% 優惠。
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Payment Instructions --}}
|
||||
<div class="mb-6 bg-blue-50 dark:bg-blue-900/30 border-l-4 border-blue-400 p-4">
|
||||
<div class="flex">
|
||||
@@ -18,11 +58,10 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-blue-800 dark:text-blue-200">{{ __('Payment Instructions') }}</h3>
|
||||
<h3 class="text-sm font-medium text-blue-800 dark:text-blue-200">繳費說明</h3>
|
||||
<div class="mt-2 text-sm text-blue-700 dark:text-blue-300">
|
||||
<p>{{ __('Annual membership fee: TWD 1,000') }}</p>
|
||||
<p class="mt-1">{{ __('Please upload your payment receipt (bank transfer, convenience store payment, etc.)') }}</p>
|
||||
<p class="mt-1">{{ __('Your payment will be reviewed by our staff. You will receive an email notification once approved.') }}</p>
|
||||
<p>請上傳您的繳費收據(銀行轉帳、超商繳費等)</p>
|
||||
<p class="mt-1">我們的工作人員將審核您的繳費紀錄,審核通過後會以 Email 通知您。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,10 +73,11 @@
|
||||
{{-- Amount --}}
|
||||
<div>
|
||||
<label for="amount" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{{ __('Payment Amount (TWD)') }} <span class="text-red-500">*</span>
|
||||
繳費金額 (TWD) <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input type="number" name="amount" id="amount" value="{{ old('amount', 1000) }}" required min="0" step="0.01"
|
||||
<input type="number" name="amount" id="amount" value="{{ old('amount', $feeDetails['final_amount']) }}" required min="{{ $feeDetails['final_amount'] }}" step="1"
|
||||
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 @error('amount') border-red-300 @enderror">
|
||||
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">最低繳費金額:NT$ {{ number_format($feeDetails['final_amount']) }}</p>
|
||||
@error('amount')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user