mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
Fix balance display #9826
This commit is contained in:
@@ -121,12 +121,7 @@ class ShowController extends Controller
|
|||||||
|
|
||||||
/** @var GroupCollectorInterface $collector */
|
/** @var GroupCollectorInterface $collector */
|
||||||
$collector = app(GroupCollectorInterface::class);
|
$collector = app(GroupCollectorInterface::class);
|
||||||
$collector
|
$collector->setAccounts(new Collection([$account]))->setLimit($pageSize)->setPage($page)->withAccountInformation()->withCategoryInformation()->setRange($start, $end);
|
||||||
->setAccounts(new Collection([$account]))
|
|
||||||
->setLimit($pageSize)
|
|
||||||
->setPage($page)->withAccountInformation()->withCategoryInformation()
|
|
||||||
->setRange($start, $end)
|
|
||||||
;
|
|
||||||
|
|
||||||
// this search will not include transaction groups where this asset account (or liability)
|
// this search will not include transaction groups where this asset account (or liability)
|
||||||
// is just part of ONE of the journals. To force this:
|
// is just part of ONE of the journals. To force this:
|
||||||
@@ -137,8 +132,13 @@ class ShowController extends Controller
|
|||||||
$groups->setPath(route('accounts.show', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]));
|
$groups->setPath(route('accounts.show', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]));
|
||||||
$showAll = false;
|
$showAll = false;
|
||||||
// correct
|
// correct
|
||||||
Log::debug(sprintf('show: Call finalAccountBalance with date/time "%s"', $end->toIso8601String()));
|
$now = today()->endOfDay();
|
||||||
$balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $end), $account, $this->convertToNative, $accountCurrency);
|
if($now->gt($end) || $now->lt($start)) {
|
||||||
|
$now = $end;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::debug(sprintf('show: Call finalAccountBalance with date/time "%s"', $now->toIso8601String()));
|
||||||
|
$balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $now), $account, $this->convertToNative, $accountCurrency);
|
||||||
|
|
||||||
return view(
|
return view(
|
||||||
'accounts.show',
|
'accounts.show',
|
||||||
|
@@ -69,9 +69,13 @@
|
|||||||
{% for key, balance in account.endBalances %}
|
{% for key, balance in account.endBalances %}
|
||||||
<span title="{{ key }}">
|
<span title="{{ key }}">
|
||||||
{% if 'balance' == key %}
|
{% if 'balance' == key %}
|
||||||
{{ formatAmountBySymbol(balance, account.currency.symbol, account.currency.decimal_places) }}
|
{% if not convertToNative %}
|
||||||
|
{{ formatAmountBySymbol(balance, account.currency.symbol, account.currency.decimal_places) }}
|
||||||
|
{% endif %}
|
||||||
{% elseif 'native_balance' == key %}
|
{% elseif 'native_balance' == key %}
|
||||||
{{ formatAmountBySymbol(balance, defaultCurrency.symbol, defaultCurrency.decimal_places) }}
|
{% if convertToNative %}
|
||||||
|
{{ formatAmountBySymbol(balance, defaultCurrency.symbol, defaultCurrency.decimal_places) }}
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
({{ formatAmountByCode(balance, key) }})
|
({{ formatAmountByCode(balance, key) }})
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user