mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[FIX] account_bank_statement_import_online_transferwise: fix fees with top-up
This commit is contained in:
committed by
Emanuel Cino
parent
ff068d25bb
commit
f079a33312
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
'name': 'Online Bank Statements: TransferWise.com',
|
||||
'version': '12.0.1.0.0',
|
||||
'version': '12.0.1.0.1',
|
||||
'author':
|
||||
'CorporateHub, '
|
||||
'Odoo Community Association (OCA)',
|
||||
|
||||
@@ -24,19 +24,19 @@ msgid "API key"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_statement_import_online_transferwise
|
||||
#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:125
|
||||
#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:126
|
||||
#, python-format
|
||||
msgid "Ending balance unavailable"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_statement_import_online_transferwise
|
||||
#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:240
|
||||
#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:239
|
||||
#, python-format
|
||||
msgid "Fee for %s"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_statement_import_online_transferwise
|
||||
#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:271
|
||||
#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:270
|
||||
#, python-format
|
||||
msgid "No API key specified!"
|
||||
msgstr ""
|
||||
@@ -52,7 +52,7 @@ msgid "Profile"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_statement_import_online_transferwise
|
||||
#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:245
|
||||
#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:244
|
||||
#, python-format
|
||||
msgid "Transaction fee for %s"
|
||||
msgstr ""
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
|
||||
# Copyright 2020 CorporateHub (https://corporatehub.eu)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
@@ -169,9 +170,7 @@ class OnlineBankStatementProviderTransferwise(models.Model):
|
||||
)
|
||||
amount = transaction['amount']
|
||||
amount_value = amount.get('value', 0)
|
||||
fees_value = total_fees.get('value', Decimal()).copy_abs()
|
||||
if amount_value.is_signed():
|
||||
fees_value = fees_value.copy_negate()
|
||||
fees_value = total_fees.get('value', Decimal()).copy_negate()
|
||||
amount_value -= fees_value
|
||||
unique_import_id = '%s-%s-%s' % (
|
||||
transaction['type'],
|
||||
|
||||
Reference in New Issue
Block a user