Merge pull request #2257 from sevannerse/basis-default-filter-reports
Basis default filter reports
This commit is contained in:
@ -114,6 +114,14 @@ abstract class Report
|
||||
return $model->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
public function getBasis()
|
||||
{
|
||||
return [
|
||||
'cash' => trans('general.cash'),
|
||||
'accrual' => trans('general.accrual'),
|
||||
];
|
||||
}
|
||||
|
||||
public function applyDateFilter($event)
|
||||
{
|
||||
$event->model->monthsOfYear($event->args['date_field']);
|
||||
@ -127,6 +135,10 @@ abstract class Report
|
||||
$search_year = 'year:' . $this->getSearchStringValue('year', '', $input);
|
||||
$input = str_replace($search_year, '', $input);
|
||||
|
||||
// Remove basis as it's handled based on report itself
|
||||
$search_basis = 'basis:' . $this->getSearchStringValue('basis', 'accrual', $input);
|
||||
$input = str_replace($search_basis, '', $input);
|
||||
|
||||
$event->model->usingSearchString($input);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user