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',
|
'name': 'Online Bank Statements: TransferWise.com',
|
||||||
'version': '12.0.1.0.0',
|
'version': '12.0.1.0.1',
|
||||||
'author':
|
'author':
|
||||||
'CorporateHub, '
|
'CorporateHub, '
|
||||||
'Odoo Community Association (OCA)',
|
'Odoo Community Association (OCA)',
|
||||||
|
|||||||
@@ -24,19 +24,19 @@ msgid "API key"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: account_bank_statement_import_online_transferwise
|
#. 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
|
#, python-format
|
||||||
msgid "Ending balance unavailable"
|
msgid "Ending balance unavailable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: account_bank_statement_import_online_transferwise
|
#. 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
|
#, python-format
|
||||||
msgid "Fee for %s"
|
msgid "Fee for %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: account_bank_statement_import_online_transferwise
|
#. 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
|
#, python-format
|
||||||
msgid "No API key specified!"
|
msgid "No API key specified!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -52,7 +52,7 @@ msgid "Profile"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: account_bank_statement_import_online_transferwise
|
#. 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
|
#, python-format
|
||||||
msgid "Transaction fee for %s"
|
msgid "Transaction fee for %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
|
# 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).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
@@ -169,9 +170,7 @@ class OnlineBankStatementProviderTransferwise(models.Model):
|
|||||||
)
|
)
|
||||||
amount = transaction['amount']
|
amount = transaction['amount']
|
||||||
amount_value = amount.get('value', 0)
|
amount_value = amount.get('value', 0)
|
||||||
fees_value = total_fees.get('value', Decimal()).copy_abs()
|
fees_value = total_fees.get('value', Decimal()).copy_negate()
|
||||||
if amount_value.is_signed():
|
|
||||||
fees_value = fees_value.copy_negate()
|
|
||||||
amount_value -= fees_value
|
amount_value -= fees_value
|
||||||
unique_import_id = '%s-%s-%s' % (
|
unique_import_id = '%s-%s-%s' % (
|
||||||
transaction['type'],
|
transaction['type'],
|
||||||
|
|||||||
Reference in New Issue
Block a user