close #799 Fixed: Customer Login - Invoice Sorting not working
This commit is contained in:
		@@ -7,10 +7,12 @@
 | 
			
		||||
<div class="box box-success">
 | 
			
		||||
    <div class="box-header with-border">
 | 
			
		||||
        {!! Form::open(['url' => 'customers/invoices', 'role' => 'form', 'method' => 'GET']) !!}
 | 
			
		||||
        <div class="pull-left">
 | 
			
		||||
        <div id="items" class="pull-left box-filter">
 | 
			
		||||
            <span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
 | 
			
		||||
            {!! Form::text('search', request('search'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('general.search_placeholder')]) !!}
 | 
			
		||||
            {!! Form::select('status', $status, request('status'), ['class' => 'form-control input-filter input-sm']) !!}
 | 
			
		||||
            {!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
 | 
			
		||||
            {!! Form::dateRange('invoice_date', trans('invoices.invoice_date'), 'calendar', []) !!}
 | 
			
		||||
            {!! Form::select('statuses[]', $statuses, request('statuses'), ['id' => 'filter-statuses', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
 | 
			
		||||
            {!! Form::button('<span class="fa fa-filter"></span>  ' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="pull-right">
 | 
			
		||||
@@ -24,22 +26,23 @@
 | 
			
		||||
        <div class="table table-responsive">
 | 
			
		||||
            <table class="table table-striped table-hover" id="tbl-invoices">
 | 
			
		||||
                <thead>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <th class="col-md-2">@sortablelink('invoice_number', trans('invoices.invoice_number'))</th>
 | 
			
		||||
                        <th class="col-md-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
 | 
			
		||||
                        <th class="col-md-3 text-right">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
 | 
			
		||||
                        <th class="col-md-3 text-right">@sortablelink('due_at', trans('invoices.due_date'))</th>
 | 
			
		||||
                        <th class="col-md-2 text-center">@sortablelink('status.name', trans_choice('general.statuses', 1))</th>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <th class="col-md-2">@sortablelink('invoice_number', trans_choice('general.numbers', 1))</th>
 | 
			
		||||
                    <th class="col-md-2 text-right amount-space">@sortablelink('amount', trans('general.amount'))</th>
 | 
			
		||||
                    <th class="col-md-3">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
 | 
			
		||||
                    <th class="col-md-3">@sortablelink('due_at', trans('invoices.due_date'))</th>
 | 
			
		||||
                    <th class="col-md-2">@sortablelink('invoice_status_code', trans_choice('general.statuses', 1))</th>
 | 
			
		||||
                </tr>
 | 
			
		||||
                </thead>
 | 
			
		||||
                <tbody>
 | 
			
		||||
                @foreach($invoices as $item)
 | 
			
		||||
                    @php $paid = $item->paid; @endphp
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td><a href="{{ url('customers/invoices/' . $item->id) }}">{{ $item->invoice_number }}</a></td>
 | 
			
		||||
                        <td class="text-right">@money($item->amount, $item->currency_code, true)</td>
 | 
			
		||||
                        <td class="text-right">{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
 | 
			
		||||
                        <td class="text-right">{{ Date::parse($item->due_at)->format($date_format) }}</td>
 | 
			
		||||
                        <td class="text-center"><span class="label {{ $item->status->label }}">{{ trans('invoices.status.' . $item->status->code) }}</span></td>
 | 
			
		||||
                        <td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
 | 
			
		||||
                        <td>{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
 | 
			
		||||
                        <td>{{ Date::parse($item->due_at)->format($date_format) }}</td>
 | 
			
		||||
                        <td><span class="label {{ $item->status->label }}">{{ trans('invoices.status.' . $item->status->code) }}</span></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                @endforeach
 | 
			
		||||
                </tbody>
 | 
			
		||||
@@ -54,3 +57,31 @@
 | 
			
		||||
</div>
 | 
			
		||||
<!-- /.box -->
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@push('js')
 | 
			
		||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
 | 
			
		||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
 | 
			
		||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
 | 
			
		||||
@if (language()->getShortCode() != 'en')
 | 
			
		||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
 | 
			
		||||
@endif
 | 
			
		||||
@endpush
 | 
			
		||||
 | 
			
		||||
@push('css')
 | 
			
		||||
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
 | 
			
		||||
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
 | 
			
		||||
@endpush
 | 
			
		||||
 | 
			
		||||
@push('scripts')
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    $(document).ready(function(){
 | 
			
		||||
        $("#filter-categories").select2({
 | 
			
		||||
            placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        $("#filter-statuses").select2({
 | 
			
		||||
            placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.statuses', 1)]) }}"
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
@endpush
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user