Compare commits

..

11 Commits

Author SHA1 Message Date
github-actions
06551d5367 Auto commit for release 'develop' on 2024-05-25 2024-05-25 20:18:23 +02:00
James Cole
a20622ac0c Fix https://github.com/firefly-iii/firefly-iii/issues/8911 2024-05-25 11:28:32 +02:00
James Cole
ca38117fca Fix https://github.com/firefly-iii/firefly-iii/issues/8907 2024-05-25 08:10:23 +02:00
James Cole
9478f78d4f Merge branch 'main' into develop 2024-05-25 08:05:45 +02:00
James Cole
5c2397bbae Remove unused workflows. 2024-05-25 08:05:32 +02:00
James Cole
92fefef816 Merge branch 'main' into develop 2024-05-24 05:30:29 +02:00
James Cole
d3ced65524 Remove 2024-05-24 05:30:17 +02:00
James Cole
29eb748831 Merge branch 'main' into develop 2024-05-24 05:22:57 +02:00
James Cole
252076ec1f Add to cleanup 2024-05-22 06:12:19 +02:00
James Cole
bbec28591f Add workflow that responds to PRs 2024-05-22 06:02:49 +02:00
James Cole
075a360ba6 Add new workflow for issue thing. 2024-05-21 20:20:06 +02:00
10 changed files with 594 additions and 558 deletions

View File

@@ -950,16 +950,16 @@
},
{
"name": "react/promise",
"version": "v3.1.0",
"version": "v3.2.0",
"source": {
"type": "git",
"url": "https://github.com/reactphp/promise.git",
"reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c"
"reference": "8a164643313c71354582dc850b42b33fa12a4b63"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reactphp/promise/zipball/e563d55d1641de1dea9f5e84f3cccc66d2bfe02c",
"reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c",
"url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63",
"reference": "8a164643313c71354582dc850b42b33fa12a4b63",
"shasum": ""
},
"require": {
@@ -1011,7 +1011,7 @@
],
"support": {
"issues": "https://github.com/reactphp/promise/issues",
"source": "https://github.com/reactphp/promise/tree/v3.1.0"
"source": "https://github.com/reactphp/promise/tree/v3.2.0"
},
"funding": [
{
@@ -1019,7 +1019,7 @@
"type": "open_collective"
}
],
"time": "2023-11-16T16:21:57+00:00"
"time": "2024-05-24T10:39:05+00:00"
},
{
"name": "react/socket",

View File

@@ -1,32 +0,0 @@
<?php
declare(strict_types=1);
namespace FireflyIII\Console\Commands\Correction;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Support\Models\AccountBalanceCalculator;
use Illuminate\Console\Command;
/**
* Class CorrectionSkeleton
*/
class CorrectAccountBalance extends Command
{
use ShowsFriendlyMessages;
protected $description = 'Recalculate all account balance amounts';
protected $signature = 'firefly-iii:correct-account-balance';
public function handle(): int
{
$this->correctBalanceAmounts();
return 0;
}
private function correctBalanceAmounts(): void
{
AccountBalanceCalculator::recalculateAll();
}
}

View File

@@ -74,7 +74,6 @@ class CorrectDatabase extends Command
'firefly-iii:unify-group-accounts',
'firefly-iii:trigger-credit-recalculation',
'firefly-iii:migrate-preferences',
'firefly-iii:correct-account-balance',
];
foreach ($commands as $command) {
$this->friendlyLine(sprintf('Now executing command "%s"', $command));

View File

@@ -0,0 +1,70 @@
<?php
/*
* CorrectAccountBalance.php
* Copyright (c) 2024 james@firefly-iii.org.
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Support\Models\AccountBalanceCalculator;
use Illuminate\Console\Command;
/**
* Class CorrectionSkeleton
*/
class CorrectAccountBalance extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '620_correct_balances';
protected $description = 'Recalculate all account balance amounts';
protected $signature = 'firefly-iii:correct-account-balance {--F|force : Force the execution of this command.}';
public function handle(): int
{
if ($this->isExecuted() && true !== $this->option('force')) {
$this->friendlyInfo('This command has already been executed.');
return 0;
}
$this->correctBalanceAmounts();
$this->markAsExecuted();
return 0;
}
private function correctBalanceAmounts(): void
{
AccountBalanceCalculator::recalculateAll();
}
private function isExecuted(): bool
{
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
return (bool)$configVar?->data;
}
private function markAsExecuted(): void
{
app('fireflyconfig')->set(self::CONFIG_NAME, true);
}
}

View File

@@ -65,6 +65,7 @@ class UpgradeDatabase extends Command
'firefly-iii:budget-limit-periods',
'firefly-iii:migrate-rule-actions',
'firefly-iii:restore-oauth-keys',
'firefly-iii:correct-account-balance',
// also just in case, some integrity commands:
'firefly-iii:create-group-memberships',
'firefly-iii:upgrade-group-information',

View File

