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
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.'); Log::debug('Both accounts have the same currency, continue.');
return; 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)) { if (TransactionType::DEPOSIT === ucfirst($transactionType)) {
Log::debug(sprintf('Processing as a "%s"', $transactionType));
// use case: deposit from liability account to an asset account // use case: deposit from liability account to an asset account
// the foreign amount must be in the currency of the source // the foreign amount must be in the currency of the source
// the amount must be in the currency of the destination // the amount must be in the currency of the destination
@@ -214,12 +219,15 @@ trait TransactionValidation
// wrong currency information is present // wrong currency information is present
$foreignCurrencyCode = $transaction['foreign_currency_code'] ?? false; $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')); $validator->errors()->add(sprintf('transactions.%d.foreign_currency_code', $index), (string)trans('validation.require_foreign_src'));
return; return;
} }
} }
if (TransactionType::TRANSFER === ucfirst($transactionType) || TransactionType::WITHDRAWAL === ucfirst($transactionType)) { 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. // use case: withdrawal from asset account to a liability account.
// the foreign amount must be in the currency of the destination // the foreign amount must be in the currency of the destination
// the amount must be in the currency of the source // the amount must be in the currency of the source
@@ -236,8 +244,12 @@ trait TransactionValidation
// wrong currency information is present // wrong currency information is present
$foreignCurrencyCode = $transaction['foreign_currency_code'] ?? false; $foreignCurrencyCode = $transaction['foreign_currency_code'] ?? false;
if ($foreignCurrencyCode !== $destinationCurrency->code) { $foreignCurrencyId = (int)($transaction['foreign_currency_id'] ?? 0);
$validator->errors()->add(sprintf('transactions.%d.foreign_currency_code', $index), (string)trans('validation.require_foreign_dest')); 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. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). 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 ## v6.0.3 - 2023-03-13
### Fixed ### Fixed

29
composer.lock generated
View File

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

View File

@@ -107,7 +107,7 @@ return [
'webhooks' => true, 'webhooks' => true,
'handle_debts' => true, 'handle_debts' => true,
], ],
'version' => '6.0.3', 'version' => '6.0.4',
'api_version' => '2.0.1', 'api_version' => '2.0.1',
'db_version' => 19, 'db_version' => 19,
@@ -161,7 +161,7 @@ return [
'en_GB' => ['name_locale' => 'English (GB)', 'name_english' => 'English (GB)'], 'en_GB' => ['name_locale' => 'English (GB)', 'name_english' => 'English (GB)'],
'en_US' => ['name_locale' => 'English (US)', 'name_english' => 'English (US)'], 'en_US' => ['name_locale' => 'English (US)', 'name_english' => 'English (US)'],
'es_ES' => ['name_locale' => 'Español', 'name_english' => 'Spanish'], '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'], // 'et_EE' => ['name_locale' => 'Estonian', 'name_english' => 'Estonian'],
// 'fa_IR' => ['name_locale' => 'فارسی', 'name_english' => 'Persian'], // 'fa_IR' => ['name_locale' => 'فارسی', 'name_english' => 'Persian'],
'fi_FI' => ['name_locale' => 'Suomi', 'name_english' => 'Finnish'], '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-footer class="bg-grey-8 text-white" bordered>
<q-toolbar> <q-toolbar>
<div> <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> </div>
</q-toolbar> </q-toolbar>
</q-footer> </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_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_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_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_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_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_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_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"', '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.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.sources=app,bootstrap,database,resources/assets,resources/views,routes,tests
sonar.sourceEncoding=UTF-8 sonar.sourceEncoding=UTF-8