🤖 Auto commit for release 'develop' on 2025-09-26

This commit is contained in:
JC5
2025-09-26 19:43:39 +02:00
parent 853a99852e
commit d3c557ca22
103 changed files with 1411 additions and 1336 deletions

View File

@@ -65,16 +65,16 @@ class FrontpageChartGenerator
public function generate(): array
{
Log::debug(sprintf('Now in %s', __METHOD__));
$categories = $this->repository->getCategories();
$accounts = $this->accountRepos->getAccountsByType([AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value]);
$collection = $this->collectExpensesAll($categories, $accounts);
$categories = $this->repository->getCategories();
$accounts = $this->accountRepos->getAccountsByType([AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value]);
$collection = $this->collectExpensesAll($categories, $accounts);
// collect for no-category:
$noCategory = $this->collectNoCatExpenses($accounts);
$collection = array_merge($collection, $noCategory);
$noCategory = $this->collectNoCatExpenses($accounts);
$collection = array_merge($collection, $noCategory);
// sort temp array by amount.
$amounts = array_column($collection, 'sum_float');
$amounts = array_column($collection, 'sum_float');
array_multisort($amounts, SORT_ASC, $collection);
$currencyData = $this->createCurrencyGroups($collection);

View File

@@ -40,22 +40,22 @@ class WholePeriodChartGenerator
public function generate(Category $category, Carbon $start, Carbon $end): array
{
$collection = new Collection()->push($category);
$collection = new Collection()->push($category);
/** @var OperationsRepositoryInterface $opsRepository */
$opsRepository = app(OperationsRepositoryInterface::class);
$opsRepository = app(OperationsRepositoryInterface::class);
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
$types = [AccountTypeEnum::DEFAULT->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value];
$accounts = $accountRepository->getAccountsByType($types);
$step = $this->calculateStep($start, $end);
$chartData = [];
$spent = [];
$earned = [];
$types = [AccountTypeEnum::DEFAULT->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value];
$accounts = $accountRepository->getAccountsByType($types);
$step = $this->calculateStep($start, $end);
$chartData = [];
$spent = [];
$earned = [];
$current = clone $start;
$current = clone $start;
while ($current <= $end) {
$key = $current->format('Y-m-d');
@@ -65,14 +65,14 @@ class WholePeriodChartGenerator
$current = app('navigation')->addPeriod($current, $step, 0);
}
$currencies = $this->extractCurrencies($spent) + $this->extractCurrencies($earned);
$currencies = $this->extractCurrencies($spent) + $this->extractCurrencies($earned);
// generate chart data (for each currency)
/** @var array $currency */
foreach ($currencies as $currency) {
$code = $currency['currency_code'];
$name = $currency['currency_name'];
$chartData[sprintf('spent-in-%s', $code)] = [
$code = $currency['currency_code'];
$name = $currency['currency_name'];
$chartData[sprintf('spent-in-%s', $code)] = [
'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $name]),
'entries' => [],
'type' => 'bar',
@@ -87,11 +87,11 @@ class WholePeriodChartGenerator
];
}
$current = clone $start;
$current = clone $start;
while ($current <= $end) {
$key = $current->format('Y-m-d');
$label = app('navigation')->periodShow($current, $step);
$key = $current->format('Y-m-d');
$label = app('navigation')->periodShow($current, $step);
/** @var array $currency */
foreach ($currencies as $currency) {