Make fiscal year quick link optional.

This commit is contained in:
James Cole 2016-01-29 07:47:18 +01:00
parent a156dce281
commit 7f54b70c24
2 changed files with 7 additions and 7 deletions

View File

@ -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'));
}
/**

View File

@ -108,6 +108,7 @@
accountList
]) }}">{{ 'report_this_year_quick'|_ }}</a>
</li>
{% if customFiscalYear == 1 %}
<li>
<a href="{{ route('reports.report',
['default',
@ -116,6 +117,7 @@
accountList
]) }}">{{ 'report_this_fiscal_year_quick'|_ }}</a>
</li>
{% endif %}
<li>
<a href="{{ route('reports.report',
['default',