osb/resources/views/theme/backend/adminlte/account/widget/invoice_past.blade.php

62 lines
1.5 KiB
PHP
Raw Normal View History

<!-- $o=Account::class -->
2021-06-29 06:36:34 +00:00
<!-- Show past 12 months invoices -->
<div class="card card-success">
<div class="card-header p-2">
2021-06-29 06:36:34 +00:00
<h3 class="card-title">Past Invoices</h3>
</div>
<div class="card-body p-2">
2024-07-05 06:38:31 +00:00
@if(($list=$o->invoiceSummaryPast()->where('invoices.created_at','>=',\Carbon\Carbon::now()->subYears(2)->startOfYear())->get())->count())
<table class="table table-sm table-striped" 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>
<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>
@pa(datatables,rowgroup|conditionalpaging)
2021-06-29 06:36:34 +00:00
@section('page-scripts')
2021-06-29 06:36:34 +00:00
<script type="text/javascript">
@if($list->count())
$(document).ready(function() {
$('#invoices_past_{{ $o->id }}').DataTable({
conditionalPaging: true,
order: [[2,'desc'],[0,'asc']],
rowGroup: {
dataSrc: 0,
},
columnDefs: [
{
targets: [0],
visible: false,
}
],
});
2021-06-29 06:36:34 +00:00
});
@endif
2021-06-29 06:36:34 +00:00
</script>
@append