Updated datatables, using @pa instead of @js/@css, using conditionalPaging in datatables
This commit is contained in:
@@ -1,57 +1,59 @@
|
||||
<!-- Show outstanding invoices -->
|
||||
<table class="table table-bordered w-100" id="invoices_credit_{{$type}}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Account</th>
|
||||
<th>#</th>
|
||||
<th>Due</th>
|
||||
<th class="text-right">Items</th>
|
||||
<th class="text-right">Discounts</th>
|
||||
<th class="text-right">Total</th>
|
||||
<th class="text-right">Payments</th>
|
||||
<th class="text-right">Balance</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($list as $oo)
|
||||
@if($list->count())
|
||||
<table class="table table-bordered table-striped" id="invoices_credit_{{$type}}">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ $oo->account->name }}</td>
|
||||
<td><a href="{{ url('u/invoice',$oo->id) }}">{{ $oo->lid }}</a></td>
|
||||
<td>{{ $oo->due_at->format('Y-m-d') }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_item+$oo->_tax,2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_discount,2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_total,2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_payment,2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_balance,2) }}</td>
|
||||
<th>Account</th>
|
||||
<th>#</th>
|
||||
<th>Due</th>
|
||||
<th class="text-right">Items</th>
|
||||
<th class="text-right">Discounts</th>
|
||||
<th class="text-right">Total</th>
|
||||
<th class="text-right">Payments</th>
|
||||
<th class="text-right">Balance</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($list as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->account->name }}</td>
|
||||
<td><a href="{{ url('u/invoice',$oo->id) }}">{{ $oo->lid }}</a></td>
|
||||
<td>{{ $oo->due_at->format('Y-m-d') }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_item+$oo->_tax,2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_discount,2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_total,2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_payment,2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->_balance,2) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<p>No invoices to list</p>
|
||||
@endif
|
||||
|
||||
@pa(datatables,rowgroup|conditionalpaging)
|
||||
|
||||
@section('page-styles')
|
||||
@css(datatables,bootstrap4|rowgroup)
|
||||
@append
|
||||
@section('page-scripts')
|
||||
@js(datatables,bootstrap4|rowgroup)
|
||||
|
||||
<script type="text/javascript">
|
||||
@if($list->count())
|
||||
$(document).ready(function() {
|
||||
$('#invoices_credit_{{$type}}').DataTable({
|
||||
// If we have more than 1 account id, order by account
|
||||
order: [[0,'asc'],[2,'asc'],[1,'desc']],
|
||||
rowGroup: {
|
||||
dataSrc: 0,
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: [0],
|
||||
visible: false,
|
||||
}
|
||||
],
|
||||
$(document).ready(function() {
|
||||
$('#invoices_credit_{{$type}}').DataTable({
|
||||
conditionalPaging: true,
|
||||
// If we have more than 1 account id, order by account
|
||||
order: [[0,'asc'],[2,'asc'],[1,'desc']],
|
||||
rowGroup: {
|
||||
dataSrc: 0,
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: [0],
|
||||
visible: false,
|
||||
}
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
@endif
|
||||
</script>
|
||||
@append
|
@@ -1,15 +1,16 @@
|
||||
@use(App\Models\Account)
|
||||
<!-- Show outstanding invoices for all clients -->
|
||||
<div class="card card-warning">
|
||||
<div class="card-header">
|
||||
<div class="card-header p-2">
|
||||
<h3 class="card-title">Invoices Due</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if(($list=\App\Models\Account::InvoicesDue())->count())
|
||||
@include('theme.backend.adminlte.invoice.widget.due',['type'=>'all'])
|
||||
<div class="card-body p-2">
|
||||
@if(($list=Account::InvoicesDue())->count())
|
||||
@include('theme.backend.adminlte.invoice.widget.due',['type'=>'all','list'=>$list])
|
||||
|
||||
@else
|
||||
<p>No invoice due</p>
|
||||
<p>No invoices to list</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user