Compare commits

...

9 Commits

Author SHA1 Message Date
github-actions[bot]
16eb2ca4ca Merge pull request #12051 from firefly-iii/release-1774843626
🤖 Automatically merge the PR into the develop branch.
2026-03-30 06:07:15 +02:00
JC5
f491155f9b 🤖 Auto commit for release 'develop' on 2026-03-30 2026-03-30 06:07:06 +02:00
github-actions[bot]
c5706e95b7 Merge pull request #12048 from firefly-iii/release-1774809887
🤖 Automatically merge the PR into the develop branch.
2026-03-29 20:44:53 +02:00
JC5
fdabb2c994 🤖 Auto commit for release 'develop' on 2026-03-29 2026-03-29 20:44:47 +02:00
James Cole
615fa733e6 Add extra debug. 2026-03-29 20:39:23 +02:00
github-actions[bot]
d3fc8673d3 Merge pull request #12047 from firefly-iii/release-1774809181
🤖 Automatically merge the PR into the develop branch.
2026-03-29 20:33:10 +02:00
JC5
db156ffcf2 🤖 Auto commit for release 'develop' on 2026-03-29 2026-03-29 20:33:01 +02:00
James Cole
59510a9acc Catch big group correction that does not need a balance correction. 2026-03-29 20:27:08 +02:00
James Cole
7f9640087e Fix https://github.com/firefly-iii/firefly-iii/issues/12043 2026-03-29 16:53:55 +02:00
8 changed files with 45 additions and 31 deletions

View File

@@ -61,6 +61,7 @@ class CorrectsGroupAccounts extends Command
$flags->applyRules = false;
$flags->fireWebhooks = false;
$flags->recalculateCredit = true;
$flags->unifyOnly = true;
$objects = new TransactionGroupEventObjects();
foreach ($groups as $groupId) {
$group = TransactionGroup::find($groupId);

View File

@@ -30,4 +30,5 @@ class TransactionGroupEventFlags
public bool $fireWebhooks = true;
public bool $batchSubmission = false;
public bool $recalculateCredit = true;
public bool $unifyOnly = false;
}

View File

@@ -40,8 +40,8 @@ class ProcessesUpdatedTransactionGroup
public function handle(UpdatedSingleTransactionGroup $event): void
{
Log::debug(sprintf('Now handling event %s', get_class($event)));
$this->unifyAccounts($event);
$effect = $this->unifyAccounts($event);
Log::debug(sprintf('Effect of unifyAccounts = %d', $effect));
Log::debug(sprintf('Transaction journal count is %d', $event->objects->transactionJournals->count()));
if (!$event->flags->applyRules) {
Log::debug(sprintf('Will NOT process rules for %d journal(s)', $event->objects->transactionJournals->count()));
@@ -63,7 +63,13 @@ class ProcessesUpdatedTransactionGroup
$this->createWebhookMessages($event->objects->transactionGroups, WebhookTrigger::UPDATE_TRANSACTION);
}
$this->removePeriodStatistics($event->objects);
$this->recalculateRunningBalance($event->objects);
if (0 === $effect && true === $event->flags->unifyOnly) {
Log::debug('Effect = 0, will not recalculate running balance.');
}
if (0 !== $effect || false === $event->flags->unifyOnly) {
Log::debug(sprintf('Effect is != 0 (%d) OR unifyOnly = false, will recalc running balance', $effect));
$this->recalculateRunningBalance($event->objects);
}
Log::debug('Done with handle() for UpdatedSingleTransactionGroup');
}
@@ -71,23 +77,26 @@ class ProcessesUpdatedTransactionGroup
/**
* This method will make sure all source / destination accounts are the same.
*/
protected function unifyAccounts(UpdatedSingleTransactionGroup $updatedGroupEvent): void
protected function unifyAccounts(UpdatedSingleTransactionGroup $updatedGroupEvent): int
{
Log::debug('Now in unifyAccounts()');
$effect = 0;
/** @var TransactionGroup $group */
foreach ($updatedGroupEvent->objects->transactionGroups as $group) {
$this->unifyAccountsForGroup($group);
$effect += $this->unifyAccountsForGroup($group);
}
Log::debug('Done with unifyAccounts()');
Log::debug(sprintf('Done with unifyAccounts(%d)', $effect));
return $effect;
}
private function unifyAccountsForGroup(TransactionGroup $group): void
private function unifyAccountsForGroup(TransactionGroup $group): int
{
if (1 === $group->transactionJournals->count()) {
Log::debug('Nothing to do in unifyAccounts()');
return;
return 0;
}
// first journal:
@@ -104,7 +113,7 @@ class ProcessesUpdatedTransactionGroup
if (null === $first) {
Log::warning(sprintf('Group #%d has no transaction journals.', $group->id));
return;
return 0;
}
$all = $group->transactionJournals()->get()->pluck('id')->toArray();
@@ -136,8 +145,10 @@ class ProcessesUpdatedTransactionGroup
if (0 === $effect) {
Log::debug(sprintf('Had nothing to do in unifyAccounts(#%d)', $group->id));
return;
return 0;
}
Log::debug(sprintf('Updated %d transaction(s) in unifyAccounts(#%d)', $effect, $group->id));
return $effect;
}
}

