This commit is contained in:
James Cole 2015-03-31 20:52:48 +02:00
parent 216a223617
commit cf23858c10
2 changed files with 8 additions and 1 deletions

View File

@ -323,7 +323,7 @@ class ReportQuery implements ReportQueryInterface
->groupBy('categories.id')
->orderBy('amount');
return $query->get(['categories.id', 'categories.name', DB::Raw('SUM(`transactions`.`amount`) AS `amount`')]);
return $query->get(['categories.id','categories.encrypted', 'categories.name', DB::Raw('SUM(`transactions`.`amount`) AS `amount`')]);
}

View File

@ -11,6 +11,7 @@ use Preferences;
use Session;
use Steam;
use View;
use Crypt;
/**
* Class ReportController
@ -267,6 +268,12 @@ class ReportController extends Controller
$result = $this->query->journalsByCategory($start, $end);
$categories = Steam::makeArray($result);
// loop and decrypt if necessary:
foreach ($categories as $index => $category) {
$categories[$index]['name']
= intval($categories[$index]['encrypted']) == 1 ? Crypt::decrypt($categories[$index]['name']) : $categories[$index]['name'];
}
// all transfers
if ($showSharedReports === false) {
$result = $this->query->sharedExpensesByCategory($start, $end);