From 03729aa5ae38aea7757047db8b209c0fc5f741fc Mon Sep 17 00:00:00 2001 From: Sander Dorigo Date: Sun, 2 Nov 2014 21:24:50 +0100 Subject: [PATCH] Chart cleanup --- app/controllers/GoogleChartController.php | 6 ++-- app/views/layouts/default.blade.php | 1 + public/assets/javascript/firefly/gcharts.js | 7 ++--- .../javascript/firefly/gcharts.options.js | 28 ++++++++++++++++--- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/controllers/GoogleChartController.php b/app/controllers/GoogleChartController.php index 57f1a49812..4c72298b1c 100644 --- a/app/controllers/GoogleChartController.php +++ b/app/controllers/GoogleChartController.php @@ -231,8 +231,7 @@ class GoogleChartController extends BaseController /** @var \TransactionJournal $journal */ foreach ($journals as $journal) { if ($journal->transactionType->type == 'Withdrawal') { - $amount = floatval($journal->transactions[1]->amount); - $amount = $amount < 0 ? $amount * -1 : $amount; + $amount = $journal->getAmount(); $category = $journal->categories()->first(); if (!is_null($category)) { if (isset($data[$category->name])) { @@ -321,8 +320,7 @@ class GoogleChartController extends BaseController $unpaid['items'][] = $entry->name; $unpaid['amount'] += (($entry->amount_max + $entry->amount_min) / 2); } else { - $amount = floatval($journal->transactions[0]->amount); - $amount = $amount < 0 ? $amount * -1 : $amount; + $amount = $journal->getAmount(); $paid['items'][] = $journal->description; $paid['amount'] += $amount; } diff --git a/app/views/layouts/default.blade.php b/app/views/layouts/default.blade.php index 76b2c54814..b63fc91baf 100644 --- a/app/views/layouts/default.blade.php +++ b/app/views/layouts/default.blade.php @@ -17,6 +17,7 @@ {{HTML::style('assets/stylesheets/metisMenu/metisMenu.min.css')}} {{HTML::style('assets/stylesheets/sbadmin/sb.css')}} {{HTML::style('assets/stylesheets/fa/css/font-awesome.min.css')}} + @yield('styles')