mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-30 20:54:04 -06:00
Possible fix for reports [skip ci]
This commit is contained in:
parent
fb649779d6
commit
2f8263f53a
@ -50,18 +50,11 @@ class ReportController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param ReportHelperInterface $helper
|
|
||||||
*/
|
*/
|
||||||
public function __construct(ReportHelperInterface $helper)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->helper = $helper;
|
|
||||||
$this->accountHelper = app(AccountReportHelperInterface::class);
|
|
||||||
$this->budgetHelper = app(BudgetReportHelperInterface::class);
|
|
||||||
$this->balanceHelper = app(BalanceReportHelperInterface::class);
|
|
||||||
|
|
||||||
View::share('title', trans('firefly.reports'));
|
View::share('title', trans('firefly.reports'));
|
||||||
View::share('mainTitleIcon', 'fa-line-chart');
|
View::share('mainTitleIcon', 'fa-line-chart');
|
||||||
|
|
||||||
@ -74,6 +67,7 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(AccountCrudInterface $crud)
|
public function index(AccountCrudInterface $crud)
|
||||||
{
|
{
|
||||||
|
$this->createRepositories();
|
||||||
/** @var Carbon $start */
|
/** @var Carbon $start */
|
||||||
$start = clone session('first');
|
$start = clone session('first');
|
||||||
$months = $this->helper->listOfMonths($start);
|
$months = $this->helper->listOfMonths($start);
|
||||||
@ -104,6 +98,7 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function report(string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
public function report(string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
||||||
{
|
{
|
||||||
|
$this->createRepositories();
|
||||||
// throw an error if necessary.
|
// throw an error if necessary.
|
||||||
if ($end < $start) {
|
if ($end < $start) {
|
||||||
throw new FireflyException('End date cannot be before start date, silly!');
|
throw new FireflyException('End date cannot be before start date, silly!');
|
||||||
@ -230,6 +225,17 @@ class ReportController extends Controller
|
|||||||
return view('reports.audit.report', compact('start', 'end', 'reportType', 'accountIds', 'accounts', 'auditData', 'hideable', 'defaultShow'));
|
return view('reports.audit.report', compact('start', 'end', 'reportType', 'accountIds', 'accounts', 'auditData', 'hideable', 'defaultShow'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private function createRepositories()
|
||||||
|
{
|
||||||
|
$this->helper = app(ReportHelperInterface::class);
|
||||||
|
$this->accountHelper = app(AccountReportHelperInterface::class);
|
||||||
|
$this->budgetHelper = app(BudgetReportHelperInterface::class);
|
||||||
|
$this->balanceHelper = app(BalanceReportHelperInterface::class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $reportType
|
* @param $reportType
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
|
Loading…
Reference in New Issue
Block a user