Merge pull request #10397 from firefly-iii/release-1748670980

🤖 Automatically merge the PR into the develop branch.
This commit is contained in:
github-actions[bot]
2025-05-31 07:56:29 +02:00
committed by GitHub
14 changed files with 202 additions and 197 deletions

View File

@@ -98,7 +98,8 @@ class UpdateController extends Controller
// filter on transaction group.
->setTransactionGroup($transactionGroup)
// all info needed for the API:
->withAPIInformation();
->withAPIInformation()
;
$selectedGroup = $collector->getGroups()->first();
if (null === $selectedGroup) {

View File

@@ -64,7 +64,7 @@ class CorrectsIbans extends Command
}
// same for account number:
$accountNumber = $account->accountMeta->where('name', 'account_number')->first();
if(null !== $accountNumber) {
if (null !== $accountNumber) {
$number = (string) $accountNumber->value;
$newNumber = app('steam')->filterSpaces($number);
if ('' !== $number && $number !== $newNumber) {

View File

@@ -42,9 +42,9 @@ class AccountMetaFactory
$entry = $account->accountMeta()->where('name', $field)->first();
// must not be an empty string:
if ('' !== $value) {
if('account_number' === $field) {
if ('account_number' === $field) {
$value = Steam::filterSpaces($value);
$value = trim(str_replace([' ',"\t", "\n", "\r"], '', $value));
$value = trim(str_replace([' ', "\t", "\n", "\r"], '', $value));
}
// if $data has field and $entry is null, create new one:
if (null === $entry) {

View File

@@ -72,7 +72,8 @@ class UpdatedGroupEventHandler
->orderBy('transaction_journals.order', 'ASC')
->orderBy('transaction_journals.id', 'DESC')
->orderBy('transaction_journals.description', 'DESC')
->first();
->first()
;
if (null === $first) {
Log::warning(sprintf('Group #%d has no transaction journals.', $group->id));
@@ -92,12 +93,14 @@ class UpdatedGroupEventHandler
if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::WITHDRAWAL->value === $type) {
// set all source transactions to source account:
Transaction::whereIn('transaction_journal_id', $all)
->where('amount', '<', 0)->update(['account_id' => $sourceAccount->id]);
->where('amount', '<', 0)->update(['account_id' => $sourceAccount->id])
;
}
if (TransactionTypeEnum::TRANSFER->value === $type || TransactionTypeEnum::DEPOSIT->value === $type) {
// set all destination transactions to destination account:
Transaction::whereIn('transaction_journal_id', $all)
->where('amount', '>', 0)->update(['account_id' => $destAccount->id]);
->where('amount', '>', 0)->update(['account_id' => $destAccount->id])
;
}
}

View File

@@ -86,7 +86,7 @@ class GroupCollector implements GroupCollectorInterface
$this->hasJoinedAttTables = false;
$this->expandGroupSearch = false;
$this->hasJoinedMetaTables = false;
$this->booleanFields = ['source_balance_dirty','destination_balance_dirty'];
$this->booleanFields = ['source_balance_dirty', 'destination_balance_dirty'];
$this->integerFields = [
'transaction_group_id',
'user_id',

View File

@@ -436,15 +436,17 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface,
public function getTotalAmount(TransactionGroup $group): string
{
$sum = '0';
/** @var TransactionJournal $journal */
foreach($group->transactionJournals as $journal) {
foreach ($group->transactionJournals as $journal) {
/** @var Transaction $transaction */
foreach($journal->transactions as $transaction) {
if(-1 === bccomp('0', (string) $transaction->amount)) {
foreach ($journal->transactions as $transaction) {
if (-1 === bccomp('0', (string) $transaction->amount)) {
$sum = bcadd($sum, $transaction->amount);
}
}
}
return $sum;
}
}

View File

@@ -104,7 +104,7 @@ class JournalUpdateService
'external_url',
];
$this->metaDate = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date',
'invoice_date',];
'invoice_date', ];
}
public function setData(array $data): void
@@ -822,5 +822,4 @@ class JournalUpdateService
{
return $this->amountChanged;
}
}

View File

@@ -170,9 +170,9 @@ class TransactionGroupTransformer extends AbstractTransformer
'destination_balance_dirty' => $transaction['destination_balance_dirty'],
// balance before and after, if not dirty.
//'running_balance_dirty' => $transaction['balance_dirty'] ?? false,
//'running_balance_before' => $transaction['balance_before'] ?? null,
//'running_balance_after' => $transaction['balance_after'] ?? null,
// 'running_balance_dirty' => $transaction['balance_dirty'] ?? false,
// 'running_balance_before' => $transaction['balance_before'] ?? null,
// 'running_balance_after' => $transaction['balance_after'] ?? null,

14
composer.lock generated
View File

@@ -11670,21 +11670,21 @@
},
{
"name": "rector/rector",
"version": "2.0.16",
"version": "2.0.17",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2"
"reference": "caa4ffda1d48bde44434e6ba95d132ec32e7fd40"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2",
"reference": "f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/caa4ffda1d48bde44434e6ba95d132ec32e7fd40",
"reference": "caa4ffda1d48bde44434e6ba95d132ec32e7fd40",
"shasum": ""
},
"require": {
"php": "^7.4|^8.0",
"phpstan/phpstan": "^2.1.14"
"phpstan/phpstan": "^2.1.17"
},
"conflict": {
"rector/rector-doctrine": "*",
@@ -11717,7 +11717,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.0.16"
"source": "https://github.com/rectorphp/rector/tree/2.0.17"
},
"funding": [
{
@@ -11725,7 +11725,7 @@
"type": "github"
}
],
"time": "2025-05-12T16:37:16+00:00"
"time": "2025-05-30T10:59:08+00:00"
},
{
"name": "sebastian/cli-parser",

View File

@@ -78,7 +78,7 @@ return [
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2025-05-29',
'version' => 'develop/2025-05-31',
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 25,

62
package-lock.json generated
View File

@@ -53,9 +53,9 @@
}
},
"node_modules/@babel/core": {
"version": "7.27.3",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.3.tgz",
"integrity": "sha512-hyrN8ivxfvJ4i0fIJuV4EOlV0WDMz5Ui4StRTgVaAvWeiRCilXgwVvxJKtFQ3TKtHgJscB2YiXKGNJuVwhQMtA==",
"version": "7.27.4",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz",
"integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -64,10 +64,10 @@
"@babel/generator": "^7.27.3",
"@babel/helper-compilation-targets": "^7.27.2",
"@babel/helper-module-transforms": "^7.27.3",
"@babel/helpers": "^7.27.3",
"@babel/parser": "^7.27.3",
"@babel/helpers": "^7.27.4",
"@babel/parser": "^7.27.4",
"@babel/template": "^7.27.2",
"@babel/traverse": "^7.27.3",
"@babel/traverse": "^7.27.4",
"@babel/types": "^7.27.3",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
@@ -392,9 +392,9 @@
}
},
"node_modules/@babel/helpers": {
"version": "7.27.3",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.3.tgz",
"integrity": "sha512-h/eKy9agOya1IGuLaZ9tEUgz+uIRXcbtOhRtUyyMf8JFmn1iT13vnl/IGVWSkdOCG/pC57U4S1jnAabAavTMwg==",
"version": "7.27.4",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.4.tgz",
"integrity": "sha512-Y+bO6U+I7ZKaM5G5rDUZiYfUvQPUibYmAFe7EnKdnKBbVXDZxvp+MWOH5gYciY0EPk4EScsuFMQBbEfpdRKSCQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -406,9 +406,9 @@
}
},
"node_modules/@babel/parser": {
"version": "7.27.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.3.tgz",
"integrity": "sha512-xyYxRj6+tLNDTWi0KCBcZ9V7yg3/lwL9DWh9Uwh/RIVlIfFidggcgxKX3GCXwCiswwcGRawBKbEg2LG/Y8eJhw==",
"version": "7.27.4",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.4.tgz",
"integrity": "sha512-BRmLHGwpUqLFR2jzx9orBuX/ABDkj2jLKOXrHDTN2aOKL+jFDDKaRNo9nyYsIl9h/UE/7lMKdDjKQQyxKKDZ7g==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1255,9 +1255,9 @@
}
},
"node_modules/@babel/plugin-transform-regenerator": {
"version": "7.27.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.27.1.tgz",
"integrity": "sha512-B19lbbL7PMrKr52BNPjCqg1IyNUIjTcxKj8uX9zHO+PmWN93s19NDr/f69mIkEp2x9nmDJ08a7lgHaTTzvW7mw==",
"version": "7.27.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.27.4.tgz",
"integrity": "sha512-Glp/0n8xuj+E1588otw5rjJkTXfzW7FjH3IIUrfqiZOPQCd2vbg8e+DQE8jK9g4V5/zrxFW+D9WM9gboRPELpQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1304,9 +1304,9 @@
}
},
"node_modules/@babel/plugin-transform-runtime": {
"version": "7.27.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.27.3.tgz",
"integrity": "sha512-bA9ZL5PW90YwNgGfjg6U+7Qh/k3zCEQJ06BFgAGRp/yMjw9hP9UGbGPtx3KSOkHGljEPCCxaE+PH4fUR2h1sDw==",
"version": "7.27.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.27.4.tgz",
"integrity": "sha512-D68nR5zxU64EUzV8i7T3R5XP0Xhrou/amNnddsRQssx6GrTLdZl1rLxyjtVZBd+v/NVX4AbTPOB5aU8thAZV1A==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1592,9 +1592,9 @@
}
},
"node_modules/@babel/runtime": {
"version": "7.27.3",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.3.tgz",
"integrity": "sha512-7EYtGezsdiDMyY80+65EzwiGmcJqpmcZCojSXaRgdrBaGtWTgDZKq69cPIVped6MkIM78cTQ2GOiEYjwOlG4xw==",
"version": "7.27.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.4.tgz",
"integrity": "sha512-t3yaEOuGu9NlIZ+hIeGbBjFtZT7j2cb2tg0fuaJKeGotchRjjLfrBA9Kwf8quhpP1EUuxModQg04q/mBwyg8uA==",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -1616,15 +1616,15 @@
}
},
"node_modules/@babel/traverse": {
"version": "7.27.3",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.3.tgz",
"integrity": "sha512-lId/IfN/Ye1CIu8xG7oKBHXd2iNb2aW1ilPszzGcJug6M8RCKfVNcYhpI5+bMvFYjK7lXIM0R+a+6r8xhHp2FQ==",
"version": "7.27.4",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz",
"integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.27.3",
"@babel/parser": "^7.27.3",
"@babel/parser": "^7.27.4",
"@babel/template": "^7.27.2",
"@babel/types": "^7.27.3",
"debug": "^4.3.1",
@@ -3108,9 +3108,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "22.15.24",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.24.tgz",
"integrity": "sha512-w9CZGm9RDjzTh/D+hFwlBJ3ziUaVw7oufKA3vOFSOZlzmW9AkZnfjPb+DLnrV6qtgL/LNmP0/2zBNCFHL3F0ng==",
"version": "22.15.29",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.29.tgz",
"integrity": "sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -10064,9 +10064,9 @@
"license": "MIT"
},
"node_modules/sass": {
"version": "1.89.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.89.0.tgz",
"integrity": "sha512-ld+kQU8YTdGNjOLfRWBzewJpU5cwEv/h5yyqlSeJcj6Yh8U4TDA9UA5FPicqDz/xgRPWRSYIQNiFks21TbA9KQ==",
"version": "1.89.1",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.89.1.tgz",
"integrity": "sha512-eMLLkl+qz7tx/0cJ9wI+w09GQ2zodTkcE/aVfywwdlRcI3EO19xGnbmJwg/JMIm+5MxVJ6outddLZ4Von4E++Q==",
"dev": true,
"license": "MIT",
"dependencies": {