191 lines
9.9 KiB
PHP
191 lines
9.9 KiB
PHP
@extends("admin.main")
|
|
@section("content")
|
|
@if(auth()->guard('admins')->user()->can("manager invoice"))
|
|
<div class="card card-primary card-outline">
|
|
<div class="card-header">
|
|
<form action="{{ route('admin.invoice.index') }}" method="get">
|
|
<div class="row form-group mb-0">
|
|
<div class="col-md-3">
|
|
{{-- Customer --}}
|
|
<x-form.customer :model="request()->get('client') ?? null" />
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="invoice_id">
|
|
Invoice ID </label>
|
|
<input type="number" name="invoice_id" id="invoice_id" class="form-control"
|
|
value="{{ request()->invoice_id ?? "" }}">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
{{-- Payment --}}
|
|
<x-form.payment :model="request()->get('payment_method') ?? null" />
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="inputStatus">
|
|
Status</label>
|
|
<select name="status" class="form-control" id="inputStatus">
|
|
<option value="full"
|
|
@selected(request()->status === "full")>
|
|
Any
|
|
</option>
|
|
<option value="active"
|
|
@selected(request()->status === "active")>
|
|
Active
|
|
</option>
|
|
<option value="unpaid"
|
|
@selected(request()->status === "unpaid")>
|
|
Pending
|
|
</option>
|
|
<option value="cancel"
|
|
@selected(request()->status === "cancel")>
|
|
Cancel
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="date">Invoice Date:</label>
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="far fa-calendar-alt"></i>
|
|
</span>
|
|
</div>
|
|
<input type="text" class="form-control reservation float-right"
|
|
name="date"
|
|
value="{{ request()->date ?? "" }}"
|
|
id="date">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="due_date">Due Date:</label>
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="far fa-calendar-alt"></i>
|
|
</span>
|
|
</div>
|
|
<input type="text" class="form-control reservation float-right"
|
|
name="due_date"
|
|
value="{{ request()->due_date ?? "" }}"
|
|
id="due_date">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="date_paid">Date Paid:</label>
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<i class="far fa-calendar-alt"></i>
|
|
</span>
|
|
</div>
|
|
<input type="text" class="form-control reservation float-right"
|
|
name="date_paid"
|
|
value="{{ request()->date_paid ?? "" }}"
|
|
id="date_paid">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label class="clear-search hidden">
|
|
|
|
</label>
|
|
<button type="submit" class="form-control btn btn-block bg-gradient-primary">
|
|
<i class="fas fa-search"></i> Search
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<span>{{ $invoices->count() }} Records Found</span>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-invoice table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 10px">
|
|
<label for=""></label><input type="checkbox" name="check" class="check-all" id="">
|
|
</th>
|
|
<th>Invoice #</th>
|
|
<th>Client Name</th>
|
|
<th>Date</th>
|
|
<th>Payment Method</th>
|
|
<th>Total</th>
|
|
<th>Status</th>
|
|
<th style="width: 40px"></th>
|
|
<th style="width: 40px"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@if($invoices->count())
|
|
@foreach($invoices->all() as $item)
|
|
<tr>
|
|
<td class="text-center">
|
|
<input type="checkbox" name="id[]" id="" value="{{ $item->id }}">
|
|
</td>
|
|
<td class="text-center">
|
|
<a href="{{ route("admin.invoice.edit",['id' => $item->id]) }}"
|
|
title="View Order"> {{ $item->id }}</a>
|
|
</td>
|
|
<td class="text-center">
|
|
@isset($item->customer->firstname)
|
|
{{ $item->customer->firstname . ' ' . $item->customer->lastname }}
|
|
@endisset
|
|
</td>
|
|
<td class="text-center">
|
|
@time($item->date)
|
|
</td>
|
|
<td class="text-center">
|
|
{{ $item->payment->name ?? 'VN Pay' }}
|
|
</td>
|
|
<td class="text-center">
|
|
{{ number_format($item->total,0,',','.') }}đ
|
|
</td>
|
|
<td class="text-center">
|
|
{!! $item->getStatus() !!}
|
|
</td>
|
|
<td class="text-center">
|
|
<a class="btn btn-warning btn-sm"
|
|
href="{{ route('admin.invoice.edit',['id' => $item->id ]) }}">
|
|
<i class="fas fa-search"></i>
|
|
</a>
|
|
</td>
|
|
<td class="text-center">
|
|
@if(auth()->guard('admins')->user()->can("delete invoice"))
|
|
<form method="post" class="d-inline"
|
|
action="{{ route('admin.invoice.destroy',['id' => $item->id]) }}">
|
|
@csrf
|
|
@method('delete')
|
|
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
|
|
class="btn btn-sm btn-danger" data-original-title="Xoá">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</form>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="card-footer">
|
|
{{ $invoices->withQueryString()->links() }}
|
|
</div>
|
|
</div>
|
|
@else
|
|
<div class="alert alert-danger alert-dismissible">
|
|
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Invoice
|
|
management department</h5>
|
|
</div>
|
|
@endif
|
|
@endsection
|