fix fees when importing from bitcoin.de

This commit is contained in:
2021-05-12 07:34:55 +02:00
parent de6fc641ca
commit 031157e5aa
+5 -1
View File
@@ -37,7 +37,10 @@ class ImportBtcDe:
if trade['trading_pair'].upper().endswith(f):
t.fiat_currency = f
t.owner = Owner
t.crypto_amount = Decimal(trade['amount_currency_to_trade'])-Decimal(trade['amount_currency_to_trade'])
if trade['type'] == 'sell':
t.crypto_amount = Decimal(trade['amount_currency_to_trade'])-Decimal(trade['fee_currency_to_trade'])
else:
t.crypto_amount = Decimal(trade['amount_currency_to_trade'])
t.crypto_fee = Decimal(trade['fee_currency_to_trade'])
t.fiat_amount = Decimal(trade['volume_currency_to_pay'])
t.fiat_fee = Decimal(trade['fee_currency_to_pay'])
@@ -45,6 +48,7 @@ class ImportBtcDe:
t.transaction_type = 'S'
else:
t.transaction_type = 'B'
t.description = 'Bitcoin.de Trade'
t.exchange_rate = trade['price']
t.date_valid = trade['created_at']
t.save()