<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