From 5147002034ba8722bbe3dc589214a1a52c175fbc Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Sat, 17 Oct 2020 20:10:35 +0300 Subject: [PATCH] [FIX] account_bank_statement_import_online_transferwise: fix fees with top-up --- .../models/online_bank_statement_provider_transferwise.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py b/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py index e7a70a8..1926698 100644 --- a/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py +++ b/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 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'],