added multi-select filters everywhere

This commit is contained in:
denisdulici 2018-11-02 11:32:42 +03:00
parent b0a7e98e4e
commit 9a85bb9f5a
25 changed files with 202 additions and 86 deletions

View File

@ -14,8 +14,8 @@ class Reconciliations extends ModelFilter
*/
public $relations = [];
public function account($account)
public function accounts($accounts)
{
return $this->where('account_id', $account);
return $this->whereIn('account_id', (array) $accounts);
}
}

View File

@ -14,19 +14,19 @@ class Transactions extends ModelFilter
*/
public $relations = [];
public function account($account_id)
public function accounts($accounts)
{
return $this->where('account_id', $account_id);
return $this->whereIn('account_id', (array) $accounts);
}
public function category($category_id)
public function categories($categories)
{
// No category for bills/invoices
if (in_array($this->getModel()->getTable(), ['bill_payments', 'invoice_payments'])) {
return $this;
}
return $this->where('category_id', $category_id);
return $this->whereIn('category_id', (array) $categories);
}
public function date($date)

View File

@ -19,8 +19,8 @@ class Items extends ModelFilter
return $this->whereLike('name', $query);
}
public function category($id)
public function categories($ids)
{
return $this->where('category_id', $id);
return $this->whereIn('category_id', (array) $ids);
}
}

View File

@ -19,14 +19,19 @@ class Bills extends ModelFilter
return $this->whereLike('vendor_name', $query);
}
public function vendor($vendor)
public function vendors($vendors)
{
return $this->where('vendor_id', $vendor);
return $this->whereIn('vendor_id', (array) $vendors);
}
public function status($status)
public function categories($categories)
{
return $this->where('bill_status_code', $status);
return $this->whereIn('category_id', (array) $categories);
}
public function statuses($statuses)
{
return $this->whereIn('bill_status_code', (array) $statuses);
}
public function billDate($date)

View File

@ -19,19 +19,19 @@ class Payments extends ModelFilter
return $this->whereLike('description', $query);
}
public function vendor($vendor)
public function vendors($vendors)
{
return $this->where('vendor_id', $vendor);
return $this->whereIn('vendor_id', (array) $vendors);
}
public function category($category)
public function categories($categories)
{
return $this->where('category_id', $category);
return $this->whereIn('category_id', (array) $categories);
}
public function account($account)
public function accounts($accounts)
{
return $this->where('account_id', $account);
return $this->whereIn('account_id', (array) $accounts);
}
public function date($date)

View File

@ -19,14 +19,19 @@ class Invoices extends ModelFilter
return $this->whereLike('customer_name', $query);
}
public function customer($customer)
public function customers($customers)
{
return $this->where('customer_id', $customer);
return $this->whereIn('customer_id', (array) $customers);
}
public function status($status)
public function categories($categories)
{
return $this->where('invoice_status_code', $status);
return $this->whereIn('category_id', (array) $categories);
}
public function statuses($statuses)
{
return $this->whereIn('invoice_status_code', (array) $statuses);
}
public function invoiceDate($date)

View File

@ -19,19 +19,19 @@ class Revenues extends ModelFilter
return $this->whereLike('description', $query);
}
public function customer($customer)
public function customers($customers)
{
return $this->where('customer_id', $customer);
return $this->whereIn('customer_id', (array) $customers);
}
public function category($category)
public function categories($categories)
{
return $this->where('category_id', $category);
return $this->whereIn('category_id', (array) $categories);
}
public function account($account)
public function accounts($accounts)
{
return $this->where('account_id', $account);
return $this->whereIn('account_id', (array) $accounts);
}
public function date($date)

View File

@ -19,8 +19,8 @@ class Categories extends ModelFilter
return $this->whereLike('name', $query);
}
public function type($type)
public function types($types)
{
return $this->where('type', $type);
return $this->whereIn('type', (array) $types);
}
}

View File

