improve filters

This commit is contained in:
denisdulici
2017-09-27 21:40:25 +03:00
parent e4267c7f4a
commit 47f7b5b20e
26 changed files with 62 additions and 29 deletions

View File

@ -40,10 +40,13 @@ class Invoices extends Controller
{
$invoices = Invoice::with('status')->collect();
$status = collect(InvoiceStatus::all()->pluck('name', 'code'))
->prepend(trans('general.all_statuses'), '');
$customers = collect(Customer::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.customers', 2)]), '');
return view('incomes.invoices.index', compact('invoices', 'status'));
$status = collect(InvoiceStatus::all()->pluck('name', 'code'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.statuses', 2)]), '');
return view('incomes.invoices.index', compact('invoices', 'customers', 'status'));
}
/**

View File

@ -28,13 +28,13 @@ class Revenues extends Controller
$revenues = Revenue::with(['account', 'category', 'customer'])->collect();
$customers = collect(Customer::enabled()->pluck('name', 'id'))
->prepend(trans('customer.all'), '');
->prepend(trans('general.all_type', ['type' => trans_choice('general.customers', 2)]), '');
$categories = collect(Category::enabled()->type('income')->pluck('name', 'id'))
->prepend(trans('categories.all'), '');
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');
$accounts = collect(Account::enabled()->pluck('name', 'id'))
->prepend(trans('accounts.all'), '');
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
return view('incomes.revenues.index', compact('revenues', 'customers', 'categories', 'accounts'));
}