diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 92cd33233a..dc6fe0cf13 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -53,6 +53,7 @@ class AccountController extends Controller $cache->addProperty('all'); $cache->addProperty('accounts'); $cache->addProperty('default'); + $cache->addProperty($reportType); $cache->addProperty($accounts); if ($cache->has()) { return Response::json($cache->get()); // @codeCoverageIgnore diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index ebd258c680..1c2a68651a 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -49,6 +49,7 @@ class ReportController extends Controller $cache = new CacheProperties; $cache->addProperty('yearInOut'); $cache->addProperty($start); + $cache->addProperty($reportType); $cache->addProperty($accounts); $cache->addProperty($end); if ($cache->has()) { @@ -115,6 +116,7 @@ class ReportController extends Controller $cache->addProperty('yearInOutSummarized'); $cache->addProperty($start); $cache->addProperty($end); + $cache->addProperty($reportType); $cache->addProperty($accounts); if ($cache->has()) { return Response::json($cache->get()); // @codeCoverageIgnore diff --git a/app/Http/Controllers/CsvController.php b/app/Http/Controllers/CsvController.php index f2cac49ff6..bde7d5b7e0 100644 --- a/app/Http/Controllers/CsvController.php +++ b/app/Http/Controllers/CsvController.php @@ -146,7 +146,7 @@ class CsvController extends Controller * * STEP ONE * - * @param AccountRepositoryInterface $repository + * @param ARI $repository * * @return \Illuminate\View\View */ diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 8b431fdd72..6c33fccc8c 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -157,7 +157,7 @@ class PiggyBankController extends Controller } /** - * @param AccountRepositoryInterface $repository + * @param ARI $repository * @param PiggyBankRepositoryInterface $piggyRepository * * @return View diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index a11d1d9e99..5cc1d665de 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -54,8 +54,9 @@ class Authenticate return redirect()->guest('auth/login'); } } - - if ($this->auth->user() instanceof User && intval($this->auth->user()->blocked) == 1) { + /** @var User $user */ + $user = $this->auth->user(); + if ($user instanceof User && intval($user->blocked) == 1) { Auth::logout(); return redirect()->route('index'); diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index e429509482..f4c6487c1d 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -355,9 +355,9 @@ Breadcrumbs::register( $breadcrumbs->parent('reports.index'); $monthFormat = trans('config.month_and_day'); - $title = trans('firefly.report_default', ['start' => $start->formatLocalized($monthFormat), 'end' => $end->formatLocalized($monthFormat)]); + $title = trans('firefly.report_' . $reportType, ['start' => $start->formatLocalized($monthFormat), 'end' => $end->formatLocalized($monthFormat)]); - $breadcrumbs->push($title, route('reports.report', ['url' => 'abcde'])); + $breadcrumbs->push($title, route('reports.report', [$reportType, $start->format('Ymd'), $end->format('Ymd'), join(',', $accountIds)])); } ); diff --git a/app/Models/Account.php b/app/Models/Account.php index b3967b1da4..683310dbfc 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -1,53 +1,38 @@ pluck('id')->toArray(); $budgetIds = $budgets->pluck('id')->toArray(); $set = Auth::user()->transactionjournals() @@ -740,8 +739,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn ->transactionTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER, TransactionType::OPENING_BALANCE]) ->get( [ - 't_from.account_id', - 'budget_transaction_journal.budget_id', + 't_from.account_id', 'budget_transaction_journal.budget_id', DB::Raw('SUM(`t_from`.`amount`) AS `spent`') ] ); diff --git a/app/Support/Steam.php b/app/Support/Steam.php index de77081704..4a2a733355 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -77,9 +77,9 @@ class Steam * * [yyyy-mm-dd] => 123,2 * - * @param Account $account - * @param Carbon $start - * @param Carbon $end + * @param \FireflyIII\Models\Account $account + * @param \Carbon\Carbon $start + * @param \Carbon\Carbon $end * * @return array */ diff --git a/app/User.php b/app/User.php index 2fd0ae8fdf..d1924bbccc 100644 --- a/app/User.php +++ b/app/User.php @@ -1,43 +1,55 @@