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

@ -46,7 +46,7 @@ class Invoices extends Controller
}
$status = collect(InvoiceStatus::all()->pluck('name', 'code'))
->prepend(trans('general.all_statuses'), '');
->prepend(trans('general.all_type', ['type' => trans_choice('general.statuses', 2)]), '');
return view('customers.invoices.index', compact('invoices', 'status'));
}

View File

@ -38,10 +38,13 @@ class Bills extends Controller
{
$bills = Bill::with('status')->collect();
$status = collect(BillStatus::all()->pluck('name', 'code'))
->prepend(trans('general.all_statuses'), '');
$vendors = collect(Vendor::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.vendors', 2)]), '');
return view('expenses.bills.index', compact('bills', 'status'));
$status = collect(BillStatus::all()->pluck('name', 'code'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.statuses', 2)]), '');
return view('expenses.bills.index', compact('bills', 'vendors', 'status'));
}
/**

View File

@ -24,13 +24,16 @@ class Payments extends Controller
{
$payments = Payment::with(['account', 'category'])->collect();
$vendors = collect(Vendor::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.vendors', 2)]), '');
$categories = collect(Category::enabled()->type('expense')->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('expenses.payments.index', compact('payments', 'categories', 'accounts'));
return view('expenses.payments.index', compact('payments', 'vendors', 'categories', 'accounts'));
}
/**

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'));
}