Files
Gbanyan 642b879dd4 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>
2025-12-01 09:56:01 +08:00

560 lines
39 KiB
PHP

<x-app-layout>
<x-slot name="header">
<div class="flex items-center justify-between">
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
報銷申請單詳情
</h2>
<a href="{{ route('admin.finance.index') }}" class="text-sm text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300">
&larr; 返回列表
</a>
</div>
</x-slot>
<div class="py-12">
<div class="mx-auto max-w-4xl sm:px-6 lg:px-8 space-y-6">
{{-- Status Message --}}
@if (session('status'))
<div class="rounded-md bg-green-50 dark:bg-green-900/30 p-4" role="status" aria-live="polite">
<p class="text-sm font-medium text-green-800 dark:text-green-200">
{{ session('status') }}
</p>
</div>
@endif
{{-- Workflow Stage Overview --}}
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-100">
工作流程階段
</h3>
<span class="inline-flex rounded-full px-3 py-1 text-sm font-semibold
@if ($document->isRejected())
bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200
@elseif ($document->isRecordingComplete())
bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200
@else
bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200
@endif
">
{{ $document->workflow_stage_label }}
</span>
</div>
{{-- Stage Progress Bar --}}
<div class="flex items-center space-x-2">
{{-- 審核階段 --}}
<div class="flex-1 text-center">
<div class="h-2 rounded-full {{ $document->isApprovalComplete() || $document->isRejected() ? 'bg-green-500' : 'bg-gray-200 dark:bg-gray-700' }}"></div>
<span class="text-xs text-gray-500 dark:text-gray-400 mt-1">審核</span>
</div>
<div class="w-4 text-gray-400"></div>
{{-- 出帳階段 --}}
<div class="flex-1 text-center">
<div class="h-2 rounded-full {{ $document->isDisbursementComplete() ? 'bg-green-500' : ($document->isApprovalComplete() && !$document->isRejected() ? 'bg-yellow-500' : 'bg-gray-200 dark:bg-gray-700') }}"></div>
<span class="text-xs text-gray-500 dark:text-gray-400 mt-1">出帳</span>
</div>
<div class="w-4 text-gray-400"></div>
{{-- 入帳階段 --}}
<div class="flex-1 text-center">
<div class="h-2 rounded-full {{ $document->isRecordingComplete() ? 'bg-green-500' : ($document->isDisbursementComplete() ? 'bg-yellow-500' : 'bg-gray-200 dark:bg-gray-700') }}"></div>
<span class="text-xs text-gray-500 dark:text-gray-400 mt-1">入帳</span>
</div>
</div>
</div>
</div>
{{-- Document Details --}}
<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 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">{{ $document->title }}</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">審核狀態</dt>
<dd class="mt-1">
@if ($document->isRejected())
<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">
{{ $document->status_label }}
</span>
@elseif ($document->isApprovalComplete())
<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">
{{ $document->status_label }}
</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">
{{ $document->status_label }}
</span>
@endif
</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">
NT$ {{ number_format($document->amount, 2) }}
<span class="text-xs text-gray-500 dark:text-gray-400 ml-1">({{ $document->getAmountTierText() }})</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">
{{ $document->submittedBy?->name ?? '不適用' }}
</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">
{{ $document->submitted_at?->format('Y-m-d H:i:s') ?? '不適用' }}
</dd>
</div>
@if ($document->member)
<div>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">關聯會員</dt>
<dd class="mt-1 text-sm">
<a href="{{ route('admin.members.show', $document->member) }}" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300">
{{ $document->member->full_name }}
</a>
</dd>
</div>
@endif
@if ($document->attachment_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 text-sm">
<a href="{{ route('admin.finance.download', $document) }}" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 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="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
@if ($document->description)
<div class="sm:col-span-2">
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">描述</dt>
<dd class="mt-1 whitespace-pre-line text-sm text-gray-900 dark:text-gray-100">{{ $document->description }}</dd>
</div>
@endif
</dl>
</div>
</div>
{{-- Approval Timeline (新工作流程) --}}
<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 dark:text-gray-100 mb-4">
審核時程
</h3>
<div class="flow-root">
<ul role="list" class="-mb-8">
{{-- 秘書長審核 (第一階段) --}}
<li>
<div class="relative pb-8">
<span class="absolute left-4 top-4 -ml-px h-full w-0.5 bg-gray-200 dark:bg-gray-700" aria-hidden="true"></span>
<div class="relative flex space-x-3">
<div>
@if ($document->secretary_approved_at)
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-green-500 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>
@elseif ($document->status === 'pending')
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-yellow-500 ring-8 ring-white dark:ring-gray-800">
<span class="h-2.5 w-2.5 rounded-full bg-white"></span>
</span>
@else
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-gray-400 dark:bg-gray-600 ring-8 ring-white dark:ring-gray-800">
<span class="h-2.5 w-2.5 rounded-full bg-white"></span>
</span>
@endif
</div>
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
<div>
<p class="text-sm text-gray-900 dark:text-gray-100">
秘書長核准
@if ($document->secretary_approved_at)
<span class="font-medium">{{ $document->approvedBySecretary?->name }}</span>
@endif
</p>
</div>
<div class="whitespace-nowrap text-right text-sm text-gray-500 dark:text-gray-400">
@if ($document->secretary_approved_at)
{{ $document->secretary_approved_at->format('Y-m-d H:i') }}
@else
待處理
@endif
</div>
</div>
</div>
</div>
</li>
{{-- 理事長審核 (第二階段:中額以上) --}}
@if (in_array($document->amount_tier, ['medium', 'large']))
<li>
<div class="relative pb-8">
<span class="absolute left-4 top-4 -ml-px h-full w-0.5 bg-gray-200 dark:bg-gray-700" aria-hidden="true"></span>
<div class="relative flex space-x-3">
<div>
@if ($document->chair_approved_at)
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-green-500 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>
@elseif ($document->status === 'approved_secretary')
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-yellow-500 ring-8 ring-white dark:ring-gray-800">
<span class="h-2.5 w-2.5 rounded-full bg-white"></span>
</span>
@else
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-gray-400 dark:bg-gray-600 ring-8 ring-white dark:ring-gray-800">
<span class="h-2.5 w-2.5 rounded-full bg-white"></span>
</span>
@endif
</div>
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
<div>
<p class="text-sm text-gray-900 dark:text-gray-100">
理事長核准
@if ($document->chair_approved_at)
<span class="font-medium">{{ $document->approvedByChair?->name }}</span>
@endif
</p>
</div>
<div class="whitespace-nowrap text-right text-sm text-gray-500 dark:text-gray-400">
@if ($document->chair_approved_at)
{{ $document->chair_approved_at->format('Y-m-d H:i') }}
@else
待處理
@endif
</div>
</div>
</div>
</div>
</li>
@endif
{{-- 董理事會審核 (第三階段:大額) --}}
@if ($document->amount_tier === 'large')
<li>
<div class="relative pb-8">
<div class="relative flex space-x-3">
<div>
@if ($document->board_meeting_approved_at)
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-green-500 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>
@elseif ($document->status === 'approved_chair')
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-yellow-500 ring-8 ring-white dark:ring-gray-800">
<span class="h-2.5 w-2.5 rounded-full bg-white"></span>
</span>
@else
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-gray-400 dark:bg-gray-600 ring-8 ring-white dark:ring-gray-800">
<span class="h-2.5 w-2.5 rounded-full bg-white"></span>
</span>
@endif
</div>
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
<div>
<p class="text-sm text-gray-900 dark:text-gray-100">
董理事會核准
@if ($document->board_meeting_approved_at)
<span class="font-medium">{{ $document->approvedByBoardMeeting?->title ?? '理事會決議' }}</span>
@endif
</p>
</div>
<div class="whitespace-nowrap text-right text-sm text-gray-500 dark:text-gray-400">
@if ($document->board_meeting_approved_at)
{{ $document->board_meeting_approved_at->format('Y-m-d H:i') }}
@else
待處理
@endif
</div>
</div>
</div>
</div>
</li>
@endif
{{-- 駁回資訊 --}}
@if ($document->isRejected())
<li>
<div class="relative">
<div class="relative flex space-x-3">
<div>
<span class="flex h-8 w-8 items-center justify-center rounded-full bg-red-500 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 class="flex-1">
<p class="text-sm text-gray-900 dark:text-gray-100">
駁回者
<span class="font-medium">{{ $document->rejectedBy?->name }}</span>
</p>
@if ($document->rejection_reason)
<p class="mt-2 text-sm text-red-600 dark:text-red-400">
<strong>原因:</strong> {{ $document->rejection_reason }}
</p>
@endif
</div>
<div class="whitespace-nowrap text-right text-sm text-gray-500 dark:text-gray-400">
{{ $document->rejected_at?->format('Y-m-d H:i') }}
</div>
</div>
</div>
</div>
</li>
@endif
</ul>
</div>
</div>
</div>
{{-- 出帳確認區塊 --}}
@if ($document->isApprovalComplete() && !$document->isRejected())
<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 dark:text-gray-100 mb-4">
出帳確認
<span class="ml-2 text-sm font-normal text-gray-500 dark:text-gray-400">(需申請人與出納雙重確認)</span>
</h3>
<div class="space-y-4">
{{-- 申請人確認狀態 --}}
<div class="flex items-center justify-between p-4 rounded-lg {{ $document->requester_confirmed_at ? 'bg-green-50 dark:bg-green-900/30' : 'bg-gray-50 dark:bg-gray-700' }}">
<div class="flex items-center">
@if ($document->requester_confirmed_at)
<svg class="h-5 w-5 text-green-500 mr-3" 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>
@else
<span class="h-5 w-5 rounded-full border-2 border-gray-300 dark:border-gray-500 mr-3"></span>
@endif
<div>
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">申請人確認領款</p>
@if ($document->requester_confirmed_at)
<p class="text-xs text-gray-500 dark:text-gray-400">
{{ $document->requesterConfirmedBy?->name }} - {{ $document->requester_confirmed_at->format('Y-m-d H:i') }}
</p>
@endif
</div>
</div>
@if (!$document->requester_confirmed_at && $document->canRequesterConfirmDisbursement(auth()->user()))
<form method="POST" action="{{ route('admin.finance.confirm-disbursement', $document) }}">
@csrf
<button type="submit" class="inline-flex items-center rounded-md bg-blue-600 px-3 py-2 text-sm font-medium text-white hover:bg-blue-700">
確認已領款
</button>
</form>
@endif
</div>
{{-- 出納確認狀態 --}}
<div class="flex items-center justify-between p-4 rounded-lg {{ $document->cashier_confirmed_at ? 'bg-green-50 dark:bg-green-900/30' : 'bg-gray-50 dark:bg-gray-700' }}">
<div class="flex items-center">
@if ($document->cashier_confirmed_at)
<svg class="h-5 w-5 text-green-500 mr-3" 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>
@else
<span class="h-5 w-5 rounded-full border-2 border-gray-300 dark:border-gray-500 mr-3"></span>
@endif
<div>
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">出納確認出帳</p>
@if ($document->cashier_confirmed_at)
<p class="text-xs text-gray-500 dark:text-gray-400">
{{ $document->cashierConfirmedBy?->name }} - {{ $document->cashier_confirmed_at->format('Y-m-d H:i') }}
</p>
@endif
</div>
</div>
@if (!$document->cashier_confirmed_at && $document->canCashierConfirmDisbursement() && (auth()->user()->hasRole('finance_cashier') || auth()->user()->hasRole('admin')))
<form method="POST" action="{{ route('admin.finance.confirm-disbursement', $document) }}">
@csrf
<button type="submit" class="inline-flex items-center rounded-md bg-blue-600 px-3 py-2 text-sm font-medium text-white hover:bg-blue-700">
確認已出帳
</button>
</form>
@endif
</div>
{{-- 出帳狀態摘要 --}}
<div class="text-center text-sm {{ $document->isDisbursementComplete() ? 'text-green-600 dark:text-green-400' : 'text-gray-500 dark:text-gray-400' }}">
@if ($document->isDisbursementComplete())
出帳確認完成
@else
{{ $document->disbursement_status_label }}
@endif
</div>
</div>
</div>
</div>
@endif
{{-- 入帳確認區塊 --}}
@if ($document->isDisbursementComplete())
<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 dark:text-gray-100 mb-4">
入帳確認
</h3>
<div class="flex items-center justify-between p-4 rounded-lg {{ $document->accountant_recorded_at ? 'bg-green-50 dark:bg-green-900/30' : 'bg-gray-50 dark:bg-gray-700' }}">
<div class="flex items-center">
@if ($document->accountant_recorded_at)
<svg class="h-5 w-5 text-green-500 mr-3" 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>
@else
<span class="h-5 w-5 rounded-full border-2 border-gray-300 dark:border-gray-500 mr-3"></span>
@endif
<div>
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">會計確認入帳</p>
@if ($document->accountant_recorded_at)
<p class="text-xs text-gray-500 dark:text-gray-400">
{{ $document->accountantRecordedBy?->name }} - {{ $document->accountant_recorded_at->format('Y-m-d H:i') }}
</p>
@endif
</div>
</div>
@if ($document->canAccountantConfirmRecording() && (auth()->user()->hasRole('finance_accountant') || auth()->user()->hasRole('admin')))
<form method="POST" action="{{ route('admin.finance.confirm-recording', $document) }}">
@csrf
<button type="submit" class="inline-flex items-center rounded-md bg-green-600 px-3 py-2 text-sm font-medium text-white hover:bg-green-700">
確認入帳
</button>
</form>
@endif
</div>
</div>
</div>
@endif
{{-- Approval Actions (審核中才顯示) --}}
@if (!$document->isRejected() && !$document->isApprovalComplete())
<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 dark:text-gray-100 mb-4">
審核操作
</h3>
<div class="flex gap-3">
{{-- Approve Button --}}
@php
$canApprove = false;
$isAdmin = auth()->user()->hasRole('admin');
$isSecretary = auth()->user()->hasRole('secretary_general');
$isChair = auth()->user()->hasRole('finance_chair');
$isBoardMember = auth()->user()->hasRole('finance_board_member');
if ($isAdmin && !$document->isApprovalComplete() && !$document->isRejected()) {
$canApprove = true;
} elseif ($isSecretary && $document->canBeApprovedBySecretary(auth()->user())) {
$canApprove = true;
} elseif ($isChair && $document->canBeApprovedByChair(auth()->user())) {
$canApprove = true;
} elseif ($isBoardMember && $document->canBeApprovedByBoard(auth()->user())) {
$canApprove = true;
}
@endphp
@if ($canApprove)
<form method="POST" action="{{ route('admin.finance.approve', $document) }}" class="inline">
@csrf
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-green-600 px-4 py-2 text-sm font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-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="M5 13l4 4L19 7" />
</svg>
核准
@if ($isAdmin)
<span class="ml-1 text-xs opacity-75">(管理員)</span>
@endif
</button>
</form>
@endif
{{-- Reject Button --}}
@if (auth()->user()->hasRole('admin') || auth()->user()->hasRole('secretary_general') || auth()->user()->hasRole('finance_chair'))
<button type="button" onclick="document.getElementById('rejectModal').classList.remove('hidden')" class="inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-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="M6 18L18 6M6 6l12 12" />
</svg>
駁回
</button>
@endif
</div>
</div>
</div>
@endif
</div>
</div>
{{-- Rejection Modal --}}
<div id="rejectModal" class="fixed inset-0 z-10 hidden overflow-y-auto" aria-labelledby="modal-title" role="dialog" aria-modal="true">
<div class="flex min-h-screen items-end justify-center px-4 pb-20 pt-4 text-center sm:block sm:p-0">
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 dark:bg-gray-900 dark:bg-opacity-75 transition-opacity" onclick="document.getElementById('rejectModal').classList.add('hidden')"></div>
<div class="inline-block transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 text-left align-bottom shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:align-middle">
<form method="POST" action="{{ route('admin.finance.reject', $document) }}">
@csrf
<div class="bg-white dark:bg-gray-800 px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900 sm:mx-0 sm:h-10 sm:w-10">
<svg class="h-6 w-6 text-red-600 dark:text-red-200" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
</svg>
</div>
<div class="mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left flex-1">
<h3 class="text-base font-semibold leading-6 text-gray-900 dark:text-gray-100" id="modal-title">
駁回報銷單
</h3>
<div class="mt-4">
<label for="rejection_reason" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
駁回原因
</label>
<textarea
name="rejection_reason"
id="rejection_reason"
rows="4"
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-red-500 focus:ring-red-500 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
required
></textarea>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 dark:bg-gray-700 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6 gap-3">
<button type="submit" class="inline-flex w-full justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500 sm:w-auto">
駁回
</button>
<button type="button" onclick="document.getElementById('rejectModal').classList.add('hidden')" class="mt-3 inline-flex w-full justify-center rounded-md bg-white dark:bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-900 dark:text-gray-100 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600 sm:mt-0 sm:w-auto">
取消
</button>
</div>
</form>
</div>
</div>
</div>
</x-app-layout>