2023-05-09 10:28:51 +00:00
|
|
|
<!-- $o = Account::class -->
|
2021-06-29 06:36:34 +00:00
|
|
|
<!-- Show past 12 months invoices -->
|
2023-05-09 10:28:51 +00:00
|
|
|
<div class="card card-success">
|
2021-06-29 06:36:34 +00:00
|
|
|
<div class="card-header">
|
|
|
|
<h3 class="card-title">Past Invoices</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-body">
|
2024-07-05 06:38:31 +00:00
|
|
|
@if(($list=$o->invoiceSummaryPast()->where('invoices.created_at','>=',\Carbon\Carbon::now()->subYears(2)->startOfYear())->get())->count())
|
2023-05-09 10:28:51 +00:00
|
|
|
<table class="table table-bordered w-100" id="invoices_past_{{ $o->id }}">
|
2021-06-29 06:36:34 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Account</th>
|
|
|
|
<th>#</th>
|
|
|
|
<th>Issued</th>
|
|
|
|
<th>Paid</th>
|
|
|
|
<th class="text-right">Total</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2024-07-05 06:38:31 +00:00
|
|
|
@foreach ($list as $oo)
|
2021-06-29 06:36:34 +00:00
|
|
|
<tr>
|
|
|
|
<td>{{ $oo->account->name }}</td>
|
2024-07-05 06:38:31 +00:00
|
|
|
<td><a href="{{ url('u/invoice',$oo->id) }}">{{ $oo->lid }}</a></td>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>{{ $oo->created_at->format('Y-m-d') }}</td>
|
2024-07-05 06:38:31 +00:00
|
|
|
<td>{{ $oo->_paid_at?->format('Y-m-d') }}</td>
|
|
|
|
<td class="text-right">${{ number_format($oo->_total,2) }}</td>
|
2021-06-29 06:36:34 +00:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
@else
|
|
|
|
<p>No invoices to list</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-07-05 06:38:31 +00:00
|
|
|
@section('page-styles')
|
2021-12-20 03:08:00 +00:00
|
|
|
@css(datatables,bootstrap4|rowgroup)
|
2024-07-05 06:38:31 +00:00
|
|
|
@append
|
|
|
|
|
|
|
|
@section('page-scripts')
|
2021-12-20 03:08:00 +00:00
|
|
|
@js(datatables,bootstrap4|rowgroup)
|
2021-06-29 06:36:34 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2024-07-05 06:38:31 +00:00
|
|
|
@if ($list->count())
|
2023-05-09 10:28:51 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
$('#invoices_past_{{ $o->id }}').DataTable({
|
|
|
|
order: [[2,'desc'],[0,'asc']],
|
|
|
|
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
|