mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 09:51:40 +00:00
Fix #1386
This commit is contained in:
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Support\Binder;
|
namespace FireflyIII\Support\Binder;
|
||||||
|
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
|
use FireflyIII\Models\AccountType;
|
||||||
use Illuminate\Routing\Route;
|
use Illuminate\Routing\Route;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
@@ -44,22 +45,35 @@ class AccountList implements BinderInterface
|
|||||||
public static function routeBinder(string $value, Route $route): Collection
|
public static function routeBinder(string $value, Route $route): Collection
|
||||||
{
|
{
|
||||||
if (auth()->check()) {
|
if (auth()->check()) {
|
||||||
$list = [];
|
|
||||||
$incoming = explode(',', $value);
|
$collection = new Collection;
|
||||||
foreach ($incoming as $entry) {
|
if ($value === 'allAssetAccounts') {
|
||||||
$list[] = (int)$entry;
|
/** @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 ($value !== 'allAssetAccounts') {
|
||||||
if (\count($list) === 0) {
|
|
||||||
Log::error('Account list is empty.');
|
$list = [];
|
||||||
throw new NotFoundHttpException; // @codeCoverageIgnore
|
$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) {
|
if ($collection->count() > 0) {
|
||||||
$collection = $collection->sortBy(
|
$collection = $collection->sortBy(
|
||||||
function (Account $account) {
|
function (Account $account) {
|
||||||
|
6
public/css/firefly.css
vendored
6
public/css/firefly.css
vendored
@@ -153,7 +153,7 @@ body.waiting * {
|
|||||||
}
|
}
|
||||||
|
|
||||||
span.info-box-text a, span.info-box-number a {
|
span.info-box-text a, span.info-box-number a {
|
||||||
color: #000;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
span.info-box-icon a {
|
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 {
|
span.info-box-text a:hover, span.info-box-number a:hover {
|
||||||
color: #000;
|
color: #fff;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,4 +169,4 @@ span.info-box-text a:hover, span.info-box-number a:hover {
|
|||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,8 @@
|
|||||||
<span class="info-box-icon"><i class="fa fa-balance-scale"></i></span>
|
<span class="info-box-icon"><i class="fa fa-balance-scale"></i></span>
|
||||||
|
|
||||||
<div class="info-box-content">
|
<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>
|
<span class="info-box-number" id="box-balance-sums"></span>
|
||||||
|
|
||||||
<div class="progress" id="box-balance-progress">
|
<div class="progress" id="box-balance-progress">
|
||||||
@@ -14,7 +15,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<span class="progress-description">
|
<span class="progress-description">
|
||||||
<span id="box-balance-list" ></span>
|
<span id="box-balance-list" ></span>
|
||||||
<!--<span title="{{ 'expenses'|_ }}" id="box-balance-out"></span> / <span title="{{ 'income'|_ }}" id="box-balance-in"></span>-->
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<span class="info-box-icon"><i class="fa fa-calendar-o"></i></span>
|
<span class="info-box-icon"><i class="fa fa-calendar-o"></i></span>
|
||||||
|
|
||||||
<div class="info-box-content">
|
<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>
|
<span class="info-box-number" id="box-bills-unpaid"></span>
|
||||||
|
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<div class="info-box bg-green-gradient" id="box-left-to-spend-box">
|
<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>
|
<span class="info-box-icon"><i class="fa fa-money"></i></span>
|
||||||
<div class="info-box-content">
|
<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>
|
<span class="info-box-number" id="box-left-to-spend"></span>
|
||||||
|
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
@@ -65,7 +65,8 @@
|
|||||||
<span class="info-box-icon"><i class="fa fa-line-chart"></i></span>
|
<span class="info-box-icon"><i class="fa fa-line-chart"></i></span>
|
||||||
|
|
||||||
<div class="info-box-content">
|
<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>
|
<span class="info-box-number" id="box-net-worth"></span>
|
||||||
|
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
|
Reference in New Issue
Block a user