mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-22 06:23:12 -06:00
Fix chart.
This commit is contained in:
parent
a2c2bb4948
commit
7296796ed9
@ -59,15 +59,16 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator
|
|||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
$ids[] = $account->id;
|
$ids[] = $account->id;
|
||||||
}
|
}
|
||||||
|
$start->subDay();
|
||||||
|
|
||||||
$startBalances = Steam::balancesById($ids, $start);
|
$startBalances = Steam::balancesById($ids, $start);
|
||||||
$endBalances = Steam::balancesById($ids, $end);
|
$endBalances = Steam::balancesById($ids, $end);
|
||||||
|
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
$id = $account->id;
|
$id = $account->id;
|
||||||
$start = isset($startBalances[$id]) ? $startBalances[$id] : 0;
|
$startBalance = isset($startBalances[$id]) ? $startBalances[$id] : 0;
|
||||||
$end = isset($endBalances[$id]) ? $endBalances[$id] : 0;
|
$endBalance = isset($endBalances[$id]) ? $endBalances[$id] : 0;
|
||||||
$diff = $end - $start;
|
$diff = $endBalance - $startBalance;
|
||||||
Log::debug($account->name . ' spent ' . $diff);
|
Log::debug($account->name . ' spent ' . $diff);
|
||||||
if ($diff > 0) {
|
if ($diff > 0) {
|
||||||
$data['labels'][] = $account->name;
|
$data['labels'][] = $account->name;
|
||||||
|
Loading…
Reference in New Issue
Block a user