Skip to content

Commit

Permalink
fix: total price calculation (#5)
Browse files Browse the repository at this point in the history
* dont log data

* fix: total price calculation
  • Loading branch information
progmatic-99 committed May 3, 2024
1 parent d94db3c commit df57fcf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# 🛒 Rashan Bot 🤖

## > Sorry, if this is a fast video as github won't let me upload longer videos.

https://github.com/progmatic-99/rashan/blob/master/rashan-fast-demo.mp4


> Rashan Bot is a Telegram bot designed to help you manage your expenses and track item usage conveniently within the Telegram app. With Rashan Bot, you can easily add, edit, delete expenses, view recent expenses, and track item usage in the current month.
Expand Down
4 changes: 1 addition & 3 deletions handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async def get_all_items(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> int:
total_price = 0
for item in all_items:
name, quantity, price = item
total_price += price
total_price += int(price)
table.add_row([name, quantity, price])

await update.message.reply_text(
Expand Down Expand Up @@ -184,7 +184,6 @@ async def items_usage(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None:
db = DB()
try:
result = db.get_monthly_usage(curr_month, curr_year)
logger.info(result)
except sqlite3.Error as e:
logger.error(e)
await update.message.reply_text(e)
Expand Down Expand Up @@ -247,7 +246,6 @@ async def last_purchased_item(update: Update, ctx: ContextTypes.DEFAULT_TYPE) ->
db = DB()
try:
result = db.search_item(item)
logger.info(result)
except sqlite3.Error as e:
logger.error(e)
await update.message.reply_text(e)
Expand Down
Binary file removed rashan-fast-demo.mp4
Binary file not shown.

0 comments on commit df57fcf

Please sign in to comment.