@@ -93,7 +93,6 @@ class DebugController extends Controller
Artisan::call('view:clear');
// also do some recalculations.
Artisan::call('firefly-iii:correct-account-balance');
Artisan::call('firefly-iii:trigger-credit-recalculation');
try {

View File

@@ -120,13 +120,13 @@ class AccountBalanceCalculator
// first create for normal currency:
$entry = $this->getAccountBalanceByAccount($account, $transactionCurrency);
$entry->balance = bcadd($entry->balance, $sumAmount);
$entry->balance = bcadd((string) $entry->balance, $sumAmount);
$entry->save();
// then do foreign amount, if present:
if ($foreignCurrency > 0) {
$entry = $this->getAccountBalanceByAccount($account, $foreignCurrency);
$entry->balance = bcadd($entry->balance, $sumForeignAmount);
$entry->balance = bcadd((string) $entry->balance, $sumForeignAmount);
$entry->save();
}
}

51
composer.lock generated
View File

@@ -3202,40 +3202,39 @@
},
{
"name": "league/csv",
"version": "9.15.0",
"version": "9.16.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/csv.git",
"reference": "fa7e2441c0bc9b2360f4314fd6c954f7ff40d435"
"reference": "998280c6c34bd67d8125fdc8b45bae28d761b440"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/csv/zipball/fa7e2441c0bc9b2360f4314fd6c954f7ff40d435",
"reference": "fa7e2441c0bc9b2360f4314fd6c954f7ff40d435",
"url": "https://api.github.com/repos/thephpleague/csv/zipball/998280c6c34bd67d8125fdc8b45bae28d761b440",
"reference": "998280c6c34bd67d8125fdc8b45bae28d761b440",
"shasum": ""
},
"require": {
"ext-filter": "*",
"ext-json": "*",
"ext-mbstring": "*",
"php": "^8.1.2"
},
"require-dev": {
"doctrine/collections": "^2.1.4",
"doctrine/collections": "^2.2.2",
"ext-dom": "*",
"ext-xdebug": "*",
"friendsofphp/php-cs-fixer": "^v3.22.0",
"friendsofphp/php-cs-fixer": "^3.57.1",
"phpbench/phpbench": "^1.2.15",
"phpstan/phpstan": "^1.10.57",
"phpstan/phpstan-deprecation-rules": "^1.1.4",
"phpstan/phpstan-phpunit": "^1.3.15",
"phpstan/phpstan-strict-rules": "^1.5.2",
"phpunit/phpunit": "^10.5.9",
"symfony/var-dumper": "^6.4.2"
"phpstan/phpstan": "^1.11.1",
"phpstan/phpstan-deprecation-rules": "^1.2.0",
"phpstan/phpstan-phpunit": "^1.4.0",
"phpstan/phpstan-strict-rules": "^1.6.0",
"phpunit/phpunit": "^10.5.16 || ^11.1.3",
"symfony/var-dumper": "^6.4.6 || ^7.0.7"
},
"suggest": {
"ext-dom": "Required to use the XMLConverter and the HTMLConverter classes",
"ext-iconv": "Needed to ease transcoding CSV using iconv stream filters"
"ext-iconv": "Needed to ease transcoding CSV using iconv stream filters",
"ext-mbstring": "Needed to ease transcoding CSV using mb stream filters"
},
"type": "library",
"extra": {
@@ -3287,7 +3286,7 @@
"type": "github"
}
],
"time": "2024-02-20T20:00:00+00:00"
"time": "2024-05-24T11:04:54+00:00"
},
{
"name": "league/event",
@@ -3966,16 +3965,16 @@
},
{
"name": "nesbot/carbon",
"version": "3.3.1",
"version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a"
"reference": "8eab8983c83c30e0bacbef8d311e3f3b8172727f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a",
"reference": "8ff64b92c1b1ec84fcde9f8bb9ff2ca34cb8a77a",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8eab8983c83c30e0bacbef8d311e3f3b8172727f",
"reference": "8eab8983c83c30e0bacbef8d311e3f3b8172727f",
"shasum": ""
},
"require": {
@@ -4068,7 +4067,7 @@
"type": "tidelift"
}
],
"time": "2024-05-01T06:54:22+00:00"
"time": "2024-05-24T14:26:34+00:00"
},
{
"name": "nette/schema",
@@ -11014,16 +11013,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.11.1",
"version": "1.11.2",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b"
"reference": "0d5d4294a70deb7547db655c47685d680e39cfec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e524358f930e41a2b4cca1320e3b04fc26b39e0b",
"reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec",
"reference": "0d5d4294a70deb7547db655c47685d680e39cfec",
"shasum": ""
},
"require": {
@@ -11068,7 +11067,7 @@
"type": "github"
}
],
"time": "2024-05-15T08:00:59+00:00"
"time": "2024-05-24T13:23:04+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",

View File

@@ -117,7 +117,7 @@ return [
'expression_engine' => false,
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2024-05-23',
'version' => 'develop/2024-05-25',
'api_version' => '2.1.0',
'db_version' => 24,

978
package-lock.json generated

File diff suppressed because it is too large Load Diff