Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix #1386
James Cole4031057bc049
diff --git a/app/Support/Binder/AccountList.php b/app/Support/Binder/AccountList.phpindex 24b249db28..2c1baab334 100644--- a/app/Support/Binder/AccountList.php+++ b/app/Support/Binder/AccountList.php@@ -23,6 +23,7 @@ declare(strict_types=1);namespace FireflyIII\Support\Binder;use FireflyIII\Models\Account;+use FireflyIII\Models\AccountType;use Illuminate\Routing\Route;use Illuminate\Support\Collection;use Log;@@ -44,22 +45,35 @@ class AccountList implements BinderInterfacepublic static function routeBinder(string $value, Route $route): Collection{if (auth()->check()) {- $list = [];- $incoming = explode(',', $value);- foreach ($incoming as $entry) {- $list[] = (int)$entry;++ $collection = new Collection;+ if ($value === 'allAssetAccounts') {+ /** @var \Illuminate\Support\Collection $collection */+ $collection = auth()->user()->accounts()+ ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')+ ->where('account_types.type', AccountType::ASSET)+ ->get(['accounts.*']);}- $list = array_unique($list);- if (\count($list) === 0) {- Log::error('Account list is empty.');- throw new NotFoundHttpException; // @codeCoverageIgnore+ if ($value !== 'allAssetAccounts') {++ $list = [];+ $incoming = explode(',', $value);+ foreach ($incoming as $entry) {+ $list[] = (int)$entry;+ }+ $list = array_unique($list);+ if (\count($list) === 0) {+ Log::error('Account list is empty.');+ throw new NotFoundHttpException; // @codeCoverageIgnore+ }++ /** @var \Illuminate\Support\Collection $collection */+ $collection = auth()->user()->accounts()+ ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')+ ->whereIn('accounts.id', $list)+ ->get(['accounts.*']);}- /** @var \Illuminate\Support\Collection $collection */- $collection = auth()->user()->accounts()- ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')- ->whereIn('accounts.id', $list)- ->get(['accounts.*']);if ($collection->count() > 0) {$collection = $collection->sortBy(function (Account $account) {diff --git a/public/css/firefly.css b/public/css/firefly.cssindex 25487e0ffe..dacc76681a 100644--- a/public/css/firefly.css+++ b/public/css/firefly.css@@ -153,7 +153,7 @@ body.waiting * {}span.info-box-text a, span.info-box-number a {- color: #000;+ color: #fff;}span.info-box-icon a {@@ -161,7 +161,7 @@ span.info-box-icon a {}span.info-box-text a:hover, span.info-box-number a:hover {- color: #000;+ color: #fff;text-decoration: underline;}@@ -169,4 +169,4 @@ span.info-box-text a:hover, span.info-box-number a:hover {max-height: 300px;overflow-y: auto;overflow-x: hidden;-}\ No newline at end of file+}diff --git a/resources/views/partials/boxes.twig b/resources/views/partials/boxes.twigindex 583e00f2a2..68708cbc25 100644--- a/resources/views/partials/boxes.twig+++ b/resources/views/partials/boxes.twig@@ -6,7 +6,8 @@<span class="info-box-icon"><i class="fa fa-balance-scale"></i></span><div class="info-box-content">- <span class="info-box-text">{{ 'balance'|_ }}</span>+ <span class="info-box-text">+ <a href="{{ route('reports.report.default', ['allAssetAccounts','currentMonthStart','currentMonthEnd']) }}">{{ 'balance'|_ }}</a></span><span class="info-box-number" id="box-balance-sums"></span><div class="progress" id="box-balance-progress">@@ -14,7 +15,6 @@</div><span class="progress-description"><span id="box-balance-list" ></span>- <!--<span title="{{ 'expenses'|_ }}" id="box-balance-out"></span> / <span title="{{ 'income'|_ }}" id="box-balance-in"></span>--></span></div></div>@@ -26,7 +26,7 @@<span class="info-box-icon"><i class="fa fa-calendar-o"></i></span><div class="info-box-content">- <span class="info-box-text">{{ 'bills_to_pay'|_ }}</span>+ <span class="info-box-text"><a href="{{ route('bills.index') }}">{{ 'bills_to_pay'|_ }}</a></span><span class="info-box-number" id="box-bills-unpaid"></span><div class="progress">@@ -45,7 +45,7 @@<div class="info-box bg-green-gradient" id="box-left-to-spend-box"><span class="info-box-icon"><i class="fa fa-money"></i></span><div class="info-box-content">- <span class="info-box-text" id="box-left-to-spend-text">{{ 'left_to_spend'|_ }}</span>+ <span class="info-box-text"><a id="box-left-to-spend-text" href="{{ route('budgets.index') }}">{{ 'left_to_spend'|_ }}</a></span><span class="info-box-number" id="box-left-to-spend"></span><div class="progress">@@ -65,7 +65,8 @@<span class="info-box-icon"><i class="fa fa-line-chart"></i></span><div class="info-box-content">- <span class="info-box-text">{{ 'net_worth'|_ }}</span>+ <span class="info-box-text">+ <a href="{{ route('reports.report.default', ['allAssetAccounts','currentYearStart','currentYearEnd']) }}">{{ 'net_worth'|_ }}</a></span><span class="info-box-number" id="box-net-worth"></span><div class="progress">