Files
portal-api/resources/views/livewire/invoice.blade.php
T
2025-07-24 16:18:27 +07:00

81 lines
4.1 KiB
PHP

<div class="box-form rounded-lg shadow p-6 mt-4">
<!-- Actual search box -->
<div class="flex justify-between items-center mb-4">
<div class="w-1/4">
<div class="mb-2">
<select wire:model="status" name="search" class="form-control w-full p-2 border rounded-md">
<option value="full" selected>Tất cả hoá đơn</option>
<option value="1">Đã thanh toán</option>
<option value="0">Chưa thanh toán</option>
</select>
</div>
</div>
</div>
<div class="box-research mt-6">
<table class="table-auto w-full border-collapse">
<thead>
<tr class="text-center bg-primary text-white">
<th class="px-4 py-2 border-b">Invoice</th>
<th class="px-4 py-2 border-b">Ngày tạo</th>
<th class="px-4 py-2 border-b">Hạn thanh toán</th>
<th class="px-4 py-2 border-b">Thành tiền</th>
<th class="px-4 py-2 border-b">Trạng thái</th>
<th class="w-10 px-4 py-2 border-b"></th>
</tr>
</thead>
<tbody>
@forelse($invoice as $item)
<tr class="hover:bg-gray-50">
<td class="text-center px-4 py-2 border-b border-gray-200">
<a class="text-decoration-none text-blue-500"
href="{{ route('invoice.show', ['invoice_id' => $item->id, 'order_num' => $item->order_num]) }}">
{{ $item->order_num }}
</a>
</td>
<td class="text-center px-4 py-2 border-b border-gray-200">
{{ Carbon\Carbon::parse($item->date)->format('d/m/Y') }}
</td>
<td class="text-center px-4 py-2 border-b border-gray-200">
{{ Carbon\Carbon::parse($item->due_date)->format('d/m/Y') }}
</td>
<td class="text-center px-4 py-2 border-b border-gray-200">
{{ number_format($item->total, 0, '.', ',') }} đ
</td>
<td class="text-center px-4 py-2 border-b border-gray-200">
{!! \App\Http\Helpers\Helper::ViewInvoiceStatus($item->status) !!}
</td>
<td class="text-center px-4 py-2 border-b border-gray-200">
<a class="btn btn-primary text-white py-2 px-4 rounded-md"
href="{{ route('invoice.show', ['invoice_id' => $item->id, 'order_num' => $item->order_num]) }}">
<i class="fas fa-search"></i>
</a>
</td>
</tr>
@empty
<tr>
<td colspan="5" class="text-center py-4 text-gray-500">
<div class="flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"
class="lucide lucide-inbox-icon lucide-inbox w-4 h-4 mr-2">
<polyline points="22 12 16 12 14 15 10 15 8 12 2 12" />
<path
d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" />
</svg>
{{ __('emptyValue') }}
</div>
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="mt-4">
{{ $invoice->links() }}
</div>
</div>