osb/resources/theme/backend/adminlte/common/invoice/widget/due.blade.php

67 lines
2.1 KiB
PHP
Raw Normal View History

2019-06-02 05:35:48 +00:00
<div class="card card-dark card-outline">
<div class="card-header">
<h4 class="card-title">Invoices Due</h4>
2018-07-16 05:06:43 +00:00
</div>
2018-05-20 12:53:14 +00:00
2019-06-02 05:35:48 +00:00
<div class="card-body">
2018-07-16 05:06:43 +00:00
@if ($user->invoices_due->count())
2019-06-02 05:35:48 +00:00
<table class="table table-striped table-hover" id="invoices" style="width: 100%;">
<thead>
<tr>
<th>Invoice</th>
<th>Total</th>
<th>Due</th>
<th>Date Date</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Count {{ $user->invoices_due->count() }}</th>
{{-- @todo Number format should configured by currency --}}
<th class="right">{{ number_format($user->invoices_due->sum('total'),2) }}</th>
<th class="right">{{ number_format($user->invoices_due->sum('due'),2) }}</th>
<th>&nbsp;</th>
</tr>
</tfoot>
2018-07-16 05:06:43 +00:00
</table>
@else
<p>No invoices due</p>
@endif
</div>
</div>
@section('page-scripts')
2019-06-02 05:35:48 +00:00
@css('https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css','jq-dt-css','jquery');
@js('https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js','jq-dt-js','jquery');
@css('https://cdn.datatables.net/responsive/2.2.1/css/responsive.dataTables.min.css','dt-responsive-css','jq-dt-css')
@js('https://cdn.datatables.net/responsive/2.2.1/js/dataTables.responsive.min.js','dt-responsive-js','jq-dt-js')
@css('https://cdn.datatables.net/rowgroup/1.0.2/css/rowGroup.dataTables.min.css','dt-rowgroup-css','jq-dt-css')
@js('https://cdn.datatables.net/rowgroup/1.0.2/js/dataTables.rowGroup.min.js','dt-rowgroup-js','jq-dt-js')
@css('/plugin/dataTables/dataTables.bootstrap4.css','dt-bootstrap4-css','jq-dt-css')
@js('/plugin/dataTables/dataTables.bootstrap4.js','dt-bootstrap4-js','jq-dt-js')
2018-07-16 05:06:43 +00:00
<script type="text/javascript">
$(document).ready(function() {
$('#invoices').DataTable( {
responsive: true,
ajax: {
url: "/api/u/invoices"
},
columns: [
{ data: "invoice_id_url" },
{ data: "total" },
{ data: "due" },
{ data: "date_due" }
],
language: {
emptyTable: "No Invoices Due"
},
order: [3, 'asc']
});
2018-07-16 05:06:43 +00:00
$('#invoices tbody').on('click','tr', function () {
$(this).toggleClass('selected');
});
});
</script>
2018-08-11 05:09:41 +00:00
@append