various fixes

This commit is contained in:
2021-05-11 22:30:57 +02:00
parent 1ef459bcad
commit 2818d9c11f
4 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -87,10 +87,10 @@ class Calc:
# calculate all fees.
with connection.cursor() as cursor:
sql = """SELECT SUM(crypto_fee) as crypto_fee, SUM(fiat_fee) as fiat_fee FROM `transaction` WHERE crypto_currency=%s and owner_id=%s"""
sql = """SELECT SUM(crypto_fee) as crypto_fee, SUM(fiat_fee) as fiat_fee FROM `transaction` WHERE crypto_currency=%s and owner_id=%s and transaction_type in ('T','B')"""
cursor.execute(sql, [crypto, userid])
fees = cursor.fetchone()
if sold[0]:
if fees[0]:
total_investment -= Decimal(fees[1])
amount_kept -= Decimal(fees[0])