osb/resources/views/theme/backend/adminlte/service/widget/billinghistory.blade.php

45 lines
1.1 KiB
PHP
Raw Normal View History

2024-07-07 05:02:02 +00:00
<!-- $o=Service::class -->
<table class="table table-sm" id="svc_bill_hist">
<thead>
<tr>
<th>Invoice</th>
<th>Start</th>
<th>Stop</th>
<th>Service</th>
<th>Extras</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
@foreach($o->invoiced_items_active->groupBy('invoice_id') as $oo)
<tr>
<td><a href="{{ url('u/invoice',($x=$oo->first())->invoice_id) }}">{{ $x->invoice_id }}</a></td>
<td>{{ ($y=$oo->where('item_type',0))->min('start_at')->format('Y-m-d') }}</td>
<td>{{ $y->max('stop_at')->format('Y-m-d') }}</td>
<th>{{ number_format($y->sum('total'),2) }}</th>
<th>{{ number_format($oo->where('item_type','<>',0)->sum('total'),2) }}</th>
<td class="text-right">{{ number_format($oo->sum('total'),2) }}</td>
</tr>
@endforeach
</tbody>
</table>
@section('page-styles')
@css(datatables,bootstrap4)
@append
@section('page-scripts')
@js(datatables,bootstrap4)
<script type="text/javascript">
$(document).ready(function() {
$('#svc_bill_hist').DataTable({
language: {
emptyTable: "No Invoices"
},
order: [1,'desc'],
pageLength: 10
});
});
</script>
@append