mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-08 10:48:13 +00:00
Remove unused code.
This commit is contained in:
@@ -89,12 +89,10 @@ 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect for no-category:
|
// collect for no-category:
|
||||||
$collection[] = $this->collectNoCatExpenses($accounts);
|
$collection[] = $this->collectNoCatExpenses($accounts);
|
||||||
//$collection[] = $this->collectNoCatIncome($accounts);
|
|
||||||
|
|
||||||
$tempData = array_merge(...$collection);
|
$tempData = array_merge(...$collection);
|
||||||
|
|
||||||
@@ -146,29 +144,6 @@ class FrontpageChartGenerator
|
|||||||
return $tempData;
|
return $tempData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Category $category
|
|
||||||
* @param Collection $accounts
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
private function collectIncome(Category $category, Collection $accounts): array
|
|
||||||
{
|
|
||||||
$spent = $this->opsRepos->sumIncome($this->start, $this->end, $accounts, new Collection([$category]));
|
|
||||||
$tempData = [];
|
|
||||||
foreach ($spent as $currency) {
|
|
||||||
$this->addCurrency($currency);
|
|
||||||
$tempData[] = [
|
|
||||||
'name' => $category->name,
|
|
||||||
'sum' => $currency['sum'],
|
|
||||||
'sum_float' => round($currency['sum'], $currency['currency_decimal_places']),
|
|
||||||
'currency_id' => (int) $currency['currency_id'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $tempData;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $accounts
|
* @param Collection $accounts
|
||||||
*
|
*
|
||||||
@@ -184,28 +159,8 @@ class FrontpageChartGenerator
|
|||||||
'name' => trans('firefly.no_category'),
|
'name' => trans('firefly.no_category'),
|
||||||
'sum' => $currency['sum'],
|
'sum' => $currency['sum'],
|
||||||
'sum_float' => round($currency['sum'], $currency['currency_decimal_places'] ?? 2),
|
'sum_float' => round($currency['sum'], $currency['currency_decimal_places'] ?? 2),
|
||||||
'currency_id' => (int) $currency['currency_id'],];
|
'currency_id' => (int) $currency['currency_id'],
|
||||||
}
|
];
|
||||||
|
|
||||||
return $tempData;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Collection $accounts
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
private function collectNoCatIncome(Collection $accounts): array
|
|
||||||
{
|
|
||||||
$noCatExp = $this->noCatRepos->sumIncome($this->start, $this->end, $accounts);
|
|
||||||
$tempData = [];
|
|
||||||
foreach ($noCatExp as $currency) {
|
|
||||||
$this->addCurrency($currency);
|
|
||||||
$tempData[] = [
|
|
||||||
'name' => trans('firefly.no_category'),
|
|
||||||
'sum' => $currency['sum'],
|
|
||||||
'sum_float' => round($currency['sum'], $currency['currency_decimal_places'] ?? 2),
|
|
||||||
'currency_id' => (int) $currency['currency_id'],];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tempData;
|
return $tempData;
|
||||||
@@ -231,14 +186,6 @@ class FrontpageChartGenerator
|
|||||||
'currency_symbol' => $currency['currency_symbol'],
|
'currency_symbol' => $currency['currency_symbol'],
|
||||||
'entries' => $names,
|
'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;
|
return $return;
|
||||||
|
|||||||
Reference in New Issue
Block a user