Initial commit
This commit is contained in:
184
resources/views/admin/payment-orders/create.blade.php
Normal file
184
resources/views/admin/payment-orders/create.blade.php
Normal file
@@ -0,0 +1,184 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
製作付款單
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<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>
|
||||
@endif
|
||||
|
||||
<!-- Finance Document Info -->
|
||||
<div class="bg-white 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>
|
||||
<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>
|
||||
</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>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">申請類型</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $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>
|
||||
</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>
|
||||
</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>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Payment Order Form -->
|
||||
<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="px-4 py-5 sm:p-6">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 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>
|
||||
<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">
|
||||
@error('payee_name')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $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>
|
||||
<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">
|
||||
<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>
|
||||
@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>
|
||||
<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">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="payee_bank_code" class="block text-sm font-medium text-gray-700">
|
||||
銀行代碼
|
||||
</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">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="payee_account_number" class="block text-sm font-medium text-gray-700">
|
||||
銀行帳號
|
||||
</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">
|
||||
</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>
|
||||
<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>
|
||||
</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">
|
||||
</div>
|
||||
@error('payment_amount')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<!-- Notes -->
|
||||
<div>
|
||||
<label for="notes" class="block text-sm font-medium text-gray-700">
|
||||
備註
|
||||
</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>
|
||||
@error('notes')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 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>
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
// Show/hide bank information based on payment method
|
||||
document.getElementById('payment_method').addEventListener('change', function() {
|
||||
const bankInfo = document.getElementById('bank_info');
|
||||
if (this.value === 'bank_transfer') {
|
||||
bankInfo.style.display = 'block';
|
||||
} else {
|
||||
bankInfo.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// Trigger on page load to handle old input
|
||||
if (document.getElementById('payment_method').value === 'bank_transfer') {
|
||||
document.getElementById('bank_info').style.display = 'block';
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
</x-app-layout>
|
||||
153
resources/views/admin/payment-orders/index.blade.php
Normal file
153
resources/views/admin/payment-orders/index.blade.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
付款單管理
|
||||
</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 p-4">
|
||||
<p class="text-sm font-medium text-green-800">{{ session('status') }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@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>
|
||||
@endif
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<form method="GET" action="{{ route('admin.payment-orders.index') }}" class="grid grid-cols-1 gap-4 sm:grid-cols-4">
|
||||
<div>
|
||||
<label for="status" class="block text-sm font-medium text-gray-700">狀態</label>
|
||||
<select name="status" id="status" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
|
||||
<option value="">全部</option>
|
||||
<option value="draft" {{ request('status') == 'draft' ? 'selected' : '' }}>草稿</option>
|
||||
<option value="pending_verification" {{ request('status') == 'pending_verification' ? 'selected' : '' }}>待出納覆核</option>
|
||||
<option value="verified" {{ request('status') == 'verified' ? 'selected' : '' }}>已覆核</option>
|
||||
<option value="executed" {{ request('status') == 'executed' ? 'selected' : '' }}>已執行付款</option>
|
||||
<option value="cancelled" {{ request('status') == 'cancelled' ? 'selected' : '' }}>已取消</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="verification_status" class="block text-sm font-medium text-gray-700">覆核狀態</label>
|
||||
<select name="verification_status" id="verification_status" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
|
||||
<option value="">全部</option>
|
||||
<option value="pending" {{ request('verification_status') == 'pending' ? 'selected' : '' }}>待覆核</option>
|
||||
<option value="approved" {{ request('verification_status') == 'approved' ? 'selected' : '' }}>已通過</option>
|
||||
<option value="rejected" {{ request('verification_status') == 'rejected' ? 'selected' : '' }}>已駁回</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="execution_status" class="block text-sm font-medium text-gray-700">執行狀態</label>
|
||||
<select name="execution_status" id="execution_status" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
|
||||
<option value="">全部</option>
|
||||
<option value="pending" {{ request('execution_status') == 'pending' ? 'selected' : '' }}>待執行</option>
|
||||
<option value="completed" {{ request('execution_status') == 'completed' ? 'selected' : '' }}>已完成</option>
|
||||
<option value="failed" {{ request('execution_status') == 'failed' ? 'selected' : '' }}>失敗</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex items-end">
|
||||
<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>
|
||||
<a href="{{ route('admin.payment-orders.index') }}" class="ml-2 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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Payment Orders Table -->
|
||||
<div class="bg-white 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">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
付款單號
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
收款人
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
金額
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
付款方式
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
狀態
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
製單人
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
<span class="sr-only">操作</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
@forelse ($paymentOrders as $order)
|
||||
<tr>
|
||||
<td class="whitespace-nowrap px-4 py-4 text-sm font-medium text-gray-900">
|
||||
{{ $order->payment_order_number }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-4 text-sm text-gray-500">
|
||||
{{ $order->payee_name }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-4 text-sm text-gray-500">
|
||||
NT$ {{ number_format($order->payment_amount, 2) }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-4 text-sm text-gray-500">
|
||||
{{ $order->getPaymentMethodText() }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-4 text-sm">
|
||||
<span class="inline-flex rounded-full px-2 text-xs font-semibold leading-5
|
||||
@if($order->status === 'executed') bg-green-100 text-green-800
|
||||
@elseif($order->status === 'verified') bg-blue-100 text-blue-800
|
||||
@elseif($order->status === 'pending_verification') bg-yellow-100 text-yellow-800
|
||||
@elseif($order->status === 'cancelled') bg-red-100 text-red-800
|
||||
@else bg-gray-100 text-gray-800
|
||||
@endif">
|
||||
{{ $order->getStatusText() }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-4 text-sm text-gray-500">
|
||||
{{ $order->createdByAccountant->name ?? 'N/A' }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-4 text-right text-sm font-medium">
|
||||
<a href="{{ route('admin.payment-orders.show', $order) }}" class="text-indigo-600 hover:text-indigo-900">
|
||||
查看
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-8 text-center text-sm text-gray-500">
|
||||
沒有付款單記錄
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
{{ $paymentOrders->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
298
resources/views/admin/payment-orders/show.blade.php
Normal file
298
resources/views/admin/payment-orders/show.blade.php
Normal file
@@ -0,0 +1,298 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
付款單詳情: {{ $paymentOrder->payment_order_number }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-5xl sm:px-6 lg:px-8 space-y-4">
|
||||
@if (session('status'))
|
||||
<div class="rounded-md bg-green-50 p-4">
|
||||
<p class="text-sm font-medium text-green-800">{{ session('status') }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@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>
|
||||
@endif
|
||||
|
||||
<!-- Payment Order Info -->
|
||||
<div class="bg-white 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">付款單資訊</h3>
|
||||
<span class="inline-flex rounded-full px-3 py-1 text-sm font-semibold
|
||||
@if($paymentOrder->status === 'executed') bg-green-100 text-green-800
|
||||
@elseif($paymentOrder->status === 'verified') bg-blue-100 text-blue-800
|
||||
@elseif($paymentOrder->status === 'pending_verification') bg-yellow-100 text-yellow-800
|
||||
@elseif($paymentOrder->status === 'cancelled') bg-red-100 text-red-800
|
||||
@else bg-gray-100 text-gray-800
|
||||
@endif">
|
||||
{{ $paymentOrder->getStatusText() }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<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 font-mono">{{ $paymentOrder->payment_order_number }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">收款人</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->payee_name }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">付款金額</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 font-semibold">NT$ {{ number_format($paymentOrder->payment_amount, 2) }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">付款方式</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->getPaymentMethodText() }}</dd>
|
||||
</div>
|
||||
|
||||
@if($paymentOrder->payment_method === 'bank_transfer')
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">銀行名稱</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->payee_bank_name ?? 'N/A' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">銀行代碼</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->payee_bank_code ?? 'N/A' }}</dd>
|
||||
</div>
|
||||
<div class="sm:col-span-2">
|
||||
<dt class="text-sm font-medium text-gray-500">銀行帳號</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 font-mono">{{ $paymentOrder->payee_account_number ?? 'N/A' }}</dd>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="sm:col-span-2">
|
||||
<dt class="text-sm font-medium text-gray-500">製單人(會計)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">
|
||||
{{ $paymentOrder->createdByAccountant->name }} - {{ $paymentOrder->created_at->format('Y-m-d H:i') }}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@if($paymentOrder->notes)
|
||||
<div class="sm:col-span-2">
|
||||
<dt class="text-sm font-medium text-gray-500">備註</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->notes }}</dd>
|
||||
</div>
|
||||
@endif
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Verification Section -->
|
||||
<div class="bg-white 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>
|
||||
|
||||
@if($paymentOrder->verified_at)
|
||||
<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">{{ $paymentOrder->verifiedByCashier->name }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">覆核時間</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->verified_at->format('Y-m-d H:i') }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">覆核狀態</dt>
|
||||
<dd class="mt-1 text-sm">
|
||||
<span class="inline-flex rounded-full px-2 text-xs font-semibold
|
||||
@if($paymentOrder->verification_status === 'approved') bg-green-100 text-green-800
|
||||
@elseif($paymentOrder->verification_status === 'rejected') bg-red-100 text-red-800
|
||||
@else bg-yellow-100 text-yellow-800
|
||||
@endif">
|
||||
@if($paymentOrder->verification_status === 'approved') 通過
|
||||
@elseif($paymentOrder->verification_status === 'rejected') 駁回
|
||||
@else 待覆核
|
||||
@endif
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
@if($paymentOrder->verification_notes)
|
||||
<div class="sm:col-span-2">
|
||||
<dt class="text-sm font-medium text-gray-500">覆核備註</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->verification_notes }}</dd>
|
||||
</div>
|
||||
@endif
|
||||
</dl>
|
||||
@else
|
||||
<p class="text-sm text-gray-500 mb-4">此付款單待出納覆核</p>
|
||||
|
||||
@can('verify_payment_order')
|
||||
@if($paymentOrder->canBeVerifiedByCashier())
|
||||
<form method="POST" action="{{ route('admin.payment-orders.verify', $paymentOrder) }}" class="space-y-4">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="verification_notes" class="block text-sm font-medium text-gray-700">覆核備註</label>
|
||||
<textarea name="verification_notes" id="verification_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"></textarea>
|
||||
</div>
|
||||
<div class="flex space-x-3">
|
||||
<button type="submit" name="action" value="approve"
|
||||
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">
|
||||
通過覆核
|
||||
</button>
|
||||
<button type="submit" name="action" value="reject"
|
||||
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">
|
||||
駁回
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
@endcan
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Execution Section -->
|
||||
<div class="bg-white 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>
|
||||
|
||||
@if($paymentOrder->executed_at)
|
||||
<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">{{ $paymentOrder->executedByCashier->name }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">執行時間</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->executed_at->format('Y-m-d H:i') }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">執行狀態</dt>
|
||||
<dd class="mt-1 text-sm">
|
||||
<span class="inline-flex rounded-full px-2 text-xs font-semibold
|
||||
@if($paymentOrder->execution_status === 'completed') bg-green-100 text-green-800
|
||||
@elseif($paymentOrder->execution_status === 'failed') bg-red-100 text-red-800
|
||||
@else bg-yellow-100 text-yellow-800
|
||||
@endif">
|
||||
@if($paymentOrder->execution_status === 'completed') 已完成
|
||||
@elseif($paymentOrder->execution_status === 'failed') 失敗
|
||||
@else 待執行
|
||||
@endif
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
@if($paymentOrder->transaction_reference)
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">交易參考號</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 font-mono">{{ $paymentOrder->transaction_reference }}</dd>
|
||||
</div>
|
||||
@endif
|
||||
@if($paymentOrder->payment_receipt_path)
|
||||
<div class="sm:col-span-2">
|
||||
<dt class="text-sm font-medium text-gray-500">付款憑證</dt>
|
||||
<dd class="mt-1">
|
||||
<a href="{{ route('admin.payment-orders.download-receipt', $paymentOrder) }}" class="text-indigo-600 hover:text-indigo-900">
|
||||
下載憑證
|
||||
</a>
|
||||
</dd>
|
||||
</div>
|
||||
@endif
|
||||
</dl>
|
||||
@else
|
||||
<p class="text-sm text-gray-500 mb-4">此付款單待執行付款</p>
|
||||
|
||||
@can('execute_payment')
|
||||
@if($paymentOrder->canBeExecuted())
|
||||
<form method="POST" action="{{ route('admin.payment-orders.execute', $paymentOrder) }}" enctype="multipart/form-data" class="space-y-4">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="transaction_reference" class="block text-sm font-medium text-gray-700">
|
||||
交易參考號 <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input type="text" name="transaction_reference" id="transaction_reference" 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">
|
||||
<p class="mt-1 text-xs text-gray-500">銀行交易編號或支票號碼</p>
|
||||
</div>
|
||||
<div>
|
||||
<label for="payment_receipt" class="block text-sm font-medium text-gray-700">
|
||||
付款憑證
|
||||
</label>
|
||||
<input type="file" name="payment_receipt" id="payment_receipt"
|
||||
class="mt-1 block w-full text-sm text-gray-500
|
||||
file:mr-4 file:py-2 file:px-4
|
||||
file:rounded-md file:border-0
|
||||
file:text-sm file:font-semibold
|
||||
file:bg-indigo-50 file:text-indigo-700
|
||||
hover:file:bg-indigo-100">
|
||||
<p class="mt-1 text-xs text-gray-500">上傳轉帳收據或付款證明(最大 10MB)</p>
|
||||
</div>
|
||||
<div>
|
||||
<label for="execution_notes" class="block text-sm font-medium text-gray-700">執行備註</label>
|
||||
<textarea name="execution_notes" id="execution_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"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<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">
|
||||
確認執行付款
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
@endcan
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Related Finance Document -->
|
||||
<div class="bg-white 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>
|
||||
<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">{{ $paymentOrder->financeDocument->title }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">申請類型</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->financeDocument->getRequestTypeText() }}</dd>
|
||||
</div>
|
||||
@if($paymentOrder->financeDocument->member)
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">關聯會員</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $paymentOrder->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">{{ $paymentOrder->financeDocument->submittedBy->name }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<div class="mt-4">
|
||||
<a href="{{ route('admin.finance.show', $paymentOrder->financeDocument) }}" class="text-indigo-600 hover:text-indigo-900">
|
||||
查看完整申請單 →
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Actions -->
|
||||
<div class="flex justify-between">
|
||||
<a href="{{ route('admin.payment-orders.index') }}" 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>
|
||||
|
||||
@can('create_payment_order')
|
||||
@if(!$paymentOrder->isExecuted() && $paymentOrder->status !== 'cancelled')
|
||||
<form method="POST" action="{{ route('admin.payment-orders.cancel', $paymentOrder) }}" onsubmit="return confirm('確定要取消此付款單嗎?');">
|
||||
@csrf
|
||||
<button type="submit" 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">
|
||||
取消付款單
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
Reference in New Issue
Block a user