From 7f54b70c248a690bdeb59f2f007045dccf7bc2f7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 29 Jan 2016 07:47:18 +0100 Subject: [PATCH] Make fiscal year quick link optional. --- app/Http/Controllers/ReportController.php | 12 +++++------- resources/views/reports/index.twig | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 72a3d2fc6f..c917fef16c 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -5,6 +5,7 @@ use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; use Illuminate\Support\Collection; +use Preferences; use Session; use View; @@ -166,8 +167,9 @@ class ReportController extends Controller */ public function index(ARI $repository) { - $start = Session::get('first'); - $months = $this->helper->listOfMonths($start); + $start = Session::get('first'); + $months = $this->helper->listOfMonths($start); + $customFiscalYear = Preferences::get('customFiscalYear', 0)->data; // does the user have shared accounts? $accounts = $repository->getAccounts(['Default account', 'Asset account']); @@ -180,11 +182,7 @@ class ReportController extends Controller $accountList = join(',', $accountIds); - return view( - 'reports.index', compact( - 'months', 'accounts', 'start', 'accountList' - ) - ); + return view('reports.index', compact('months', 'accounts', 'start', 'accountList','customFiscalYear')); } /** diff --git a/resources/views/reports/index.twig b/resources/views/reports/index.twig index f79e8eb82c..fd48397fb2 100644 --- a/resources/views/reports/index.twig +++ b/resources/views/reports/index.twig @@ -108,6 +108,7 @@ accountList ]) }}">{{ 'report_this_year_quick'|_ }} + {% if customFiscalYear == 1 %}
  • {{ 'report_this_fiscal_year_quick'|_ }}
  • + {% endif %}