Code refactor work. New optimised query to get invoice status summary for an account

This commit is contained in:
2024-07-05 12:04:08 +10:00
parent 59dc825bf7
commit 648d941893
15 changed files with 375 additions and 169 deletions

View File

@@ -121,18 +121,4 @@
</div>
</div>
</div>
@endsection
@section('page-scripts')
<script>
$(document).ready(function() {
$('body')
.addClass('sidebar-collapse')
.delay(500)
.queue(function () {
window.dispatchEvent(new Event('resize'));
$(this).dequeue();
});
});
</script>
@append
@endsection

View File

@@ -41,8 +41,11 @@
</div>
</div>
@section('page-scripts')
@section('page-styles')
@css(datatables,bootstrap4|rowgroup)
@append
@section('page-scripts')
@js(datatables,bootstrap4|rowgroup)
<script type="text/javascript">

View File

@@ -0,0 +1,45 @@
<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