date filter on dashboard will work fiscal year based akaunting/software#78

This commit is contained in:
Sevan Nerse
2021-03-23 17:32:39 +03:00
parent 468b84354c
commit 6c44c53a60
2 changed files with 11 additions and 7 deletions

View File

@ -50,13 +50,6 @@ class Dashboards extends Controller
*/
public function show($dashboard_id = null)
{
$date_picker_shortcuts = $this->getDatePickerShortcuts();
if (!request()->has('start_date')) {
request()->merge(['start_date' => $date_picker_shortcuts[trans('reports.this_year')]['start']]);
request()->merge(['end_date' => $date_picker_shortcuts[trans('reports.this_year')]['end']]);
}
$dashboard_id = $dashboard_id ?? session('dashboard_id');
try {
@ -79,6 +72,13 @@ class Dashboards extends Controller
return Widgets::canShow($widget->class);
});
$date_picker_shortcuts = $this->getDatePickerShortcuts();
if (!request()->has('start_date')) {
request()->merge(['start_date' => $date_picker_shortcuts[trans('reports.this_year')]['start']]);
request()->merge(['end_date' => $date_picker_shortcuts[trans('reports.this_year')]['end']]);
}
return view('common.dashboards.show', compact('dashboard', 'widgets', 'date_picker_shortcuts'));
}