mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-01 02:21:45 +00:00
Fix #11191
This commit is contained in:
@@ -167,12 +167,17 @@ class IndexController extends Controller
|
|||||||
/** @var Carbon $end */
|
/** @var Carbon $end */
|
||||||
$end = clone session('end', today(config('app.timezone'))->endOfMonth());
|
$end = clone session('end', today(config('app.timezone'))->endOfMonth());
|
||||||
|
|
||||||
|
$now = now();
|
||||||
|
if ($now->gt($end) || $now->lt($start)) {
|
||||||
|
$now = $end;
|
||||||
|
}
|
||||||
|
|
||||||
$ids = $accounts->pluck('id')->toArray();
|
$ids = $accounts->pluck('id')->toArray();
|
||||||
Log::debug(sprintf('index: accountsBalancesInRange("%s", "%s")', $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s')));
|
Log::debug(sprintf('index: accountsBalancesInRange("%s", "%s")', $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s')));
|
||||||
[
|
[
|
||||||
$startBalances,
|
$startBalances,
|
||||||
$endBalances,
|
$endBalances,
|
||||||
] = Steam::accountsBalancesInRange($accounts, $start, $end, $this->primaryCurrency, $this->convertToPrimary);
|
] = Steam::accountsBalancesInRange($accounts, $start, $now, $this->primaryCurrency, $this->convertToPrimary);
|
||||||
$activities = Steam::getLastActivities($ids);
|
$activities = Steam::getLastActivities($ids);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class ShowController extends Controller
|
|||||||
$timer->stop('collection');
|
$timer->stop('collection');
|
||||||
$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;
|
||||||
$now = today()->endOfDay();
|
$now = now();
|
||||||
if ($now->gt($end) || $now->lt($start)) {
|
if ($now->gt($end) || $now->lt($start)) {
|
||||||
$now = $end;
|
$now = $end;
|
||||||
}
|
}
|
||||||
@@ -173,10 +173,7 @@ class ShowController extends Controller
|
|||||||
$balances = Steam::accountsBalancesOptimized(new Collection()->push($account), $now)[$account->id];
|
$balances = Steam::accountsBalancesOptimized(new Collection()->push($account), $now)[$account->id];
|
||||||
// $balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $now), $account, $this->convertToPrimary, $accountCurrency);
|
// $balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $now), $account, $this->convertToPrimary, $accountCurrency);
|
||||||
|
|
||||||
return view(
|
return view('accounts.show', ['account' => $account, 'showAll' => $showAll, 'objectType' => $objectType, 'currency' => $currency, 'today' => $today, 'periods' => $periods, 'subTitleIcon' => $subTitleIcon, 'groups' => $groups, 'attachments' => $attachments, 'subTitle' => $subTitle, 'start' => $start, 'end' => $end, 'chartUrl' => $chartUrl, 'location' => $location, 'balances' => $balances]);
|
||||||
'accounts.show',
|
|
||||||
['account' => $account, 'showAll' => $showAll, 'objectType' => $objectType, 'currency' => $currency, 'today' => $today, 'periods' => $periods, 'subTitleIcon' => $subTitleIcon, 'groups' => $groups, 'attachments' => $attachments, 'subTitle' => $subTitle, 'start' => $start, 'end' => $end, 'chartUrl' => $chartUrl, 'location' => $location, 'balances' => $balances]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -224,14 +221,16 @@ class ShowController extends Controller
|
|||||||
// correct
|
// correct
|
||||||
Log::debug(sprintf('showAll: Call accountsBalancesOptimized with date/time "%s"', $end->toIso8601String()));
|
Log::debug(sprintf('showAll: Call accountsBalancesOptimized with date/time "%s"', $end->toIso8601String()));
|
||||||
|
|
||||||
|
$now = now();
|
||||||
|
if ($now->gt($end) || $now->lt($start)) {
|
||||||
|
$now = $end;
|
||||||
|
}
|
||||||
|
|
||||||
// 2025-10-08 replace finalAccountBalance with accountsBalancesOptimized.
|
// 2025-10-08 replace finalAccountBalance with accountsBalancesOptimized.
|
||||||
// $balances = Steam::finalAccountBalance($account, $end);
|
// $balances = Steam::finalAccountBalance($account, $end);
|
||||||
// $balances = Steam::filterAccountBalance($balances, $account, $this->convertToPrimary, $accountCurrency);
|
// $balances = Steam::filterAccountBalance($balances, $account, $this->convertToPrimary, $accountCurrency);
|
||||||
$balances = Steam::accountsBalancesOptimized(new Collection()->push($account), $end)[$account->id];
|
$balances = Steam::accountsBalancesOptimized(new Collection()->push($account), $now)[$account->id];
|
||||||
|
|
||||||
return view(
|
return view('accounts.show', ['account' => $account, 'showAll' => $showAll, 'location' => $location, 'objectType' => $objectType, 'isLiability' => $isLiability, 'attachments' => $attachments, 'currency' => $currency, 'today' => $today, 'chartUrl' => $chartUrl, 'periods' => $periods, 'subTitleIcon' => $subTitleIcon, 'groups' => $groups, 'subTitle' => $subTitle, 'start' => $start, 'end' => $end, 'balances' => $balances]);
|
||||||
'accounts.show',
|
|
||||||
['account' => $account, 'showAll' => $showAll, 'location' => $location, 'objectType' => $objectType, 'isLiability' => $isLiability, 'attachments' => $attachments, 'currency' => $currency, 'today' => $today, 'chartUrl' => $chartUrl, 'periods' => $periods, 'subTitleIcon' => $subTitleIcon, 'groups' => $groups, 'subTitle' => $subTitle, 'start' => $start, 'end' => $end, 'balances' => $balances]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user