Skip to content

Commit 39b7e0c

Browse files
committed
minor bug fix
1 parent d9d77f8 commit 39b7e0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def text_handler(text, chat_id):
8282
message = "Current month outcome list:\n\n"
8383
for r in rows:
8484
message = message+str(r).replace("(", "").replace(")", "").replace("'", "")+"\n"
85-
total_outcome = db.get_total_income(month)
86-
message = message+"\n\nTotal income: "+str(total_outcome)+" €"
85+
total_outcome = db.get_total_outcome(month)
86+
message = message+"\n\nTotal outcomecome: "+str(total_outcome)+" €"
8787
else:
8888
message = "No income to be displayed here " + emoji["openhands"]
8989
elif text == "/balance":
@@ -95,7 +95,7 @@ def text_handler(text, chat_id):
9595
if total_outcome is None:
9696
total_outcome = 0.0
9797
logging.info(total_outcome)
98-
balance = total_income + total_outcome
98+
balance = total_income - total_outcome
9999
message = "Current month balance: "+str(balance)+" €\n\n\nTotal income: "+str(total_income)+" €\n\nTotal outcome: "+str(total_outcome)+" €"
100100
handler.send_message(message, chat_id)
101101

0 commit comments

Comments
 (0)