2021-06-29 06:36:34 +00:00
|
|
|
<!-- Show past 12 months invoices -->
|
2021-06-30 05:50:33 +00:00
|
|
|
<div class="card card-dark">
|
2021-06-29 06:36:34 +00:00
|
|
|
<div class="card-header">
|
|
|
|
<h3 class="card-title">Past Invoices</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-body">
|
2022-04-22 04:41:18 +00:00
|
|
|
@if(($x=$o->invoices()->where('invoices.created_at','>',\Carbon\Carbon::now()->subMonths(12))->with(['items.taxes','paymentitems.payment','account.country.currency'])->get()->where('due','<=',0))->count())
|
2021-06-29 06:36:34 +00:00
|
|
|
<table class="table table-bordered w-100" id="invoices_past">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Account</th>
|
|
|
|
<th>#</th>
|
|
|
|
<th>Issued</th>
|
|
|
|
<th>Due</th>
|
|
|
|
<th>Paid</th>
|
|
|
|
<th class="text-right">Total</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2021-07-02 05:10:22 +00:00
|
|
|
@foreach ($x as $oo)
|
2021-06-29 06:36:34 +00:00
|
|
|
<tr>
|
|
|
|
<td>{{ $oo->account->name }}</td>
|
|
|
|
<td><a href="{{ url('u/invoice',$oo->id) }}">{{ $oo->sid }}</a></td>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>{{ $oo->created_at->format('Y-m-d') }}</td>
|
|
|
|
<td>{{ $oo->due_at->format('Y-m-d') }}</td>
|
2021-06-29 06:36:34 +00:00
|
|
|
<td>{{ $oo->paid_date ? $oo->paid_date->format('Y-m-d') : '' }}</td>
|
|
|
|
<td class="text-right">${{ number_format($oo->total,2) }}</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
@else
|
|
|
|
<p>No invoices to list</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">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#invoices_past').DataTable({
|
2022-04-22 04:41:18 +00:00
|
|
|
order: [[3,'desc'],[0,'asc']],
|
2021-06-29 06:36:34 +00:00
|
|
|
rowGroup: {
|
|
|
|
dataSrc: 0,
|
|
|
|
},
|
|
|
|
columnDefs: [
|
|
|
|
{
|
|
|
|
targets: [0],
|
|
|
|
visible: false,
|
|
|
|
}
|
|
|
|
],
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#invoices_past tbody').on('click','tr', function () {
|
|
|
|
$(this).toggleClass('selected');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@append
|