diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 348b79446f..85c5da1f29 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -151,6 +151,24 @@ class ReportController extends Controller ); } + public function defaultMultiYear($report_type, $start, $end, $accounts) + { + + // list of users stuff: + $budgets = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface')->getActiveBudgets(); + $categories = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface')->getCategories(); + + // and some id's, joined: + $accountIds = []; + /** @var Account $account */ + foreach ($accounts as $account) { + $accountIds[] = $account->id; + } + $accountIds = join(';', $accountIds); + + return view('reports.default.multi-year', compact('budgets', 'accounts', 'categories','start','end','accountIds','report_type')); + } + /** * @param $report_type * @param Carbon $start @@ -172,7 +190,7 @@ class ReportController extends Controller // more than one year date difference means year report. if ($start->diffInMonths($end) > 12) { return view('error')->with('message', 'No report yet for this time period.'); -// return $this->defaultMultiYear($report_type, $start, $end, $accounts); + return $this->defaultMultiYear($report_type, $start, $end, $accounts); } // more than two months date difference means year report. if ($start->diffInMonths($end) > 1) { diff --git a/resources/twig/reports/default/multi-year.twig b/resources/twig/reports/default/multi-year.twig new file mode 100644 index 0000000000..34e6935dbd --- /dev/null +++ b/resources/twig/reports/default/multi-year.twig @@ -0,0 +1,98 @@ +{% extends "./layout/default.twig" %} + +{% block breadcrumbs %} + {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end) }} +{% endblock %} + +{% block content %} + +
+
+
+
+

{{ 'incomeVsExpenses'|_ }}

+
+
+ {% if Config.get('firefly.chart') == 'google' %} +
+ {% endif %} + {% if Config.get('firefly.chart') == 'chartjs' %} + + {% endif %} +
+
+
+
+ + {% for account in accounts %} +
+
+
+
+

{{ account.name }}

+
+
+ Box box +
+
+
+
+ {% endfor %} + +
+
+
+
+

Budgets

+
+
+ Select budget, chart. +
+
+
+
+ +
+
+
+
+

Categories

+
+
+ Select budget, chart. +
+
+
+
+ + +{% endblock %} +{% block styles %} + +{% endblock %} +{% block scripts %} + + + + + {% if Config.get('firefly.chart') == 'google' %} + + + {% endif %} + {% if Config.get('firefly.chart') == 'chartjs' %} + + + {% endif %} + + + +{% endblock %}