Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fixed the other chart too.
James Coled691fa9b4db7
diff --git a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php b/app/Generator/Chart/Report/ChartJsReportChartGenerator.phpindex 6869c4c18d..0a49d2354a 100644--- a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php+++ b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php@@ -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;}diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.phpindex 0331981df8..6522f8b2a7 100644--- a/app/Http/Controllers/Chart/ReportController.php+++ b/app/Http/Controllers/Chart/ReportController.php@@ -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.']');