mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-31 11:17:27 -06:00
Fix #1386
This commit is contained in:
parent
fcf9b782c1
commit
4031057bc0
@ -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 BinderInterface
|
||||
public 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) {
|
||||
|
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 {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user