mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-20 11:48:27 -06:00
Fix balance display #9826
This commit is contained in:
parent
295feedd77
commit
a606315884
@ -121,12 +121,7 @@ class ShowController extends Controller
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector
|
||||
->setAccounts(new Collection([$account]))
|
||||
->setLimit($pageSize)
|
||||
->setPage($page)->withAccountInformation()->withCategoryInformation()
|
||||
->setRange($start, $end)
|
||||
;
|
||||
$collector->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)
|
||||
// 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')]));
|
||||
$showAll = false;
|
||||
// correct
|
||||
Log::debug(sprintf('show: Call finalAccountBalance with date/time "%s"', $end->toIso8601String()));
|
||||
$balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $end), $account, $this->convertToNative, $accountCurrency);
|
||||
$now = today()->endOfDay();
|
||||
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(
|
||||
'accounts.show',
|
||||
|
@ -69,9 +69,13 @@
|
||||
{% for key, balance in account.endBalances %}
|
||||
<span title="{{ 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 %}
|
||||
{{ formatAmountBySymbol(balance, defaultCurrency.symbol, defaultCurrency.decimal_places) }}
|
||||
{% if convertToNative %}
|
||||
{{ formatAmountBySymbol(balance, defaultCurrency.symbol, defaultCurrency.decimal_places) }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
({{ formatAmountByCode(balance, key) }})
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user