mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix multi-year chart. [skip ci]
This commit is contained in:
@@ -168,7 +168,6 @@ class ReportController extends Controller
|
|||||||
$currentStart = Navigation::addPeriod($currentStart, '1M', 0);
|
$currentStart = Navigation::addPeriod($currentStart, '1M', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($start->diffInMonths($end) > 12) {
|
if ($start->diffInMonths($end) > 12) {
|
||||||
// per year
|
// per year
|
||||||
$data = $this->multiYearInOutSummarized($earnedArray, $spentArray, $start, $end);
|
$data = $this->multiYearInOutSummarized($earnedArray, $spentArray, $start, $end);
|
||||||
@@ -195,7 +194,7 @@ class ReportController extends Controller
|
|||||||
while ($start < $end) {
|
while ($start < $end) {
|
||||||
|
|
||||||
$incomeSum = $this->pluckFromArray($start->year, $earned);
|
$incomeSum = $this->pluckFromArray($start->year, $earned);
|
||||||
$expenseSum = $this->pluckFromArray($start->year, $spent) * -1;
|
$expenseSum = $this->pluckFromArray($start->year, $spent);
|
||||||
|
|
||||||
$entries->push([clone $start, $incomeSum, $expenseSum]);
|
$entries->push([clone $start, $incomeSum, $expenseSum]);
|
||||||
$start->addYear();
|
$start->addYear();
|
||||||
@@ -222,7 +221,7 @@ class ReportController extends Controller
|
|||||||
while ($start < $end) {
|
while ($start < $end) {
|
||||||
|
|
||||||
$currentIncome = $this->pluckFromArray($start->year, $earned);
|
$currentIncome = $this->pluckFromArray($start->year, $earned);
|
||||||
$currentExpense = bcmul($this->pluckFromArray($start->year, $spent), '-1');
|
$currentExpense = $this->pluckFromArray($start->year, $spent);
|
||||||
$income = bcadd($income, $currentIncome);
|
$income = bcadd($income, $currentIncome);
|
||||||
$expense = bcadd($expense, $currentExpense);
|
$expense = bcadd($expense, $currentExpense);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user