Fixed the other chart too.

This commit is contained in:
James Cole 2015-09-29 09:29:28 +02:00
parent da50f9e419
commit d691fa9b4d
2 changed files with 4 additions and 4 deletions

View File

@ -74,9 +74,9 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
],
];
$data['datasets'][0]['data'][] = round($income, 2);
$data['datasets'][1]['data'][] = round( ($expense * -1), 2);
$data['datasets'][1]['data'][] = round( $expense, 2);
$data['datasets'][0]['data'][] = round(($income / $count), 2);
$data['datasets'][1]['data'][] = round(( ($expense*-1) / $count), 2);
$data['datasets'][1]['data'][] = round(( $expense / $count), 2);
return $data;
}

View File

@ -111,8 +111,8 @@ class ReportController extends Controller
$month = clone $start;
$month->endOfMonth();
// total income and total expenses:
$currentIncome = $query->incomeInPeriodCorrected($start, $month, $shared)->sum('amount');
$currentExpense = $query->expenseInPeriodCorrected($start, $month, $shared)->sum('amount');
$currentIncome = $query->incomeInPeriodCorrected($start, $month, $shared)->sum('amount_positive');
$currentExpense = $query->expenseInPeriodCorrected($start, $month, $shared)->sum('amount_positive');
Log::debug('Date ['.$month->format('M Y').']: income = ['.$income.' + '.$currentIncome.'], out = ['.$expense.' + '.$currentExpense.']');