mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup
This commit is contained in:
@@ -102,8 +102,8 @@ class FrontpageChartGenerator
|
||||
$tempData[] = [
|
||||
'name' => $category->name,
|
||||
'sum' => $currency['sum'],
|
||||
'sum_float' => round((float)$currency['sum'], $currency['currency_decimal_places']),
|
||||
'currency_id' => (int)$currency['currency_id'],
|
||||
'sum_float' => round((float) $currency['sum'], $currency['currency_decimal_places']),
|
||||
'currency_id' => (int) $currency['currency_id'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ class FrontpageChartGenerator
|
||||
|
||||
private function addCurrency(array $currency): void
|
||||
{
|
||||
$currencyId = (int)$currency['currency_id'];
|
||||
$currencyId = (int) $currency['currency_id'];
|
||||
|
||||
$this->currencies[$currencyId] ??= [
|
||||
'currency_id' => $currencyId,
|
||||
@@ -132,8 +132,8 @@ class FrontpageChartGenerator
|
||||
$tempData[] = [
|
||||
'name' => trans('firefly.no_category'),
|
||||
'sum' => $currency['sum'],
|
||||
'sum_float' => round((float)$currency['sum'], $currency['currency_decimal_places'] ?? 2), // intentional float
|
||||
'currency_id' => (int)$currency['currency_id'],
|
||||
'sum_float' => round((float) $currency['sum'], $currency['currency_decimal_places'] ?? 2), // intentional float
|
||||
'currency_id' => (int) $currency['currency_id'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ class FrontpageChartGenerator
|
||||
foreach ($this->currencies as $currencyId => $currency) {
|
||||
$key = sprintf('spent-%d', $currencyId);
|
||||
$return[$key] = [
|
||||
'label' => sprintf('%s (%s)', (string)trans('firefly.spent'), $currency['currency_name']),
|
||||
'label' => sprintf('%s (%s)', (string) trans('firefly.spent'), $currency['currency_name']),
|
||||
'type' => 'bar',
|
||||
'currency_symbol' => $currency['currency_symbol'],
|
||||
'entries' => $names,
|
||||
|
@@ -71,14 +71,14 @@ class WholePeriodChartGenerator
|
||||
$code = $currency['currency_code'];
|
||||
$name = $currency['currency_name'];
|
||||
$chartData[sprintf('spent-in-%s', $code)] = [
|
||||
'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $name]),
|
||||
'label' => (string) trans('firefly.box_spent_in_currency', ['currency' => $name]),
|
||||
'entries' => [],
|
||||
'type' => 'bar',
|
||||
'backgroundColor' => 'rgba(219, 68, 55, 0.5)', // red
|
||||
];
|
||||
|
||||
$chartData[sprintf('earned-in-%s', $code)] = [
|
||||
'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $name]),
|
||||
'label' => (string) trans('firefly.box_earned_in_currency', ['currency' => $name]),
|
||||
'entries' => [],
|
||||
'type' => 'bar',
|
||||
'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
|
||||
|
Reference in New Issue
Block a user