mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-30 12:43:57 -06:00
And optimised another chart. Amounts are slightly different. Will investigate
This commit is contained in:
parent
aac5c2b13c
commit
25747fbcf2
@ -313,7 +313,7 @@ class ReportQuery implements ReportQueryInterface
|
||||
->get(
|
||||
[
|
||||
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`,"%Y-%m") AS `dateFormatted`'),
|
||||
DB::Raw('SUM(`t_from`.`amount`) AS `sum`')
|
||||
DB::Raw('SUM(`t_to`.`amount`) AS `sum`')
|
||||
]
|
||||
);
|
||||
$array = [];
|
||||
|
@ -66,7 +66,7 @@ class ReportController extends Controller
|
||||
while ($start < $end) {
|
||||
|
||||
$incomeSum = $this->pluckFromArray($start->year, $earnedArray);
|
||||
$expenseSum = $this->pluckFromArray($start->year, $spentArray);
|
||||
$expenseSum = $this->pluckFromArray($start->year, $spentArray) * -1;
|
||||
|
||||
$entries->push([clone $start, $incomeSum, $expenseSum]);
|
||||
$start->addYear();
|
||||
@ -82,7 +82,7 @@ class ReportController extends Controller
|
||||
// total income and total expenses:
|
||||
$date = $start->format('Y-m');
|
||||
$incomeSum = isset($earnedArray[$date]) ? $earnedArray[$date] : 0;
|
||||
$expenseSum = isset($spentArray[$date]) ? $spentArray[$date] : 0;
|
||||
$expenseSum = isset($spentArray[$date]) ? ($spentArray[$date]*-1) : 0;
|
||||
|
||||
$entries->push([clone $start, $incomeSum, $expenseSum]);
|
||||
$start->addMonth();
|
||||
|
Loading…
Reference in New Issue
Block a user