This commit is contained in:
James Cole
2018-11-23 08:40:08 +01:00
parent 7a8f6d8660
commit c3fa1612d6
2 changed files with 15 additions and 8 deletions

View File

@@ -329,25 +329,31 @@ class ReportController extends Controller
if (0 === $request->getAccountList()->count()) {
Log::debug('Account count is zero');
session()->flash('error', (string)trans('firefly.select_more_than_one_account'));
session()->flash('error', (string)trans('firefly.select_at_least_one_account'));
return redirect(route('reports.index'));
}
if ('category' === $reportType && 0 === $request->getCategoryList()->count()) {
session()->flash('error', (string)trans('firefly.select_more_than_one_category'));
session()->flash('error', (string)trans('firefly.select_at_least_one_category'));
return redirect(route('reports.index'));
}
if ('budget' === $reportType && 0 === $request->getBudgetList()->count()) {
session()->flash('error', (string)trans('firefly.select_more_than_one_budget'));
session()->flash('error', (string)trans('firefly.select_at_least_one_budget'));
return redirect(route('reports.index'));
}
if ('tag' === $reportType && 0 === $request->getTagList()->count()) {
session()->flash('error', (string)trans('firefly.select_more_than_one_tag'));
session()->flash('error', (string)trans('firefly.select_at_least_one_tag'));
return redirect(route('reports.index'));
}
if ('account' === $reportType && 0 === $request->getExpenseList()->count()) {
session()->flash('error', (string)trans('firefly.select_at_least_one_expense'));
return redirect(route('reports.index'));
}