From 299838296990d266ada8e4de0ee306c473477f5a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 1 Feb 2015 14:56:25 +0100 Subject: [PATCH] Check if entries have an encrypted description and act accordingly. --- app/controllers/GoogleChartController.php | 3 ++- app/lib/FireflyIII/Chart/Chart.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/GoogleChartController.php b/app/controllers/GoogleChartController.php index 5e82d64c87..4e882653b1 100644 --- a/app/controllers/GoogleChartController.php +++ b/app/controllers/GoogleChartController.php @@ -281,7 +281,8 @@ class GoogleChartController extends BaseController $unpaid['items'][] = $entry->name; $unpaid['amount'] += floatval($entry->averageAmount); } else { - $paid['items'][] = $entry->description; + $description = intval($entry->encrypted) == 1 ? Crypt::decrypt($entry->description) : $entry->description; + $paid['items'][] = $description; $paid['amount'] += floatval($entry->actualAmount); } } diff --git a/app/lib/FireflyIII/Chart/Chart.php b/app/lib/FireflyIII/Chart/Chart.php index 6214e5079a..6d01ddaecd 100644 --- a/app/lib/FireflyIII/Chart/Chart.php +++ b/app/lib/FireflyIII/Chart/Chart.php @@ -67,6 +67,7 @@ class Chart implements ChartInterface ->groupBy('bills.id') ->get( ['bills.id', 'bills.name', 'transaction_journals.description', + 'transaction_journals.encrypted', 'transaction_journals.id as journalId', \DB::Raw('SUM(`bills`.`amount_min` + `bills`.`amount_max`) / 2 as `averageAmount`'), 'transactions.amount AS actualAmount']