🤖 Auto commit for release 'develop' on 2026-02-08

This commit is contained in:
JC5
2026-02-08 07:15:58 +01:00
parent 2848a64c13
commit 34160da67a
17 changed files with 111 additions and 67 deletions
@@ -36,6 +36,7 @@ class UpdatedExistingAccount extends Event
* Create a new event instance. * Create a new event instance.
*/ */
public function __construct( public function __construct(
public Account $account,public array $oldData public Account $account,
public array $oldData
) {} ) {}
} }
@@ -40,48 +40,13 @@ use Illuminate\Support\Facades\Log;
class UpdatesAccountInformation implements ShouldQueue class UpdatesAccountInformation implements ShouldQueue
{ {
public function handle(CreatedNewAccount | UpdatedExistingAccount $event): void public function handle(CreatedNewAccount|UpdatedExistingAccount $event): void
{ {
$this->recalculateCredit($event->account); $this->recalculateCredit($event->account);
$this->updateVirtualBalance($event->account); $this->updateVirtualBalance($event->account);
if ($event instanceof UpdatedExistingAccount) { if ($event instanceof UpdatedExistingAccount) {
$this->renameRules($event->account, $event->oldData); $this->renameRules($event->account, $event->oldData);
} }
}
private function correctRuleTriggers(Account $account, array $oldData, Rule $rule): void
{
$nameFields = ['source_account_is', 'source_account_contains', 'source_account_ends', 'source_account_starts', 'destination_account_is', 'destination_account_contains', 'destination_account_ends', 'destination_account_starts', 'account_is', 'account_contains', 'account_ends', 'account_starts',];
$numberFields = ['source_account_nr_is', 'source_account_nr_contains', 'source_account_nr_ends', 'source_account_nr_starts', 'destination_account_nr_is', 'destination_account_nr_contains', 'destination_account_nr_starts', 'account_nr_is', 'account_nr_contains', 'account_nr_ends', 'account_nr_starts',];
Log::debug(sprintf('Check if rule #%d triggers reference account #%d "%s"', $rule->id, $account->id, $account->name));
$fixed = 0;
/** @var RuleTrigger $trigger */
foreach ($rule->ruleTriggers as $trigger) {
// fix name:
if ($oldData['name'] === $trigger->trigger_value && in_array($trigger->trigger_type, $nameFields, true)) {
Log::debug(sprintf('Rule trigger #%d "%s" has old account name, replace with new.', $trigger->id, $trigger->trigger_type));
$trigger->trigger_value = $account->name;
$trigger->save();
$fixed++;
}
// fix IBAN:
if ($oldData['iban'] === $trigger->trigger_value && in_array($trigger->trigger_type, $numberFields, true)) {
Log::debug(sprintf('Rule trigger #%d "%s" has old account IBAN, replace with new.', $trigger->id, $trigger->trigger_type));
$trigger->trigger_value = $account->iban;
$trigger->save();
$fixed++;
}
// fix account number: // account_number
if ($oldData['account_number'] === $trigger->trigger_value && in_array($trigger->trigger_type, $numberFields, true)) {
Log::debug(sprintf('Rule trigger #%d "%s" has old account account_number, replace with new.', $trigger->id, $trigger->trigger_type));
$trigger->trigger_value = $account->iban;
$trigger->save();
$fixed++;
}
}
Log::debug(sprintf('Corrected %d trigger(s) for rule #%d', $fixed, $rule->id));
} }
private function correctRuleActions(Account $account, array $oldData, Rule $rule): void private function correctRuleActions(Account $account, array $oldData, Rule $rule): void
@@ -89,21 +54,81 @@ class UpdatesAccountInformation implements ShouldQueue
$fields = ['set_source_account', 'set_destination_account']; $fields = ['set_source_account', 'set_destination_account'];
Log::debug(sprintf('Check if rule #%d actions reference account #%d "%s"', $rule->id, $account->id, $account->name)); Log::debug(sprintf('Check if rule #%d actions reference account #%d "%s"', $rule->id, $account->id, $account->name));
$fixed = 0; $fixed = 0;
/** @var RuleAction $action */ /** @var RuleAction $action */
foreach ($rule->ruleActions as $action) { foreach ($rule->ruleActions as $action) {
// fix name: // fix name:
if ($oldData['name'] === $action->action_value && in_array($action->action_type, $fields, true)) { if ($oldData['name'] === $action->action_value && in_array($action->action_type, $fields, true)) {
Log::debug(sprintf('Rule action #%d "%s" has old account name, replace with new.', $action->id, $action->action_type)); Log::debug(sprintf('Rule action #%d "%s" has old account name, replace with new.', $action->id, $action->action_type));
$action->action_value = $account->name; $action->action_value = $account->name;
$action->save(); $action->save();
$fixed++; ++$fixed;
} }
} }
Log::debug(sprintf('Corrected %d action(s) for rule #%d', $fixed, $rule->id)); Log::debug(sprintf('Corrected %d action(s) for rule #%d', $fixed, $rule->id));
} }
private function correctRuleTriggers(Account $account, array $oldData, Rule $rule): void
{
$nameFields = [
'source_account_is',
'source_account_contains',
'source_account_ends',
'source_account_starts',
'destination_account_is',
'destination_account_contains',
'destination_account_ends',
'destination_account_starts',
'account_is',
'account_contains',
'account_ends',
'account_starts',
];
$numberFields = [
'source_account_nr_is',
'source_account_nr_contains',
'source_account_nr_ends',
'source_account_nr_starts',
'destination_account_nr_is',
'destination_account_nr_contains',
'destination_account_nr_starts',
'account_nr_is',
'account_nr_contains',
'account_nr_ends',
'account_nr_starts',
];
Log::debug(sprintf('Check if rule #%d triggers reference account #%d "%s"', $rule->id, $account->id, $account->name));
$fixed = 0;
/** @var RuleTrigger $trigger */
foreach ($rule->ruleTriggers as $trigger) {
// fix name:
if ($oldData['name'] === $trigger->trigger_value && in_array($trigger->trigger_type, $nameFields, true)) {
Log::debug(sprintf('Rule trigger #%d "%s" has old account name, replace with new.', $trigger->id, $trigger->trigger_type));
$trigger->trigger_value = $account->name;
$trigger->save();
++$fixed;
}
// fix IBAN:
if ($oldData['iban'] === $trigger->trigger_value && in_array($trigger->trigger_type, $numberFields, true)) {
Log::debug(sprintf('Rule trigger #%d "%s" has old account IBAN, replace with new.', $trigger->id, $trigger->trigger_type));
$trigger->trigger_value = $account->iban;
$trigger->save();
++$fixed;
}
// fix account number: // account_number
if ($oldData['account_number'] === $trigger->trigger_value && in_array($trigger->trigger_type, $numberFields, true)) {
Log::debug(sprintf('Rule trigger #%d "%s" has old account account_number, replace with new.', $trigger->id, $trigger->trigger_type));
$trigger->trigger_value = $account->iban;
$trigger->save();
++$fixed;
}
}
Log::debug(sprintf('Corrected %d trigger(s) for rule #%d', $fixed, $rule->id));
}
private function recalculateCredit(Account $account): void private function recalculateCredit(Account $account): void
{ {
Log::debug('Will call CreditRecalculateService because a new account was created or updated.'); Log::debug('Will call CreditRecalculateService because a new account was created or updated.');
@@ -119,7 +144,7 @@ class UpdatesAccountInformation implements ShouldQueue
Log::debug('Updated account, will now correct rules.'); Log::debug('Updated account, will now correct rules.');
$repository = app(RuleRepositoryInterface::class); $repository = app(RuleRepositoryInterface::class);
$repository->setUser($account->user); $repository->setUser($account->user);
$rules = $repository->getAll(); $rules = $repository->getAll();
/** @var Rule $rule */ /** @var Rule $rule */
foreach ($rules as $rule) { foreach ($rules as $rule) {
@@ -78,11 +78,11 @@ class AccountUpdateService
{ {
Log::debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$this->accountRepository->setUser($account->user); $this->accountRepository->setUser($account->user);
$this->user = $account->user; $this->user = $account->user;
$oldData = $account->toArray(); $oldData = $account->toArray();
$oldData['account_number'] = $this->accountRepository->getMetaValue($account, 'account_number'); $oldData['account_number'] = $this->accountRepository->getMetaValue($account, 'account_number');
$account = $this->updateAccount($account, $data); $account = $this->updateAccount($account, $data);
$account = $this->updateAccountOrder($account, $data); $account = $this->updateAccountOrder($account, $data);
// find currency, or use default currency instead. // find currency, or use default currency instead.
if (array_key_exists('currency_id', $data) || array_key_exists('currency_code', $data)) { if (array_key_exists('currency_id', $data) || array_key_exists('currency_code', $data)) {
+1
View File
@@ -42,6 +42,7 @@ class Calculator
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private static array $intervals = []; private static array $intervals = [];
public function isAvailablePeriodicity(Periodicity $periodicity): bool public function isAvailablePeriodicity(Periodicity $periodicity): bool
@@ -102,6 +102,8 @@ class ExportDataGenerator
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
public function __construct() public function __construct()
{ {
$this->accounts = new Collection(); $this->accounts = new Collection();
@@ -87,6 +87,7 @@ trait PeriodOverview
// temp data holder // temp data holder
// temp data holder // temp data holder
// temp data holder // temp data holder
// temp data holder
private array $transactions; // temp data holder private array $transactions; // temp data holder
// temp data holder // temp data holder
@@ -101,6 +102,8 @@ trait PeriodOverview
// temp data holder // temp data holder
// temp data holder
/** /**
* This method returns "period entries", so nov-2015, dec-2015, etc. (this depends on the users session range) * This method returns "period entries", so nov-2015, dec-2015, etc. (this depends on the users session range)
* and for each period, the amount of money spent and earned. This is a complex operation which is cached for * and for each period, the amount of money spent and earned. This is a complex operation which is cached for
@@ -47,6 +47,7 @@ class AvailableBudgetEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private readonly bool $convertToPrimary; // @phpstan-ignore-line private readonly bool $convertToPrimary; // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
@@ -54,6 +55,7 @@ class AvailableBudgetEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private array $currencies = []; private array $currencies = [];
private array $currencyIds = []; private array $currencyIds = [];
private array $ids = []; private array $ids = [];
@@ -47,6 +47,7 @@ class BudgetLimitEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private array $currencies = []; private array $currencies = [];
private array $currencyIds = []; private array $currencyIds = [];
private Carbon $end; private Carbon $end;
@@ -49,6 +49,7 @@ class PiggyBankEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private array $accounts = []; // @phpstan-ignore-line private array $accounts = []; // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
@@ -56,6 +57,7 @@ class PiggyBankEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private array $amounts = []; private array $amounts = [];
private Collection $collection; private Collection $collection;
private array $currencies = []; private array $currencies = [];
@@ -44,6 +44,7 @@ class PiggyBankEventEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private array $accountIds = []; // @phpstan-ignore-line private array $accountIds = []; // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
@@ -51,6 +52,7 @@ class PiggyBankEventEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private Collection $collection; private Collection $collection;
private array $currencies = []; private array $currencies = [];
private array $groupIds = []; private array $groupIds = [];
@@ -53,6 +53,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private readonly bool $convertToPrimary; private readonly bool $convertToPrimary;
private ?Carbon $end = null; private ?Carbon $end = null;
private array $mappedObjects = []; private array $mappedObjects = [];
@@ -67,6 +67,8 @@ class TransactionGroupEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
public function __construct() public function __construct()
{ {
$this->dateFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date']; $this->dateFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date'];
@@ -49,6 +49,7 @@ class WebhookEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private array $ids = []; // @phpstan-ignore-line private array $ids = []; // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
@@ -56,6 +57,7 @@ class WebhookEnrichment implements EnrichmentInterface
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line // @phpstan-ignore-line
// @phpstan-ignore-line
private array $responses = []; private array $responses = [];
private array $triggers = []; private array $triggers = [];
private array $webhookDeliveries = []; private array $webhookDeliveries = [];
+3 -3
View File
@@ -6,9 +6,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## v6.4.18 ## v6.4.18
### Fixed ### Fixed
- #11671 - [Discussion 11671](https://github.com/orgs/firefly-iii/discussions/11671) (Subscriptions Next Expected Match) started by @idgaron
- #11667 - [Issue 11667](https://github.com/firefly-iii/firefly-iii/issues/11667) (Account names and numbers are not corrected in rules when the account is updated) reported by @Kage1
- #11668 - [Issue 11668](https://github.com/firefly-iii/firefly-iii/issues/11668) (Auto-budget cron crashes on develop: Call to a member function budgets() on null (BudgetLimitRepository.php:311)) reported by @sykmer
## v6.4.17 - 2026-02-06 ## v6.4.17 - 2026-02-06
Generated
+14 -14
View File
@@ -130,16 +130,16 @@
}, },
{ {
"name": "brick/math", "name": "brick/math",
"version": "0.14.6", "version": "0.14.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/brick/math.git", "url": "https://github.com/brick/math.git",
"reference": "32498d5e1897e7642c0b961ace2df6d7dc9a3bc3" "reference": "07ff363b16ef8aca9692bba3be9e73fe63f34e50"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/brick/math/zipball/32498d5e1897e7642c0b961ace2df6d7dc9a3bc3", "url": "https://api.github.com/repos/brick/math/zipball/07ff363b16ef8aca9692bba3be9e73fe63f34e50",
"reference": "32498d5e1897e7642c0b961ace2df6d7dc9a3bc3", "reference": "07ff363b16ef8aca9692bba3be9e73fe63f34e50",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -178,7 +178,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/brick/math/issues", "issues": "https://github.com/brick/math/issues",
"source": "https://github.com/brick/math/tree/0.14.6" "source": "https://github.com/brick/math/tree/0.14.7"
}, },
"funding": [ "funding": [
{ {
@@ -186,7 +186,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2026-02-05T07:59:58+00:00" "time": "2026-02-07T10:57:35+00:00"
}, },
{ {
"name": "carbonphp/carbon-doctrine-types", "name": "carbonphp/carbon-doctrine-types",
@@ -3829,16 +3829,16 @@
}, },
{ {
"name": "nette/schema", "name": "nette/schema",
"version": "v1.3.3", "version": "v1.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nette/schema.git", "url": "https://github.com/nette/schema.git",
"reference": "2befc2f42d7c715fd9d95efc31b1081e5d765004" "reference": "086497a2f34b82fede9b5a41cc8e131d087cd8f7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nette/schema/zipball/2befc2f42d7c715fd9d95efc31b1081e5d765004", "url": "https://api.github.com/repos/nette/schema/zipball/086497a2f34b82fede9b5a41cc8e131d087cd8f7",
"reference": "2befc2f42d7c715fd9d95efc31b1081e5d765004", "reference": "086497a2f34b82fede9b5a41cc8e131d087cd8f7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3846,8 +3846,8 @@
"php": "8.1 - 8.5" "php": "8.1 - 8.5"
}, },
"require-dev": { "require-dev": {
"nette/tester": "^2.5.2", "nette/tester": "^2.6",
"phpstan/phpstan-nette": "^2.0@stable", "phpstan/phpstan": "^2.0@stable",
"tracy/tracy": "^2.8" "tracy/tracy": "^2.8"
}, },
"type": "library", "type": "library",
@@ -3888,9 +3888,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nette/schema/issues", "issues": "https://github.com/nette/schema/issues",
"source": "https://github.com/nette/schema/tree/v1.3.3" "source": "https://github.com/nette/schema/tree/v1.3.4"
}, },
"time": "2025-10-30T22:57:59+00:00" "time": "2026-02-08T02:54:00+00:00"
}, },
{ {
"name": "nette/utils", "name": "nette/utils",
+2 -2
View File
@@ -78,8 +78,8 @@ return [
'running_balance_column' => (bool)envNonEmpty('USE_RUNNING_BALANCE', true), // this is only the default value, is not used. 'running_balance_column' => (bool)envNonEmpty('USE_RUNNING_BALANCE', true), // this is only the default value, is not used.
// see cer.php for exchange rates feature flag. // see cer.php for exchange rates feature flag.
], ],
'version' => '6.4.17', 'version' => 'develop/2026-02-08',
'build_time' => 1770447202, 'build_time' => 1770531224,
'api_version' => '2.1.0', // field is no longer used. 'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used. 'db_version' => 28, // field is no longer used.
+3 -3
View File
@@ -3246,9 +3246,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "25.2.1", "version": "25.2.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.2.tgz",
"integrity": "sha512-CPrnr8voK8vC6eEtyRzvMpgp3VyVRhgclonE7qYi6P9sXwYb59ucfrnmFBTaP0yUi8Gk4yZg/LlTJULGxvTNsg==", "integrity": "sha512-BkmoP5/FhRYek5izySdkOneRyXYN35I860MFAGupTdebyE66uZaR+bXLHq8k4DirE5DwQi3NuhvRU1jqTVwUrQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {