Merge pull request #7218 from firefly-iii/develop

Release v6.0.4
This commit is contained in:
James Cole 2023-03-12 18:25:25 +01:00 committed by GitHub
commit f56de6e719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 22 deletions

View File

@ -200,8 +200,13 @@ trait TransactionValidation
Log::debug('Both accounts have the same currency, continue.');
return;
}
Log::debug(sprintf('Source account expects %s', $sourceCurrency->code));
Log::debug(sprintf('Destination account expects %s', $destinationCurrency->code));
Log::debug(sprintf('Amount is %s', $transaction['amount']));
if (TransactionType::DEPOSIT === ucfirst($transactionType)) {
Log::debug(sprintf('Processing as a "%s"', $transactionType));
// use case: deposit from liability account to an asset account
// the foreign amount must be in the currency of the source
// the amount must be in the currency of the destination
@ -214,12 +219,15 @@ trait TransactionValidation
// wrong currency information is present
$foreignCurrencyCode = $transaction['foreign_currency_code'] ?? false;
if ($foreignCurrencyCode !== $sourceCurrency->code) {
$foreignCurrencyId = (int)($transaction['foreign_currency_id'] ?? 0);
Log::debug(sprintf('Foreign currency code seems to be #%d "%s"', $foreignCurrencyId, $foreignCurrencyCode), $transaction);
if ($foreignCurrencyCode !== $sourceCurrency->code && $foreignCurrencyId !== (int)$sourceCurrency->id) {
$validator->errors()->add(sprintf('transactions.%d.foreign_currency_code', $index), (string)trans('validation.require_foreign_src'));
return;
}
}
if (TransactionType::TRANSFER === ucfirst($transactionType) || TransactionType::WITHDRAWAL === ucfirst($transactionType)) {
Log::debug(sprintf('Processing as a "%s"', $transactionType));
// use case: withdrawal from asset account to a liability account.
// the foreign amount must be in the currency of the destination
// the amount must be in the currency of the source
@ -236,8 +244,12 @@ trait TransactionValidation
// wrong currency information is present
$foreignCurrencyCode = $transaction['foreign_currency_code'] ?? false;
if ($foreignCurrencyCode !== $destinationCurrency->code) {
$validator->errors()->add(sprintf('transactions.%d.foreign_currency_code', $index), (string)trans('validation.require_foreign_dest'));
$foreignCurrencyId = (int)($transaction['foreign_currency_id'] ?? 0);
Log::debug(sprintf('Foreign currency code seems to be #%d "%s"', $foreignCurrencyId, $foreignCurrencyCode), $transaction);
if ($foreignCurrencyCode !== $destinationCurrency->code && $foreignCurrencyId !== (int)$destinationCurrency->id) {
Log::debug(sprintf('No match on code, "%s" vs "%s"', $foreignCurrencyCode, $destinationCurrency->code));
Log::debug(sprintf('No match on ID, #%d vs #%d', $foreignCurrencyId, $destinationCurrency->id));
$validator->errors()->add(sprintf('transactions.%d.foreign_amount', $index), (string)trans('validation.require_foreign_dest'));
}
}
}

View File

@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## v6.0.4 - 2023-03-13
### Fixed
- [Issue 7214](https://github.com/firefly-iii/firefly-iii/issues/7214) Import issue blocking multi currency transactions
## v6.0.3 - 2023-03-13
### Fixed

29
composer.lock generated
View File

@ -2868,34 +2868,37 @@
},
{
"name": "league/csv",
"version": "9.8.0",
"version": "9.9.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/csv.git",
"reference": "9d2e0265c5d90f5dd601bc65ff717e05cec19b47"
"reference": "b4418ede47fbd88facc34e40a16c8ce9153b961b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/csv/zipball/9d2e0265c5d90f5dd601bc65ff717e05cec19b47",
"reference": "9d2e0265c5d90f5dd601bc65ff717e05cec19b47",
"url": "https://api.github.com/repos/thephpleague/csv/zipball/b4418ede47fbd88facc34e40a16c8ce9153b961b",
"reference": "b4418ede47fbd88facc34e40a16c8ce9153b961b",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
"php": "^7.4 || ^8.0"
"php": "^8.1.2"
},
"require-dev": {
"ext-curl": "*",
"doctrine/collections": "^2.1.2",
"ext-dom": "*",
"friendsofphp/php-cs-fixer": "^v3.4.0",
"phpstan/phpstan": "^1.3.0",
"phpstan/phpstan-phpunit": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.1.0",
"phpunit/phpunit": "^9.5.11"
"ext-xdebug": "*",
"friendsofphp/php-cs-fixer": "^v3.14.3",
"phpbench/phpbench": "^1.2.8",
"phpstan/phpstan": "^1.10.4",
"phpstan/phpstan-deprecation-rules": "^1.1.2",
"phpstan/phpstan-phpunit": "^1.3.10",
"phpstan/phpstan-strict-rules": "^1.5.0",
"phpunit/phpunit": "^10.0.14"
},
"suggest": {
"ext-dom": "Required to use the XMLConverter and or the HTMLConverter classes",
"ext-dom": "Required to use the XMLConverter and the HTMLConverter classes",
"ext-iconv": "Needed to ease transcoding CSV using iconv stream filters"
},
"type": "library",
@ -2948,7 +2951,7 @@
"type": "github"
}
],
"time": "2022-01-04T00:13:07+00:00"
"time": "2023-03-11T15:57:12+00:00"
},
{
"name": "league/event",

View File

@ -107,7 +107,7 @@ return [
'webhooks' => true,
'handle_debts' => true,
],
'version' => '6.0.3',
'version' => '6.0.4',
'api_version' => '2.0.1',
'db_version' => 19,
@ -161,7 +161,7 @@ return [
'en_GB' => ['name_locale' => 'English (GB)', 'name_english' => 'English (GB)'],
'en_US' => ['name_locale' => 'English (US)', 'name_english' => 'English (US)'],
'es_ES' => ['name_locale' => 'Español', 'name_english' => 'Spanish'],
'ca_ES' => ['name_locale' => 'Español (català)', 'name_english' => 'Spanish (Catalan)'],
'ca_ES' => ['name_locale' => 'Català (Espanya)', 'name_english' => 'Catalan (Spain)'],
// 'et_EE' => ['name_locale' => 'Estonian', 'name_english' => 'Estonian'],
// 'fa_IR' => ['name_locale' => 'فارسی', 'name_english' => 'Persian'],
'fi_FI' => ['name_locale' => 'Suomi', 'name_english' => 'Finnish'],

View File

@ -338,7 +338,7 @@ page container: q-ma-xs (margin all, xs) AND q-mb-md to give the page content so
<q-footer class="bg-grey-8 text-white" bordered>
<q-toolbar>
<div>
<small>Firefly III v v6.0.3 &copy; James Cole, AGPL-3.0-or-later.</small>
<small>Firefly III v v6.0.4 &copy; James Cole, AGPL-3.0-or-later.</small>
</div>
</q-toolbar>
</q-footer>

View File

@ -648,10 +648,10 @@ return [
'search_modifier_updated_at_after_day' => 'La transacción se actualizó por última vez en o después día del mes ":value"',
'search_modifier_created_at_on_year' => 'La transacción fue creada en el año":value"',
'search_modifier_created_at_on_month' => 'La transacción fue creada en el mes ":value"',
'search_modifier_created_at_on_day' => 'Transaction was created on day of month ":value"',
'search_modifier_created_at_on_day' => 'La transacción fue creada en el día del mes ":value"',
'search_modifier_not_created_at_on_year' => 'La transacción no fue creada en el año ":value"',
'search_modifier_not_created_at_on_month' => 'La transacción no fue creada en el mes ":value"',
'search_modifier_not_created_at_on_day' => 'Transaction was not created on day of month ":value"',
'search_modifier_not_created_at_on_day' => 'La transacción no fue creada en el día del mes ":value"',
'search_modifier_created_at_before_year' => 'Transaction was created in or before year ":value"',
'search_modifier_created_at_before_month' => 'Transaction was created in or before month ":value"',
'search_modifier_created_at_before_day' => 'Transaction was created on or before day of month ":value"',

View File

@ -12,6 +12,6 @@ sonar.organization=firefly-iii
#sonar.sourceEncoding=UTF-8
sonar.projectVersion=6.0.3
sonar.projectVersion=6.0.4
sonar.sources=app,bootstrap,database,resources/assets,resources/views,routes,tests
sonar.sourceEncoding=UTF-8