Skip to content

Firefly III: a personal finances manager

🤖 Auto commit for release 'develop' on 2026-10-09

JC55cf68774bd6d
diff --git a/app/Api/V1/Controllers/Insight/Income/TagController.php b/app/Api/V1/Controllers/Insight/Income/TagController.php
index df99eef909..94be2ae461 100644
--- a/app/Api/V1/Controllers/Insight/Income/TagController.php
+++ b/app/Api/V1/Controllers/Insight/Income/TagController.php
@@ -158,7 +158,10 @@ final class TagController extends Controller
'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
- $response[$foreignKey]['difference'] = bcadd((string) $response[$foreignKey]['difference'], Steam::positive($journal['foreign_amount']));
+ $response[$foreignKey]['difference'] = bcadd(
+ (string) $response[$foreignKey]['difference'],
+ Steam::positive($journal['foreign_amount'])
+ );
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference'];
}
}
diff --git a/app/Api/V1/Controllers/Insight/Transfer/TagController.php b/app/Api/V1/Controllers/Insight/Transfer/TagController.php
index f92a7aa9f0..b7b85fd376 100644
--- a/app/Api/V1/Controllers/Insight/Transfer/TagController.php
+++ b/app/Api/V1/Controllers/Insight/Transfer/TagController.php
@@ -155,7 +155,10 @@ final class TagController extends Controller
'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
- $response[$foreignKey]['difference'] = bcadd((string) $response[$foreignKey]['difference'], Steam::positive($journal['foreign_amount']));
+ $response[$foreignKey]['difference'] = bcadd(
+ (string) $response[$foreignKey]['difference'],
+ Steam::positive($journal['foreign_amount'])
+ );
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // intentional float
}
}
diff --git a/app/Api/V1/Controllers/Models/Account/ShowController.php b/app/Api/V1/Controllers/Models/Account/ShowController.php
index 577f21490d..f755833a30 100644
--- a/app/Api/V1/Controllers/Models/Account/ShowController.php
+++ b/app/Api/V1/Controllers/Models/Account/ShowController.php
@@ -152,6 +152,4 @@ final class ShowController extends Controller
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
-
-
}
diff --git a/app/Api/V1/Controllers/Models/Category/ShowController.php b/app/Api/V1/Controllers/Models/Category/ShowController.php
index 42acd2c16e..ea8dd58134 100644
--- a/app/Api/V1/Controllers/Models/Category/ShowController.php
+++ b/app/Api/V1/Controllers/Models/Category/ShowController.php
@@ -44,6 +44,7 @@ use League\Fractal\Resource\Item;
final class ShowController extends Controller
{
use ChecksSortType;
+
private CategoryRepositoryInterface $repository;
/**
@@ -83,12 +84,11 @@ final class ShowController extends Controller
$collection = $this->repository->getCategories($sort, $filter);
$count = $collection->count();
$dbFields = $this->isAllDatabaseSort($sort, 'Category');
- $categories = $collection;
+ $categories = $collection;
if ($dbFields) {
$categories = $collection->slice($offset, $limit);
}
-
// enrich
/** @var User $admin */
$admin = auth()->user();
diff --git a/app/Api/V1/Requests/Models/Category/ShowRequest.php b/app/Api/V1/Requests/Models/Category/ShowRequest.php
index 193f006c6a..b910741301 100644
--- a/app/Api/V1/Requests/Models/Category/ShowRequest.php
+++ b/app/Api/V1/Requests/Models/Category/ShowRequest.php
@@ -27,10 +27,7 @@ namespace FireflyIII\Api\V1\Requests\Models\Category;
use FireflyIII\Api\V1\Requests\AggregateFormRequest;
use FireflyIII\Api\V1\Requests\DateRangeRequest;
use FireflyIII\Api\V1\Requests\DateRequest;
-use FireflyIII\Api\V1\Requests\Generic\ActiveObjectRequest;
-use FireflyIII\Api\V1\Requests\Models\Account\AccountTypeApiRequest;
use FireflyIII\Api\V1\Requests\PaginationRequest;
-use FireflyIII\Models\Account;
use FireflyIII\Models\Category;
class ShowRequest extends AggregateFormRequest
diff --git a/app/Api/V1/Requests/Models/Category/StoreRequest.php b/app/Api/V1/Requests/Models/Category/StoreRequest.php
index aad2c13fa6..ded0e1eb0f 100644
--- a/app/Api/V1/Requests/Models/Category/StoreRequest.php
+++ b/app/Api/V1/Requests/Models/Category/StoreRequest.php
@@ -44,7 +44,7 @@ class StoreRequest extends FormRequest
public function getAll(): array
{
return [
- 'name' => $this->convertString('name'),
+ 'name' => $this->convertString('name'),
'notes' => $this->stringWithNewlines('notes'),
'color' => $this->convertString('color'),
];
@@ -56,7 +56,7 @@ class StoreRequest extends FormRequest
public function rules(): array
{
return [
- 'name' => ['required', 'min:1', 'max:100', 'uniqueObjectForUser:categories,name'],
+ 'name' => ['required', 'min:1', 'max:100', 'uniqueObjectForUser:categories,name'],
'notes' => ['nullable', 'string', 'max:65535'],
'color' => ['nullable', 'string', 'max:6', 'regex:/^[0-9a-fA-F]{6}$/'],
];
diff --git a/app/Api/V1/Requests/Models/Category/UpdateRequest.php b/app/Api/V1/Requests/Models/Category/UpdateRequest.php
index 06c041c340..0fb84f3e0f 100644
--- a/app/Api/V1/Requests/Models/Category/UpdateRequest.php
+++ b/app/Api/V1/Requests/Models/Category/UpdateRequest.php
@@ -45,9 +45,9 @@ class UpdateRequest extends FormRequest
public function getAll(): array
{
$fields = [
- 'name' => ['name', 'convertString'],
+ 'name' => ['name', 'convertString'],
'color' => ['color', 'convertString'],
- 'notes' => ['notes', 'stringWithNewlines']
+ 'notes' => ['notes', 'stringWithNewlines'],
];
return $this->getAllData($fields);
@@ -62,7 +62,7 @@ class UpdateRequest extends FormRequest
$category = $this->route()->parameter('category');
return [
- 'name' => sprintf('min:1|max:100|uniqueObjectForUser:categories,name,%d', $category->id),
+ 'name' => sprintf('min:1|max:100|uniqueObjectForUser:categories,name,%d', $category->id),
'notes' => ['nullable', 'string', 'max:65535'],
'color' => ['nullable', 'string', 'max:6', 'regex:/^[0-9a-fA-F]{6}$/'],
];
diff --git a/app/Factory/CategoryFactory.php b/app/Factory/CategoryFactory.php
index 9c1b3414ed..69e8270332 100644
--- a/app/Factory/CategoryFactory.php
+++ b/app/Factory/CategoryFactory.php
@@ -71,7 +71,12 @@ class CategoryFactory
}
try {
- return Category::create(['user_id' => $this->user->id, 'user_group_id' => $this->user->user_group_id, 'name' => $categoryName, 'color' => $color]);
+ return Category::create([
+ 'user_id' => $this->user->id,
+ 'user_group_id' => $this->user->user_group_id,
+ 'name' => $categoryName,
+ 'color' => $color,
+ ]);
} catch (QueryException $e) {
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
diff --git a/app/Http/Controllers/Budget/BudgetLimitController.php b/app/Http/Controllers/Budget/BudgetLimitController.php
index 2edb4f5531..d461374baa 100644
--- a/app/Http/Controllers/Budget/BudgetLimitController.php
+++ b/app/Http/Controllers/Budget/BudgetLimitController.php
@@ -198,7 +198,13 @@ final class BudgetLimitController extends Controller
if ($request->expectsJson()) {
$array = $limit->toArray();
// add some extra metadata:
- $spentArr = $this->opsRepository->sumExpenses($limit->start_date, $limit->end_date, null, new Collection()->push($budget), $currency);
+ $spentArr = $this->opsRepository->sumExpenses(
+ $limit->start_date,
+ $limit->end_date,
+ null,
+ new Collection()->push($budget),
+ $currency
+ );
$array['spent'] = $spentArr[$currency->id]['sum'] ?? '0';
$array['left_formatted'] = Amount::formatAnything($limit->transactionCurrency, bcadd($array['spent'], (string) $array['amount']));
$array['amount_formatted'] = Amount::formatAnything($limit->transactionCurrency, $limit['amount']);
diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php
index 65429e59c1..52c6f900e3 100644
--- a/app/Http/Controllers/Budget/IndexController.php
+++ b/app/Http/Controllers/Budget/IndexController.php
@@ -272,7 +272,10 @@ final class IndexController extends Controller
if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) {
$array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum'];
- $array['spent'][$currency->id]['spent_outside'] = Steam::negative(bcsub($spentInLimits[$currency->id], $spentArr[$currency->id]['sum']));
+ $array['spent'][$currency->id]['spent_outside'] = Steam::negative(bcsub(
+ $spentInLimits[$currency->id],
+ $spentArr[$currency->id]['sum']
+ ));
$array['spent'][$currency->id]['currency_id'] = $currency->id;
$array['spent'][$currency->id]['currency_symbol'] = $currency->symbol;
$array['spent'][$currency->id]['currency_decimal_places'] = $currency->decimal_places;
diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php
index ad724137dc..f4b32fe5c5 100644
--- a/app/Http/Controllers/Chart/BudgetController.php
+++ b/app/Http/Controllers/Chart/BudgetController.php
@@ -539,7 +539,13 @@ final class BudgetController extends Controller
}
// get spent amount in this period for this currency.
- $sum = $this->opsRepository->sumExpenses($currentStart, $currentEnd, $accounts, new Collection()->push($budget), $currency);
+ $sum = $this->opsRepository->sumExpenses(
+ $currentStart,
+ $currentEnd,
+ $accounts,
+ new Collection()->push($budget),
+ $currency
+ );
$amount = Steam::positive($sum[$currency->id]['sum'] ?? '0');
$chartData[0]['entries'][$title] = Steam::bcround($amount, $currency->decimal_places);
diff --git a/app/Jobs/CreateAutoBudgetLimits.php b/app/Jobs/CreateAutoBudgetLimits.php
index fd94666f1d..ca2d5f0255 100644
--- a/app/Jobs/CreateAutoBudgetLimits.php
+++ b/app/Jobs/CreateAutoBudgetLimits.php
@@ -64,6 +64,7 @@ class CreateAutoBudgetLimits implements ShouldQueue
$newDate = clone $date;
$newDate->startOfDay();
$this->date = $newDate;
+
// Log::debug(sprintf('Created new CreateAutoBudgetLimits("%s")', $this->date->format('Y-m-d')));
}
}
@@ -132,7 +133,13 @@ class CreateAutoBudgetLimits implements ShouldQueue
// if has one, calculate expenses and use that as a base.
$repository = app(OperationsRepositoryInterface::class);
$repository->setUser($autoBudget->budget->user);
- $spent = $repository->sumExpenses($previousStart, $previousEnd, null, new Collection()->push($autoBudget->budget), $autoBudget->transactionCurrency);
+ $spent = $repository->sumExpenses(
+ $previousStart,
+ $previousEnd,
+ null,
+ new Collection()->push($autoBudget->budget),
+ $autoBudget->transactionCurrency
+ );
$currencyId = $autoBudget->transaction_currency_id;
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
@@ -222,7 +229,13 @@ class CreateAutoBudgetLimits implements ShouldQueue
// if has one, calculate expenses and use that as a base.
$repository = app(OperationsRepositoryInterface::class);
$repository->setUser($autoBudget->budget->user);
- $spent = $repository->sumExpenses($previousStart, $previousEnd, null, new Collection()->push($autoBudget->budget), $autoBudget->transactionCurrency);
+ $spent = $repository->sumExpenses(
+ $previousStart,
+ $previousEnd,
+ null,
+ new Collection()->push($autoBudget->budget),
+ $autoBudget->transactionCurrency
+ );
$currencyId = $autoBudget->transaction_currency_id;
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
diff --git a/app/Jobs/DownloadExchangeRates.php b/app/Jobs/DownloadExchangeRates.php
index f2cef4d911..932c7f0a0b 100644
--- a/app/Jobs/DownloadExchangeRates.php
+++ b/app/Jobs/DownloadExchangeRates.php
@@ -70,6 +70,7 @@ class DownloadExchangeRates implements ShouldQueue
$newDate = clone $date;
$newDate->startOfDay();
$this->date = $newDate;
+
// Log::debug(sprintf('Created new DownloadExchangeRates("%s")', $this->date->format('Y-m-d')));
}
}
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 0e3c2527ac..36626f9b82 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -44,7 +44,7 @@ class Category extends Model
use ReturnsIntegerUserIdTrait;
use SoftDeletes;
- protected $fillable = ['user_id', 'user_group_id', 'name','color'];
+ protected $fillable = ['user_id', 'user_group_id', 'name', 'color'];
protected $hidden = ['encrypted'];
diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php
index d25bd74240..3f8e0fb6d3 100644
--- a/app/Repositories/Category/CategoryRepository.php
+++ b/app/Repositories/Category/CategoryRepository.php
@@ -36,8 +36,6 @@ use FireflyIII\Services\Internal\Destroy\CategoryDestroyService;
use FireflyIII\Services\Internal\Update\CategoryUpdateService;
use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
-use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
-use Illuminate\Database\Query\JoinClause;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
@@ -190,7 +188,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
*/
public function getCategories(array $sort = [], array $filter = []): Collection
{
- $query = $this->user->categories()->with(['attachments']);
+ $query = $this->user->categories()->with(['attachments']);
// add sort parameters
$allowed = config('firefly.allowed_db_sort_parameters.Category', []);
@@ -319,7 +317,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
/** @var CategoryFactory $factory */
$factory = app(CategoryFactory::class);
$factory->setUser($this->user);
- $color= array_key_exists('color', $data) ? $data['color'] : null;
+ $color = array_key_exists('color', $data) ? $data['color'] : null;
$category = $factory->findOrCreate(null, $data['name'], $color);
if (null === $category) {
diff --git a/app/Services/Internal/Update/CategoryUpdateService.php b/app/Services/Internal/Update/CategoryUpdateService.php
index c5f11fff30..c3e446c3d7 100644
--- a/app/Services/Internal/Update/CategoryUpdateService.php
+++ b/app/Services/Internal/Update/CategoryUpdateService.php
@@ -66,12 +66,12 @@ class CategoryUpdateService
$changed = false;
if (array_key_exists('name', $data)) {
$category->name = $data['name'];
- $changed = true;
+ $changed = true;
}
if (array_key_exists('color', $data)) {
- $data['color'] = '' === $data['color'] ? null : $data['color'];
+ $data['color'] = '' === $data['color'] ? null : $data['color'];
$category->color = $data['color'];
- $changed = true;
+ $changed = true;
}
if ($changed) {
$category->save();
diff --git a/app/Support/Http/Api/ChecksSortType.php b/app/Support/Http/Api/ChecksSortType.php
index 2e31760b63..88866d36f4 100644
--- a/app/Support/Http/Api/ChecksSortType.php
+++ b/app/Support/Http/Api/ChecksSortType.php
@@ -1,4 +1,5 @@
<?php
+
/*
* ChecksSortType.php
* Copyright (c) 2026 [email protected]
@@ -23,7 +24,8 @@ declare(strict_types=1);
namespace FireflyIII\Support\Http\Api;
-trait ChecksSortType {
+trait ChecksSortType
+{
protected function isAllDatabaseSort(array $instructions, string $model): bool
{
if (0 === count($instructions)) {
diff --git a/app/Support/Http/Controllers/AugumentData.php b/app/Support/Http/Controllers/AugumentData.php
index a3a940b1ba..a507156873 100644
--- a/app/Support/Http/Controllers/AugumentData.php
+++ b/app/Support/Http/Controllers/AugumentData.php
@@ -222,7 +222,14 @@ trait AugumentData
$currentEnd->addMonth();
}
// primary currency amount.
- $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, $this->convertToPrimary);
+ $expenses = $opsRepository->sumExpenses(
+ $currentStart,
+ $currentEnd,
+ null,
+ $budgetCollection,
+ $entry->transactionCurrency,
+ $this->convertToPrimary
+ );
$spent = $expenses[$currency->id]['sum'] ?? '0';
$entry->pc_spent = $spent;
diff --git a/app/Support/JsonApi/Enrichments/CategoryEnrichment.php b/app/Support/JsonApi/Enrichments/CategoryEnrichment.php
index aac65acb9d..afd4c47e25 100644
--- a/app/Support/JsonApi/Enrichments/CategoryEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/CategoryEnrichment.php
@@ -26,7 +26,6 @@ namespace FireflyIII\Support\JsonApi\Enrichments;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
-use FireflyIII\Models\Account;
use FireflyIII\Models\Category;
use FireflyIII\Models\Note;
use FireflyIII\Models\TransactionJournal;
@@ -39,20 +38,20 @@ use Illuminate\Support\Collection;
class CategoryEnrichment implements EnrichmentInterface
{
private Collection $collection;
- private array $earned = [];
- private ?Carbon $end = null;
- private array $ids = [];
- private array $sort = [];
- private array $notes = [];
- private array $pcEarned = [];
- private array $pcSpent = [];
- private array $pcTransfers = [];
- private array $spent = [];
- private ?Carbon $start = null;
- private array $transfers = [];
- private array $lastActivity = [];
- private User $user;
- private UserGroup $userGroup;
+ private array $earned = [];
+ private ?Carbon $end = null;
+ private array $ids = [];
+ private array $sort = [];
+ private array $notes = [];
+ private array $pcEarned = [];
+ private array $pcSpent = [];
+ private array $pcTransfers = [];
+ private array $spent = [];
+ private ?Carbon $start = null;
+ private array $transfers = [];
+ private array $lastActivity = [];
+ private User $user;
+ private UserGroup $userGroup;
public function enrich(Collection $collection): Collection
{
@@ -67,7 +66,7 @@ class CategoryEnrichment implements EnrichmentInterface
return $this->collection;
}
- public function enrichSingle(array | Model $model): array | Model
+ public function enrichSingle(array|Model $model): array|Model
{
// Log::debug(__METHOD__);
$collection = new Collection()->push($model);
@@ -81,6 +80,11 @@ class CategoryEnrichment implements EnrichmentInterface
$this->end = $end;
}
+ public function setSort(array $sort): void
+ {
+ $this->sort = $sort;
+ }
+
public function setStart(?Carbon $start): void
{
$this->start = $start;
@@ -100,16 +104,16 @@ class CategoryEnrichment implements EnrichmentInterface
private function appendCollectedData(): void
{
$this->collection = $this->collection->map(function (Category $item): Category {
- $id = (int)$item->id;
+ $id = (int) $item->id;
$meta = [
'last_activity' => $this->lastActivity[$id] ?? null,
- 'notes' => $this->notes[$id] ?? null,
- 'spent' => $this->spent[$id] ?? null,
- 'pc_spent' => $this->pcSpent[$id] ?? null,
- 'earned' => $this->earned[$id] ?? null,
- 'pc_earned' => $this->pcEarned[$id] ?? null,
- 'transfers' => $this->transfers[$id] ?? null,
- 'pc_transfers' => $this->pcTransfers[$id] ?? null,
+ 'notes' => $this->notes[$id] ?? null,
+ 'spent' => $this->spent[$id] ?? null,
+ 'pc_spent' => $this->pcSpent[$id] ?? null,
+ 'earned' => $this->earned[$id] ?? null,
+ 'pc_earned' => $this->pcEarned[$id] ?? null,
+ 'transfers' => $this->transfers[$id] ?? null,
+ 'pc_transfers' => $this->pcTransfers[$id] ?? null,
];
$item->meta = $meta;
@@ -121,23 +125,19 @@ class CategoryEnrichment implements EnrichmentInterface
{
/** @var Category $category */
foreach ($this->collection as $category) {
- $this->ids[] = (int)$category->id;
+ $this->ids[] = (int) $category->id;
}
$this->ids = array_unique($this->ids);
}
- public function setSort(array $sort): void
- {
- $this->sort = $sort;
- }
-
private function collectLastActivity(): void
{
$query = TransactionJournal::query()
- ->leftJoin('category_transaction_journal', 'transaction_journals.id', '=', 'category_transaction_journal.transaction_journal_id')
- ->whereIn('category_transaction_journal.category_id', $this->ids)
- ->selectRaw('category_transaction_journal.category_id, MAX(transaction_journals.date) as last_activity')
- ->groupBy('category_transaction_journal.category_id');
+ ->leftJoin('category_transaction_journal', 'transaction_journals.id', '=', 'category_transaction_journal.transaction_journal_id')
+ ->whereIn('category_transaction_journal.category_id', $this->ids)
+ ->selectRaw('category_transaction_journal.category_id, MAX(transaction_journals.date) as last_activity')
+ ->groupBy('category_transaction_journal.category_id')
+ ;
if (null !== $this->end) {
$query->where('transaction_journals.date', '<=', $this->end);
}
@@ -145,23 +145,24 @@ class CategoryEnrichment implements EnrichmentInterface
$query->where('transaction_journals.date', '>=', $this->start);
}
- $set = $query->get(['category_transaction_journal.category_id', 'last_activity']);
- foreach($set as $entry) {
- $this->lastActivity[(int)$entry->category_id] = Carbon::parse($entry->last_activity, config('app.timezone'));
+ $set = $query->get(['category_transaction_journal.category_id', 'last_activity']);
+ foreach ($set as $entry) {
+ $this->lastActivity[(int) $entry->category_id] = Carbon::parse($entry->last_activity, config('app.timezone'));
}
}
private function collectNotes(): void
{
$notes = Note::query()
- ->whereIn('noteable_id', $this->ids)
- ->whereNotNull('notes.text')
- ->where('notes.text', '!=', '')
- ->where('noteable_type', Category::class)
- ->get(['notes.noteable_id', 'notes.text'])
- ->toArray();
+ ->whereIn('noteable_id', $this->ids)
+ ->whereNotNull('notes.text')
+ ->where('notes.text', '!=', '')
+ ->where('noteable_type', Category::class)
+ ->get(['notes.noteable_id', 'notes.text'])
+ ->toArray()
+ ;
foreach ($notes as $note) {
- $this->notes[(int)$note['noteable_id']] = (string)$note['text'];
+ $this->notes[(int) $note['noteable_id']] = (string) $note['text'];
}
// Log::debug(sprintf('Enrich with %d note(s)', count($this->notes)));
@@ -174,11 +175,11 @@ class CategoryEnrichment implements EnrichmentInterface
$opsRepository = app(OperationsRepositoryInterface::class);
$opsRepository->setUser($this->user);
$opsRepository->setUserGroup($this->userGroup);
- $expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection);
- $income = $opsRepository->collectIncome($this->start, $this->end, null, $this->collection);
- $transfers = $opsRepository->collectTransfers($this->start, $this->end, null, $this->collection);
+ $expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection);
+ $income = $opsRepository->collectIncome($this->start, $this->end, null, $this->collection);
+ $transfers = $opsRepository->collectTransfers($this->start, $this->end, null, $this->collection);
foreach ($this->collection as $item) {
- $id = (int)$item->id;
+ $id = (int) $item->id;
$this->spent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative'));
$this->pcSpent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative', true));
$this->earned[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($income, $item, 'positive'));
@@ -188,6 +189,7 @@ class CategoryEnrichment implements EnrichmentInterface
}
}
}
+
private function sortData(): void
{
$dbParams = config('firefly.allowed_db_sort_parameters.Category', []);
diff --git a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php
index d0c09bf027..2428353cb0 100644
--- a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php
@@ -354,7 +354,11 @@ class RecurringEnrichment implements EnrichmentInterface
/** @var RecurrenceRepetition $repetition */
foreach ($set as $repetition) {
- $recurrence = $this->collection->filter(static fn (Recurrence $item): bool => (int) $item->id === (int) $repetition->recurrence_id)->first();
+ $recurrence = $this->collection->filter(
+ static fn (Recurrence $item): bool => (int) $item->id === (int) $repetition->recurrence_id
+ )
+ ->first()
+ ;
$fromDate = clone ($recurrence->latest_date ?? $recurrence->first_date);
$recurrenceId = (int) $repetition->recurrence_id;
$repId = (int) $repetition->id;
diff --git a/app/Transformers/CategoryTransformer.php b/app/Transformers/CategoryTransformer.php
index bfeddb327d..d949d72aa1 100644
--- a/app/Transformers/CategoryTransformer.php
+++ b/app/Transformers/CategoryTransformer.php
@@ -60,18 +60,18 @@ class CategoryTransformer extends AbstractTransformer
// category never has currency settings.
'object_has_currency_setting' => false,
- 'primary_currency_id' => (string)$this->primaryCurrency->id,
+ 'primary_currency_id' => (string) $this->primaryCurrency->id,
'primary_currency_name' => $this->primaryCurrency->name,
'primary_currency_code' => $this->primaryCurrency->code,
'primary_currency_symbol' => $this->primaryCurrency->symbol,
- 'primary_currency_decimal_places' => (int)$this->primaryCurrency->decimal_places,
+ 'primary_currency_decimal_places' => (int) $this->primaryCurrency->decimal_places,
'spent' => $this->beautify($category->meta['spent']),
'pc_spent' => $this->beautify($category->meta['pc_spent']),
'earned' => $this->beautify($category->meta['earned']),
'pc_earned' => $this->beautify($category->meta['pc_earned']),
'transferred' => $this->beautify($category->meta['transfers']),
'pc_transferred' => $this->beautify($category->meta['pc_transfers']),
- 'links' => [['rel' => 'self', 'uri' => '/categories/' . $category->id]],
+ 'links' => [['rel' => 'self', 'uri' => '/categories/'.$category->id]],
];
}
@@ -82,7 +82,7 @@ class CategoryTransformer extends AbstractTransformer
}
$return = [];
foreach ($array as $data) {
- $data['sum'] = Steam::bcround($data['sum'], (int)$data['currency_decimal_places']);
+ $data['sum'] = Steam::bcround($data['sum'], (int) $data['currency_decimal_places']);
$return[] = $data;
}
diff --git a/composer.lock b/composer.lock
index 146c23f63e..d81fc4742a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -11638,11 +11638,11 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.3.0",
+ "version": "2.3.1",
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b1f9890d9af53a25c58129e78f0aadd31f90d7f4",
- "reference": "b1f9890d9af53a25c58129e78f0aadd31f90d7f4",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6155239b488e95d26d1ebd95c6b4bb294d7f09db",
+ "reference": "6155239b488e95d26d1ebd95c6b4bb294d7f09db",
"shasum": ""
},
"require": {
@@ -11698,7 +11698,7 @@
"type": "github"
}
],
- "time": "2026-10-06T06:15:36+00:00"
+ "time": "2026-10-08T21:09:11+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
diff --git a/config/firefly.php b/config/firefly.php
index e65aa329d0..a8817b8542 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -78,8 +78,8 @@ return [
'running_balance_column' => (bool)env_default_when_empty(env('USE_RUNNING_BALANCE'), true), // this is only the default value, is not used.
// see cer.php for exchange rates feature flag.
],
-'version' => 'develop/2026-10-08',
-'build_time' => 1791488344,
+'version' => 'develop/2026-10-09',
+'build_time' => 1791523702,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.
@@ -849,16 +849,16 @@ return [
// dynamic date ranges are as follows:
'dynamic_date_ranges' => ['last7', 'last30', 'last90', 'last365', 'MTD', 'QTD', 'YTD'],
'allowed_filter_parameters' => [
- 'Account' => [
+ 'Account' => [
'name',
'account_number_and_iban',
],
'Category' => [
- 'name'
+ 'name',
],
],
'allowed_sort_parameters' => [
- 'Account' => [
+ 'Account' => [
'id',
'order',
'name',
@@ -885,11 +885,11 @@ return [
'Category' => [
'id',
'name',
- 'last_activity'
+ 'last_activity',
],
],
'allowed_db_sort_parameters' => [
- 'Account' => ['id', 'order', 'name', 'iban', 'active', 'account_type_id'],
+ 'Account' => ['id', 'order', 'name', 'iban', 'active', 'account_type_id'],
'Category' => ['name'],
],
diff --git a/database/migrations/2026_10_09_062600_migrations_10_2026.php b/database/migrations/2026_10_09_062600_migrations_10_2026.php
index 6e83cdc59e..f6221d88b0 100644
--- a/database/migrations/2026_10_09_062600_migrations_10_2026.php
+++ b/database/migrations/2026_10_09_062600_migrations_10_2026.php
@@ -7,37 +7,36 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
-return new class extends Migration
-{
+return new class extends Migration {
/**
- * Run the migrations.
+ * Reverse the migrations.
*/
- public function up(): void
+ public function down(): void
{
try {
Schema::table('categories', static function (Blueprint $table): void {
- if (!Schema::hasColumn('categories', 'color')) {
- $table->string('color', 6)->nullable()->after('name');
+ if (Schema::hasColumn('categories', 'color')) {
+ $table->dropColumn('color');
}
});
} catch (RuntimeException $e) {
- Log::error(sprintf('Could not add column: %s', $e->getMessage()));
+ Log::error(sprintf('Could not drop column: %s', $e->getMessage()));
}
}
/**
- * Reverse the migrations.
+ * Run the migrations.
*/
- public function down(): void
+ public function up(): void
{
try {
Schema::table('categories', static function (Blueprint $table): void {
- if (Schema::hasColumn('categories', 'color')) {
- $table->dropColumn('color');
+ if (!Schema::hasColumn('categories', 'color')) {
+ $table->string('color', 6)->nullable()->after('name');
}
});
} catch (RuntimeException $e) {
- Log::error(sprintf('Could not drop column: %s', $e->getMessage()));
+ Log::error(sprintf('Could not add column: %s', $e->getMessage()));
}
}
};
diff --git a/resources/assets/v3/js/pages/accounts/index.js b/resources/assets/v3/js/pages/accounts/index.js
index bed2046e90..73e03f483c 100644
--- a/resources/assets/v3/js/pages/accounts/index.js
+++ b/resources/assets/v3/js/pages/accounts/index.js
@@ -22,14 +22,14 @@ import "../../boot/bootstrap.js";
import sidebar from "../shared/sidebar.js";
import dates from "../shared/dates.js";
import Alpine from "@alpinejs/csp";
-import {getVariable} from "../../store/get-variable.js";
+import { getVariable } from "../../store/get-variable.js";
import Put from "../../api/model/account/put.js";
import Get from "../../api/model/account/get.js";
import formatDate from "../../util/format-date.js";
import formatMoney from "../../util/format-money.js";
import i18next from "i18next";
-import {addDrag} from "../shared/drag-and-droppable-rows.js";
-import {sortableTable, storeFilterAndSort, updateHistory} from "../shared/sortable-tables.js";
+import { addDrag } from "../shared/drag-and-droppable-rows.js";
+import { sortableTable, storeFilterAndSort, updateHistory } from "../shared/sortable-tables.js";
window.enableDates = true;
@@ -140,7 +140,7 @@ let index = function () {
let item = e.detail[i];
if (item.order !== item.currentOrder) {
// PUT new order to system.
- new Put().put({order: item.order}, {id: item.id});
+ new Put().put({ order: item.order }, { id: item.id });
// save new order as current order in the row.
document
@@ -191,7 +191,7 @@ let index = function () {
"asc" === this.sortableTable.sortDirection
? this.sortableTable.sortColumn
: "-" + this.sortableTable.sortColumn;
- console.log("downloadObjects:", {page: this.page, sort: sort});
+ console.log("downloadObjects:", { page: this.page, sort: sort });
let start = window.store.get("start");
let end = window.store.get("end");
this.convertToPrimary = window.store.get("convert_to_primary");
@@ -237,7 +237,11 @@ let index = function () {
this.debts[pcc] += current.attributes.pc_debt_amount_float;
this.differences[pcc] += current.attributes.pc_balance_difference_float;
}
- let lastActivity = formatDate(current.attributes.last_activity, i18next.t("config.date_time_fns_short", {lng: locale}), locale);
+ let lastActivity = formatDate(
+ current.attributes.last_activity,
+ i18next.t("config.date_time_fns_short", { lng: locale }),
+ locale,
+ );
let noLastActivity = false;
if ("" === lastActivity) {
diff --git a/resources/assets/v3/js/pages/categories/index.js b/resources/assets/v3/js/pages/categories/index.js
index b4656e28c4..98a8bf3a20 100644
--- a/resources/assets/v3/js/pages/categories/index.js
+++ b/resources/assets/v3/js/pages/categories/index.js
@@ -29,7 +29,6 @@ window.enableDates = false;
import { sortableTable, storeFilterAndSort, updateHistory } from "../shared/sortable-tables.js";
import Get from "../../api/model/category/get.js";
-
let index = function () {
return {
categories: [],
@@ -60,7 +59,7 @@ let index = function () {
sortableTable: null,
init() {
- console.log('init');
+ console.log("init");
this.sortableTable = new sortableTable("main");
this.i18next = i18next;
this.anonymous = window.store.get("anonymous");
@@ -111,11 +110,13 @@ let index = function () {
this.downloadObjects();
});
this.downloadObjects();
-
},
downloadObjects() {
this.sortableTable.loadingNewSort = true;
- let sort = "asc" === this.sortableTable.sortDirection ? this.sortableTable.sortColumn : "-" + this.sortableTable.sortColumn;
+ let sort =
+ "asc" === this.sortableTable.sortDirection
+ ? this.sortableTable.sortColumn
+ : "-" + this.sortableTable.sortColumn;
this.convertToPrimary = window.store.get("convert_to_primary");
let locale = window.store.get("locale");
new Get()
@@ -133,10 +134,14 @@ let index = function () {
if (Object.hasOwn(response.data.data, i)) {
let current = response.data.data[i];
console.log(current);
- let lastActivity = i18next.t('firefly.never');
+ let lastActivity = i18next.t("firefly.never");
let noLastActivity = true;
- if(null !== current.attributes.last_activity) {
- lastActivity = formatDate(current.attributes.last_activity, i18next.t("config.date_time_fns", { lng: locale }), locale);
+ if (null !== current.attributes.last_activity) {
+ lastActivity = formatDate(
+ current.attributes.last_activity,
+ i18next.t("config.date_time_fns", { lng: locale }),
+ locale,
+ );
noLastActivity = false;
}
@@ -159,9 +164,9 @@ let index = function () {
});
}
});
- }
- }
-}
+ },
+ };
+};
const comps = {
index,