Adding billing history - still WIP
Some checks failed
Create Docker Image / Build Docker Image (x86_64) (push) Failing after 44s
Create Docker Image / Final Docker Image Manifest (push) Has been skipped

This commit is contained in:
Deon George 2024-07-03 12:30:36 +10:00
parent f9ce4a6978
commit 87a4b946ee
2 changed files with 54 additions and 0 deletions

View File

@ -88,6 +88,9 @@
Email.
</div>
@can('wholesaler')
<div class="tab-pane fade" id="billing" role="tabpanel">
@include('service.widget.billinghistory',['o'=>$o])
</div>
<div class="tab-pane fade" id="internal" role="tabpanel">
@if(($x=$o->changes()->where('service__change.active',TRUE)->where('complete',FALSE)->get()->pop()))
@include('service.widget.internal',['o'=>$o,'p'=>$x])

View File

@ -0,0 +1,51 @@
<table class="table table-sm" id="svc_bill_hist">
<thead>
<tr>
<th>Invoice</th>
<th>Due</th>
{{--
<th>Start</th>
<th>Stop</th>
--}}
<th class="text-right">Total</th>
<th class="text-right">Balance</th>
</tr>
</thead>
<tbody>
@foreach($o->account->invoiceSummary($o->invoices->pluck('id')) as $oo)
<tr>
<td><a href="{{ url('u/invoice',$oo->id) }}">{{ $oo->id }}</a></td>
<td>{{ $oo->due_at->format('Y-m-d') }}</td>
{{--
<td>{{ $oo->_start_at->format('Y-m-d') }}</td>
<td>{{ $oo->_stop_at->format('Y-m-d') }}</td>
--}}
<td class="text-right">{{ number_format($oo->_xtotal,2) }}</td>
<th class="text-right">{{ number_format($oo->_xbalance,2) }}</th>
</tr>
@endforeach
</tbody>
{{--
@dump($oo->getAttributes())
@dump($o->invoices()->get())
--}}
</table>
@section('page-scripts')
@css(datatables,bootstrap4)
@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