154 lines
10 KiB
PHP
154 lines
10 KiB
PHP
<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>
|