mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 03:08:11 +00:00
Fix encryption in home chart.
This commit is contained in:
@@ -26,6 +26,7 @@ use Preferences;
|
|||||||
use Response;
|
use Response;
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
|
use Crypt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class GoogleChartController
|
* Class GoogleChartController
|
||||||
@@ -255,11 +256,13 @@ class GoogleChartController extends Controller
|
|||||||
->where('transaction_types.type', 'Withdrawal')
|
->where('transaction_types.type', 'Withdrawal')
|
||||||
->groupBy('categories.id')
|
->groupBy('categories.id')
|
||||||
->orderBy('sum', 'DESC')
|
->orderBy('sum', 'DESC')
|
||||||
->get(['categories.id', 'categories.name', \DB::Raw('SUM(`transactions`.`amount`) AS `sum`')]);
|
->get(['categories.id','categories.encrypted', 'categories.name', \DB::Raw('SUM(`transactions`.`amount`) AS `sum`')]);
|
||||||
|
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$entry->name = strlen($entry->name) == 0 ? '(no category)' : $entry->name;
|
$isEncrypted = intval($entry->encrypted) == 1 ? true : false;
|
||||||
$chart->addRow($entry->name, floatval($entry->sum));
|
$name = strlen($entry->name) == 0 ? '(no category)' : $entry->name;
|
||||||
|
$name = $isEncrypted ? Crypt::decrypt($name) : $name;
|
||||||
|
$chart->addRow($name, floatval($entry->sum));
|
||||||
}
|
}
|
||||||
|
|
||||||
$chart->generate();
|
$chart->generate();
|
||||||
|
Reference in New Issue
Block a user