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('chart.category.frontpage');
if ($cache->has()) {
// return response()->json($cache->get()); // @codeCoverageIgnore
return response()->json($cache->get()); // @codeCoverageIgnore
}
$frontPageGenerator = new FrontpageChartGenerator($start, $end);

View File

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