From aa8588758af8990be3b9dfb30b3efde0caa8a2e0 Mon Sep 17 00:00:00 2001 From: Marc Ordinas i Llopis Date: Sun, 12 Mar 2023 13:48:06 +0100 Subject: [PATCH 1/5] Update Catalan description Signed-off-by: Marc Ordinas i Llopis --- config/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/firefly.php b/config/firefly.php index b8916327fb..a6875b7b28 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -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'], From e36675e232f748faf9282b68d7d29dbdb080fdfe Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 12 Mar 2023 16:06:12 +0100 Subject: [PATCH 2/5] Possible fix for #7214 --- app/Validation/TransactionValidation.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php index 63c98c4eec..7ae5238b00 100644 --- a/app/Validation/TransactionValidation.php +++ b/app/Validation/TransactionValidation.php @@ -200,8 +200,11 @@ 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)); 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 +217,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 !== $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 +242,10 @@ 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 !== $destinationCurrency->id) { + $validator->errors()->add(sprintf('transactions.%d.foreign_amount', $index), (string)trans('validation.require_foreign_dest')); } } } From b7dd335fb729ae4d0de0d404af80f7c8a6f33232 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 12 Mar 2023 18:18:02 +0100 Subject: [PATCH 3/5] Meta files for release v6.0.4 --- app/Validation/TransactionValidation.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php index 7ae5238b00..71adc328ef 100644 --- a/app/Validation/TransactionValidation.php +++ b/app/Validation/TransactionValidation.php @@ -203,6 +203,8 @@ trait TransactionValidation 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 @@ -219,7 +221,7 @@ trait TransactionValidation $foreignCurrencyCode = $transaction['foreign_currency_code'] ?? false; $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 !== $sourceCurrency->id) { + 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; } @@ -244,7 +246,9 @@ trait TransactionValidation $foreignCurrencyCode = $transaction['foreign_currency_code'] ?? false; $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 !== $destinationCurrency->id) { + 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')); } } From cead122d965f04fcc7831d9945e87bce52b06ca9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 12 Mar 2023 18:22:56 +0100 Subject: [PATCH 4/5] Meta files for new release --- changelog.md | 5 +++++ config/firefly.php | 2 +- frontend/src/layouts/MainLayout.vue | 2 +- resources/lang/es_ES/firefly.php | 4 ++-- sonar-project.properties | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index 3d28178a8c..65b2fda6c8 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/config/firefly.php b/config/firefly.php index a6875b7b28..78393a60db 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -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, diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index 22aa66f5f4..cafd893fba 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -338,7 +338,7 @@ page container: q-ma-xs (margin all, xs) AND q-mb-md to give the page content so
- Firefly III v v6.0.3 © James Cole, AGPL-3.0-or-later. + Firefly III v v6.0.4 © James Cole, AGPL-3.0-or-later.
diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index 3d41aa52bd..4b85518e97 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -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"', diff --git a/sonar-project.properties b/sonar-project.properties index e302c3b7db..1f9e17e1d3 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -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 From 8d24db14e97334f93ad43b5e742a35d14b61f328 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 12 Mar 2023 18:23:18 +0100 Subject: [PATCH 5/5] Update packages. --- composer.lock | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 799aa7f4a5..c5fe215cba 100644 --- a/composer.lock +++ b/composer.lock @@ -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",