mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
Fix #9842
This commit is contained in:
@@ -102,7 +102,7 @@ class BasicController extends Controller
|
|||||||
$balanceData = $this->getBalanceInformation($start, $end);
|
$balanceData = $this->getBalanceInformation($start, $end);
|
||||||
$billData = $this->getBillInformation($start, $end);
|
$billData = $this->getBillInformation($start, $end);
|
||||||
$spentData = $this->getLeftToSpendInfo($start, $end);
|
$spentData = $this->getLeftToSpendInfo($start, $end);
|
||||||
$netWorthData = $this->getNetWorthInfo($start, $end);
|
$netWorthData = $this->getNetWorthInfo($end);
|
||||||
// $balanceData = [];
|
// $balanceData = [];
|
||||||
// $billData = [];
|
// $billData = [];
|
||||||
// $spentData = [];
|
// $spentData = [];
|
||||||
@@ -319,18 +319,12 @@ class BasicController extends Controller
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getNetWorthInfo(Carbon $start, Carbon $end): array
|
private function getNetWorthInfo(Carbon $end): array
|
||||||
{
|
{
|
||||||
|
$end->endOfDay();
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
$date = now(config('app.timezone'));
|
Log::debug(sprintf('getNetWorthInfo up until "%s".', $end->format('Y-m-d H:i:s')));
|
||||||
// start and end in the future? use $end
|
|
||||||
if ($this->notInDateRange($date, $start, $end)) {
|
|
||||||
/** @var Carbon $date */
|
|
||||||
$date = session('end', today(config('app.timezone'))->endOfMonth());
|
|
||||||
}
|
|
||||||
Log::debug(sprintf('getNetWorthInfo up until "%s".', $date->format('Y-m-d H:i:s')));
|
|
||||||
|
|
||||||
/** @var NetWorthInterface $netWorthHelper */
|
/** @var NetWorthInterface $netWorthHelper */
|
||||||
$netWorthHelper = app(NetWorthInterface::class);
|
$netWorthHelper = app(NetWorthInterface::class);
|
||||||
@@ -346,7 +340,7 @@ class BasicController extends Controller
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$netWorthSet = $netWorthHelper->byAccounts($filtered, $date);
|
$netWorthSet = $netWorthHelper->byAccounts($filtered, $end);
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($netWorthSet as $key => $data) {
|
foreach ($netWorthSet as $key => $data) {
|
||||||
if ('native' === $key) {
|
if ('native' === $key) {
|
||||||
|
Reference in New Issue
Block a user