Remove income from category chart #3517

This commit is contained in:
James Cole 2020-07-03 05:42:57 +02:00
parent 45f5a38512
commit 34fd66c835
2 changed files with 11 additions and 11 deletions

View File

@ -111,7 +111,7 @@ class CategoryController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.category.frontpage'); $cache->addProperty('chart.category.frontpage');
if ($cache->has()) { if ($cache->has()) {
// return response()->json($cache->get()); // @codeCoverageIgnore return response()->json($cache->get()); // @codeCoverageIgnore
} }
$frontPageGenerator = new FrontpageChartGenerator($start, $end); $frontPageGenerator = new FrontpageChartGenerator($start, $end);

View File

@ -89,12 +89,12 @@ class FrontpageChartGenerator
foreach ($categories as $category) { foreach ($categories as $category) {
// get expenses // get expenses
$collection[] = $this->collectExpenses($category, $accounts); $collection[] = $this->collectExpenses($category, $accounts);
$collection[] = $this->collectIncome($category, $accounts); //$collection[] = $this->collectIncome($category, $accounts);
} }
// collect for no-category: // collect for no-category:
$collection[] = $this->collectNoCatExpenses($accounts); $collection[] = $this->collectNoCatExpenses($accounts);
$collection[] = $this->collectNoCatIncome($accounts); //$collection[] = $this->collectNoCatIncome($accounts);
$tempData = array_merge(...$collection); $tempData = array_merge(...$collection);
@ -231,14 +231,14 @@ class FrontpageChartGenerator
'currency_symbol' => $currency['currency_symbol'], 'currency_symbol' => $currency['currency_symbol'],
'entries' => $names, 'entries' => $names,
]; ];
$key = sprintf('earned-%d', $currencyId); // $key = sprintf('earned-%d', $currencyId);
$return[$key] = [ // $return[$key] = [
'label' => sprintf('%s (%s)', (string) trans('firefly.earned'), $currency['currency_name']), // 'label' => sprintf('%s (%s)', (string) trans('firefly.earned'), $currency['currency_name']),
'type' => 'bar', // 'type' => 'bar',
'currency_symbol' => $currency['currency_symbol'], // 'currency_symbol' => $currency['currency_symbol'],
'data_type' => 'earned', // 'data_type' => 'earned',
'entries' => $names, // 'entries' => $names,
]; // ];
} }
return $return; return $return;