basis filter added to reports

This commit is contained in:
Sevan Nerse
2021-09-20 10:06:55 +03:00
parent 69aeb32fae
commit 8bdb6e2e98
8 changed files with 62 additions and 5 deletions

View File

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