mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 01:42:19 +00:00
Fix issue with budget chart.
This commit is contained in:
@@ -106,11 +106,15 @@ class BudgetController extends Controller
|
|||||||
$current = app('navigation')->startOfPeriod($current, $step);
|
$current = app('navigation')->startOfPeriod($current, $step);
|
||||||
|
|
||||||
while ($end >= $current) {
|
while ($end >= $current) {
|
||||||
$currentEnd = app('navigation')->endOfPeriod($current, $step);
|
$currentEnd = app('navigation')->endOfPeriod($current, $step);
|
||||||
|
if ($step === '1Y') {
|
||||||
|
$currentEnd->subDay();
|
||||||
|
}
|
||||||
$spent = $this->repository->spentInPeriod($budgetCollection, new Collection, $current, $currentEnd);
|
$spent = $this->repository->spentInPeriod($budgetCollection, new Collection, $current, $currentEnd);
|
||||||
$label = app('navigation')->periodShow($current, $step);
|
$label = app('navigation')->periodShow($current, $step);
|
||||||
$chartData[$label] = floatval(bcmul($spent,'-1'));
|
$chartData[$label] = floatval(bcmul($spent, '-1'));
|
||||||
$current = app('navigation')->addPeriod($current, $step, 1);
|
$current = clone $currentEnd;
|
||||||
|
$current->addDay();
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
||||||
|
Reference in New Issue
Block a user