2023-05-09 10:28:51 +00:00
|
|
|
<!-- $o = Account::class -->
|
2021-06-29 06:36:34 +00:00
|
|
|
<!-- Show outstanding invoices -->
|
|
|
|
<div class="card card-warning">
|
|
|
|
<div class="card-header">
|
|
|
|
<h3 class="card-title">Invoices Due</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-body">
|
2023-05-09 10:28:51 +00:00
|
|
|
@if(($x=$o->invoices->where('due','>',0))->count())
|
|
|
|
<table class="table table-bordered w-100" id="invoices_due_{{ $o->id }}">
|
2021-06-29 06:36:34 +00:00
|
|
|
<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>
|
2021-07-02 05:10:22 +00:00
|
|
|
@foreach ($x as $oo)
|
2022-04-22 04:41:18 +00:00
|
|
|
<tr @if ($oo->due_at->isPast()) class="table-danger" @endif>
|
2021-06-29 06:36:34 +00:00
|
|
|
<td>{{ $oo->account->name }}</td>
|
2023-05-09 10:28:51 +00:00
|
|
|
<td><a href="{{ url('u/invoice',$oo->id) }}">{{ $oo->lid }}</a></td>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>{{ $oo->due_at->format('Y-m-d') }}</td>
|
2021-06-29 06:36:34 +00:00
|
|
|
<td class="text-right">${{ number_format($oo->total,2) }}</td>
|
|
|
|
<td class="text-right">${{ number_format($oo->due,2) }}</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
@else
|
|
|
|
<p>No invoice due</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@section('page-scripts')
|
2021-12-20 03:08:00 +00:00
|
|
|
@css(datatables,bootstrap4|rowgroup)
|
|
|
|
@js(datatables,bootstrap4|rowgroup)
|
2021-06-29 06:36:34 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2023-05-09 10:28:51 +00:00
|
|
|
@if ($x->count())
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#invoices_due_{{ $o->id }}').DataTable({
|
|
|
|
order: [[0,'asc'],[3,'desc']],
|
|
|
|
rowGroup: {
|
|
|
|
dataSrc: 0,
|
|
|
|
},
|
|
|
|
columnDefs: [
|
|
|
|
{
|
|
|
|
targets: [0],
|
|
|
|
visible: false,
|
|
|
|
}
|
|
|
|
],
|
|
|
|
});
|
2021-06-29 06:36:34 +00:00
|
|
|
});
|
2023-05-09 10:28:51 +00:00
|
|
|
@endif
|
2021-06-29 06:36:34 +00:00
|
|
|
</script>
|
|
|
|
@append
|