28
composer.lock generated
View File

@@ -10552,16 +10552,16 @@
},
{
"name": "fruitcake/laravel-debugbar",
"version": "v4.1.3",
"version": "v4.2.0",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-debugbar.git",
"reference": "b48a68c4f8ffcdfa3a10d49930da4b03588dc87b"
"reference": "fc022c562adc8e54be8e5d64af6d5ef11afff34b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/b48a68c4f8ffcdfa3a10d49930da4b03588dc87b",
"reference": "b48a68c4f8ffcdfa3a10d49930da4b03588dc87b",
"url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/fc022c562adc8e54be8e5d64af6d5ef11afff34b",
"reference": "fc022c562adc8e54be8e5d64af6d5ef11afff34b",
"shasum": ""
},
"require": {
@@ -10569,7 +10569,7 @@
"illuminate/session": "^11|^12|^13.0",
"illuminate/support": "^11|^12|^13.0",
"php": "^8.2",
"php-debugbar/php-debugbar": "^3.5",
"php-debugbar/php-debugbar": "^3.6",
"php-debugbar/symfony-bridge": "^1.1"
},
"replace": {
@@ -10601,7 +10601,7 @@
]
},
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -10638,7 +10638,7 @@
],
"support": {
"issues": "https://github.com/fruitcake/laravel-debugbar/issues",
"source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.1.3"
"source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.2.0"
},
"funding": [
{
@@ -10650,7 +10650,7 @@
"type": "github"
}
],
"time": "2026-03-09T14:55:04+00:00"
"time": "2026-03-29T19:12:51+00:00"
},
{
"name": "hamcrest/hamcrest-php",
@@ -11220,16 +11220,16 @@
},
{
"name": "php-debugbar/php-debugbar",
"version": "v3.5.1",
"version": "v3.6.0",
"source": {
"type": "git",
"url": "https://github.com/php-debugbar/php-debugbar.git",
"reference": "486b32fd98efe9a3c10f0b24c0caabc187f78f04"
"reference": "31f7d2e7943a82e72a670335d408d967b05efa5a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/486b32fd98efe9a3c10f0b24c0caabc187f78f04",
"reference": "486b32fd98efe9a3c10f0b24c0caabc187f78f04",
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/31f7d2e7943a82e72a670335d408d967b05efa5a",
"reference": "31f7d2e7943a82e72a670335d408d967b05efa5a",
"shasum": ""
},
"require": {
@@ -11306,7 +11306,7 @@
],
"support": {
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
"source": "https://github.com/php-debugbar/php-debugbar/tree/v3.5.1"
"source": "https://github.com/php-debugbar/php-debugbar/tree/v3.6.0"
},
"funding": [
{
@@ -11318,7 +11318,7 @@
"type": "github"
}
],
"time": "2026-03-05T20:37:33+00:00"
"time": "2026-03-29T17:26:18+00:00"
},
{
"name": "php-debugbar/symfony-bridge",

View File

@@ -78,8 +78,8 @@ return [
'running_balance_column' => (bool)envDefaultWhenEmpty(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-03-29',
'build_time' => 1774795378,
'version' => 'develop/2026-03-30',
'build_time' => 1774843425,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.

6
package-lock.json generated
View File

@@ -4134,9 +4134,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001781",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001781.tgz",
"integrity": "sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw==",
"version": "1.0.30001782",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001782.tgz",
"integrity": "sha512-dZcaJLJeDMh4rELYFw1tvSn1bhZWYFOt468FcbHHxx/Z/dFidd1I6ciyFdi3iwfQCyOjqo9upF6lGQYtMiJWxw==",
"dev": true,
"funding": [
{

View File

@@ -189,6 +189,6 @@
},
"config": {
"html_language": "ru",
"date_time_fns": "d MMMM yyyy @ HH:mm:ss"
"date_time_fns": "d MMMM yyyy, HH:mm:ss"
}
}

View File

@@ -282,7 +282,8 @@
{% if transaction.source_account_id == account.id %}
<span title="Deposit, source">{{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }}</span>
{% else %}
<span title="Deposit, dest">{{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }}</span>
{# changed from normal currency_symbol to foreign_currency_symbol for #12043 #}
<span title="Deposit, dest">{{ formatAmountBySymbol(transaction.destination_balance_after, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }}</span>
{% endif %}
{% elseif transaction.transaction_type_type == 'Withdrawal' %}