osb/resources/views/theme/backend/adminlte/invoice/widget/due.blade.php
Deon George 5f10175b35
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 35s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
Updated datatables, using @pa instead of @js/@css, using conditionalPaging in datatables
2024-07-28 21:33:30 +10:00

50 lines
1.2 KiB
PHP

<!-- $list=Collection[Invoice::class] -->
<!-- Show outstanding invoices -->
<table class="table table-sm table-striped" id="invoices_due_{{$type}}">
<thead>
<tr>
<th>Account</th>
<th>#</th>
<th>Due</th>
<th class="text-right">Total</th>
<th class="text-right">Outstanding</th>
</tr>
</thead>
<tbody>
@foreach($list as $oo)
<tr @if($oo->due_at->isPast()) class="table-danger" @endif>
<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->_total,2) }}</td>
<td class="text-right">${{ number_format($oo->_balance,2) }}</td>
</tr>
@endforeach
</tbody>
</table>
@pa(datatables,rowgroup|conditionalpaging)
@section('page-scripts')
<script type="text/javascript">
@if($list->count())
$(document).ready(function() {
$('#invoices_due_{{$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