@ -20,8 +20,7 @@ class Reconciliations extends Controller
{
$reconciliations = Reconciliation::collect();
$accounts = collect(Account::enabled()->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
$accounts = collect(Account::enabled()->orderBy('name')->pluck('name', 'id'));
return view('banking.reconciliations.index', compact('reconciliations', 'accounts'));
}

View File

@ -25,8 +25,7 @@ class Transactions extends Controller
{
$request = request();
$accounts = collect(Account::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
$accounts = collect(Account::enabled()->pluck('name', 'id'));
$types = collect(['expense' => 'Expense', 'income' => 'Income'])
->prepend(trans('general.all_type', ['type' => trans_choice('general.types', 2)]), '');
@ -34,8 +33,7 @@ class Transactions extends Controller
$type = $request->get('type');
$type_cats = empty($type) ? ['income', 'expense'] : $type;
$categories = collect(Category::enabled()->type($type_cats)->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');
$categories = collect(Category::enabled()->type($type_cats)->pluck('name', 'id'));
if ($type != 'income') {
$this->addTransactions(Payment::collect(['paid_at'=> 'desc']), trans_choice('general.expenses', 1));

View File

@ -26,8 +26,7 @@ class Items extends Controller
{
$items = Item::with('category')->collect();
$categories = Category::enabled()->orderBy('name')->type('item')->pluck('name', 'id')
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');
$categories = Category::enabled()->orderBy('name')->type('item')->pluck('name', 'id');
return view('common.items.index', compact('items', 'categories'));
}

View File

@ -47,13 +47,13 @@ class Bills extends Controller
{
$bills = Bill::with(['vendor', 'status', 'items', 'payments', 'histories'])->collect(['billed_at'=> 'desc']);
$vendors = collect(Vendor::enabled()->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.vendors', 2)]), '');
$vendors = collect(Vendor::enabled()->orderBy('name')->pluck('name', 'id'));
$statuses = collect(BillStatus::all()->pluck('name', 'code'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.statuses', 2)]), '');
$categories = collect(Category::enabled()->type('expense')->orderBy('name')->pluck('name', 'id'));
return view('expenses.bills.index', compact('bills', 'vendors', 'statuses'));
$statuses = collect(BillStatus::all()->pluck('name', 'code'));
return view('expenses.bills.index', compact('bills', 'vendors', 'categories', 'statuses'));
}
/**

View File

@ -27,14 +27,11 @@ class Payments extends Controller
{
$payments = Payment::with(['vendor', 'account', 'category'])->isNotTransfer()->collect(['paid_at'=> 'desc']);
$vendors = collect(Vendor::enabled()->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.vendors', 2)]), '');
$vendors = collect(Vendor::enabled()->orderBy('name')->pluck('name', 'id'));
$categories = collect(Category::enabled()->type('expense')->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');
$categories = collect(Category::enabled()->type('expense')->orderBy('name')->pluck('name', 'id'));
$accounts = collect(Account::enabled()->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
$accounts = collect(Account::enabled()->orderBy('name')->pluck('name', 'id'));
$transfer_cat_id = Category::transfer();

View File

@ -52,13 +52,13 @@ class Invoices extends Controller
{
$invoices = Invoice::with(['customer', 'status', 'items', 'payments', 'histories'])->collect(['invoice_number'=> 'desc']);
$customers = collect(Customer::enabled()->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.customers', 2)]), '');
$customers = collect(Customer::enabled()->orderBy('name')->pluck('name', 'id'));
$status = collect(InvoiceStatus::all()->pluck('name', 'code'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.statuses', 2)]), '');
$categories = collect(Category::enabled()->type('income')->orderBy('name')->pluck('name', 'id'));
return view('incomes.invoices.index', compact('invoices', 'customers', 'status'));
$statuses = collect(InvoiceStatus::all()->pluck('name', 'code'));
return view('incomes.invoices.index', compact('invoices', 'customers', 'categories', 'statuses'));
}
/**

View File

@ -29,14 +29,11 @@ class Revenues extends Controller
{
$revenues = Revenue::with(['account', 'category', 'customer'])->isNotTransfer()->collect(['paid_at'=> 'desc']);
$customers = collect(Customer::enabled()->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.customers', 2)]), '');
$customers = collect(Customer::enabled()->orderBy('name')->pluck('name', 'id'));
$categories = collect(Category::enabled()->type('income')->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');
$categories = collect(Category::enabled()->type('income')->orderBy('name')->pluck('name', 'id'));
$accounts = collect(Account::enabled()->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
$accounts = collect(Account::enabled()->orderBy('name')->pluck('name', 'id'));
$transfer_cat_id = Category::transfer();

View File

@ -25,7 +25,7 @@ class Categories extends Controller
'income' => trans_choice('general.incomes', 1),
'item' => trans_choice('general.items', 1),
'other' => trans_choice('general.others', 1),
])->prepend(trans('general.all_type', ['type' => trans_choice('general.types', 2)]), '');
]);
return view('settings.categories.index', compact('categories', 'types', 'transfer_id'));
}

View File

@ -13,9 +13,9 @@
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'banking/reconciliations', '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::select('account', $accounts, request('account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
@ -83,3 +83,12 @@
<!-- /.box -->
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-accounts").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
});
</script>
@endpush

View File

@ -7,12 +7,12 @@
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'banking/transactions', '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::select('account', $accounts, request('account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('type', $types, request('type'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('category', $categories, request('category'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('type', $types, request('type'), ['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::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
@ -71,3 +71,17 @@
<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-accounts").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#filter-categories").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
});
</script>
@endpush

View File

@ -15,9 +15,9 @@
{!! Form::open(['url' => 'banking/transfers', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-left">
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::select('from_account', $accounts, request('from_account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('to_account', $accounts, request('to_account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">

View File

@ -15,10 +15,10 @@
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['route' => 'items.index', '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('category', $categories, request('category'), ['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::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
@ -98,3 +98,13 @@
</div>
<!-- /.box -->
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-categories").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
});
</script>
@endpush

View File

@ -15,12 +15,13 @@
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'expenses/bills', '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('vendor', $vendors, request('vendor'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('status', $statuses, request('status'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('vendors[]', $vendors, request('vendors'), ['id' => 'filter-vendors', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::dateRange('bill_date', trans('bills.bill_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> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
@ -105,3 +106,21 @@
<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-vendors").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)]) }}"
});
$("#filter-statuses").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.statuses', 1)]) }}"
});
});
</script>
@endpush

View File

@ -15,13 +15,13 @@
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'expenses/payments', '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('vendor', $vendors, request('vendor'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('category', $categories, request('category'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('account', $accounts, request('account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::select('vendors[]', $vendors, request('vendors'), ['id' => 'filter-vendors', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
@ -108,3 +108,20 @@
<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-vendors").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)]) }}"
});
$("#filter-accounts").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
});
</script>
@endpush

View File

@ -15,12 +15,13 @@
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'incomes/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('customer', $customers, request('customer'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('status', $status, request('status'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('customers[]', $customers, request('customers'), ['id' => 'filter-customers', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! 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> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
@ -104,3 +105,21 @@
<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-customers").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
});
$("#filter-statuses").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.statuses', 1)]) }}"
});
});
</script>
@endpush

View File

@ -15,13 +15,13 @@
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'incomes/revenues', '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('customer', $customers, request('customer'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('category', $categories, request('category'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('account', $accounts, request('account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::select('customers[]', $customers, request('customers'), ['id' => 'filter-customers', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
@ -108,3 +108,21 @@
<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-customers").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
});
$("#filter-accounts").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
});
</script>
@endpush

View File

@ -13,10 +13,10 @@
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'settings/categories', '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('type', $types, request('type'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('types[]', $types, request('types'), ['id' => 'filter-types', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
@ -88,3 +88,13 @@
</div>
<!-- /.box -->
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-types").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]) }}"
});
});
</script>
@endpush