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

@ -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();