Revamp multi-account report.

This commit is contained in:
James Cole
2019-09-03 22:35:41 +02:00
parent 4743230136
commit 47de2fec28
29 changed files with 2286 additions and 628 deletions

View File

@@ -80,18 +80,18 @@ class ReportController extends Controller
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|string
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function accountReport(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
public function doubleReport(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
{
if ($end < $start) {
return view('error')->with('message', (string)trans('firefly.end_after_start_date')); // @codeCoverageIgnore
[$start, $end] = [$end, $start];
}
$this->repository->cleanupBudgets();
app('view')->share(
'subTitle', trans(
'firefly.report_account',
['start' => $start->formatLocalized($this->monthFormat), 'end' => $end->formatLocalized($this->monthFormat)]
'firefly.report_double',
['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)]
)
);
@@ -292,8 +292,8 @@ class ReportController extends Controller
case 'tag':
$result = $this->tagReportOptions();
break;
case 'account':
$result = $this->accountReportOptions();
case 'double':
$result = $this->doubleReportOptions();
break;
}
@@ -348,7 +348,7 @@ class ReportController extends Controller
return redirect(route('reports.index'));
}
if ('account' === $reportType && 0 === $request->getDoubleList()->count()) {
if ('double' === $reportType && 0 === $request->getDoubleList()->count()) {
session()->flash('error', (string)trans('firefly.select_at_least_one_expense'));
return redirect(route('reports.index'));
@@ -374,8 +374,8 @@ class ReportController extends Controller
case 'tag':
$uri = route('reports.report.tag', [$accounts, $tags, $start, $end]);
break;
case 'account':
$uri = route('reports.report.account', [$accounts, $double, $start, $end]);
case 'double':
$uri = route('reports.report.double', [$accounts, $double, $start, $end]);
break;
}