This commit is contained in:
James Cole
2015-12-18 08:10:41 +01:00
parent a7bd1c6892
commit 4210cd10db
4 changed files with 142 additions and 146 deletions

View File

@@ -46,18 +46,17 @@ class ReportController extends Controller
$months = $this->helper->listOfMonths($start);
// does the user have shared accounts?
$accounts = $repository->getAccounts(['Default account', 'Asset account']);
$hasShared = false;
$accounts = $repository->getAccounts(['Default account', 'Asset account']);
// get id's for quick links:
$accountIds = [];
/** @var Account $account */
foreach ($accounts as $account) {
if ($account->getMeta('accountRole') == 'sharedAsset') {
$hasShared = true;
}
foreach($accounts as $account) {
$accountIds [] = $account->id;
}
$accountList = join(',',$accountIds);
return view('reports.index', compact('months', 'accounts', 'hasShared', 'start'));
return view('reports.index', compact('months', 'accounts', 'start','accountList'));
}
/**
@@ -182,7 +181,7 @@ class ReportController extends Controller
}
// lower threshold
if($start < Session::get('first')) {
if ($start < Session::get('first')) {
$start = Session::get('first');
}
@@ -192,12 +191,12 @@ class ReportController extends Controller
View::share(
'subTitle', trans(
'firefly.report_default',
[
'start' => $start->formatLocalized($this->monthFormat),
'end' => $end->formatLocalized($this->monthFormat)
]
)
'firefly.report_default',
[
'start' => $start->formatLocalized($this->monthFormat),
'end' => $end->formatLocalized($this->monthFormat)
]
)
);
View::share('subTitleIcon', 'fa-calendar');