🤖 Auto commit for release 'develop' on 2026-01-23

This commit is contained in:
JC5
2026-01-23 15:14:29 +01:00
parent 8f15a32bd6
commit eeeba86d38
888 changed files with 10732 additions and 10387 deletions

View File

@@ -54,7 +54,7 @@ class TransactionController extends Controller
*/
public function budgets(Carbon $start, Carbon $end)
{
$cache = new CacheProperties();
$cache = new CacheProperties();
$cache->addProperty($start);
$cache->addProperty($end);
$cache->addProperty('chart.transactions.budgets');
@@ -68,18 +68,18 @@ class TransactionController extends Controller
$collector->withBudgetInformation();
$collector->setTypes([TransactionTypeEnum::WITHDRAWAL->value]);
$result = $collector->getExtractedJournals();
$data = [];
$result = $collector->getExtractedJournals();
$data = [];
// group by category.
/** @var array $journal */
foreach ($result as $journal) {
$budget = $journal['budget_name'] ?? (string) trans('firefly.no_budget');
$title = sprintf('%s (%s)', $budget, $journal['currency_symbol']);
$budget = $journal['budget_name'] ?? (string) trans('firefly.no_budget');
$title = sprintf('%s (%s)', $budget, $journal['currency_symbol']);
$data[$title] ??= ['amount' => '0', 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code']];
$data[$title]['amount'] = bcadd($data[$title]['amount'], (string) $journal['amount']);
}
$chart = $this->generator->multiCurrencyPieChart($data);
$chart = $this->generator->multiCurrencyPieChart($data);
$cache->store($chart);
return response()->json($chart);
@@ -90,7 +90,7 @@ class TransactionController extends Controller
*/
public function categories(string $objectType, Carbon $start, Carbon $end)
{
$cache = new CacheProperties();
$cache = new CacheProperties();
$cache->addProperty($start);
$cache->addProperty($end);
$cache->addProperty($objectType);
@@ -114,18 +114,18 @@ class TransactionController extends Controller
$collector->setTypes([TransactionTypeEnum::TRANSFER->value]);
}
$result = $collector->getExtractedJournals();
$data = [];
$result = $collector->getExtractedJournals();
$data = [];
// group by category.
/** @var array $journal */
foreach ($result as $journal) {
$category = $journal['category_name'] ?? (string) trans('firefly.no_category');
$title = sprintf('%s (%s)', $category, $journal['currency_symbol']);
$category = $journal['category_name'] ?? (string) trans('firefly.no_category');
$title = sprintf('%s (%s)', $category, $journal['currency_symbol']);
$data[$title] ??= ['amount' => '0', 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code']];
$data[$title]['amount'] = bcadd($data[$title]['amount'], (string) $journal['amount']);
}
$chart = $this->generator->multiCurrencyPieChart($data);
$chart = $this->generator->multiCurrencyPieChart($data);
$cache->store($chart);
return response()->json($chart);
@@ -136,7 +136,7 @@ class TransactionController extends Controller
*/
public function destinationAccounts(string $objectType, Carbon $start, Carbon $end)
{
$cache = new CacheProperties();
$cache = new CacheProperties();
$cache->addProperty($start);
$cache->addProperty($end);
$cache->addProperty($objectType);
@@ -160,18 +160,18 @@ class TransactionController extends Controller
$collector->setTypes([TransactionTypeEnum::TRANSFER->value]);
}
$result = $collector->getExtractedJournals();
$data = [];
$result = $collector->getExtractedJournals();
$data = [];
// group by category.
/** @var array $journal */
foreach ($result as $journal) {
$name = $journal['destination_account_name'];
$title = sprintf('%s (%s)', $name, $journal['currency_symbol']);
$name = $journal['destination_account_name'];
$title = sprintf('%s (%s)', $name, $journal['currency_symbol']);
$data[$title] ??= ['amount' => '0', 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code']];
$data[$title]['amount'] = bcadd($data[$title]['amount'], (string) $journal['amount']);
}
$chart = $this->generator->multiCurrencyPieChart($data);
$chart = $this->generator->multiCurrencyPieChart($data);
$cache->store($chart);
return response()->json($chart);
@@ -182,7 +182,7 @@ class TransactionController extends Controller
*/
public function sourceAccounts(string $objectType, Carbon $start, Carbon $end)
{
$cache = new CacheProperties();
$cache = new CacheProperties();
$cache->addProperty($start);
$cache->addProperty($end);
$cache->addProperty($objectType);
@@ -206,18 +206,18 @@ class TransactionController extends Controller
$collector->setTypes([TransactionTypeEnum::TRANSFER->value]);
}
$result = $collector->getExtractedJournals();
$data = [];
$result = $collector->getExtractedJournals();
$data = [];
// group by category.
/** @var array $journal */
foreach ($result as $journal) {
$name = $journal['source_account_name'];
$title = sprintf('%s (%s)', $name, $journal['currency_symbol']);
$name = $journal['source_account_name'];
$title = sprintf('%s (%s)', $name, $journal['currency_symbol']);
$data[$title] ??= ['amount' => '0', 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code']];
$data[$title]['amount'] = bcadd($data[$title]['amount'], (string) $journal['amount']);
}
$chart = $this->generator->multiCurrencyPieChart($data);
$chart = $this->generator->multiCurrencyPieChart($data);
$cache->store($chart);
return response()->json($chart);