Browse Source

[FIX] account_bank_statement_import_online_transferwise: fix fees with top-up

12.0
Alexey Pelykh 4 years ago
parent
commit
5147002034
  1. 5
      account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py

5
account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py

@ -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()
if amount_value.is_signed():
fees_value = fees_value.copy_negate()
fees_value = total_fees.get('value', Decimal()).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'],

Loading…
Cancel
Save