modified: blueprints/auth.py

modified:   blueprints/finance.py
	modified:   core/db.py
This commit is contained in:
2026-06-23 16:38:20 -04:00
parent 5ba1c40359
commit 518ad0f987
3 changed files with 13 additions and 12 deletions

View File

@@ -182,15 +182,6 @@ def gastos():
with get_db_connection() as conn:
cur = conn.cursor()
cur.execute('''
CREATE TABLE IF NOT EXISTS expenses (
id INTEGER PRIMARY KEY AUTOINCREMENT,
date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
description TEXT NOT NULL,
amount INTEGER NOT NULL
)
''')
sales_total = cur.execute("SELECT SUM(total) FROM sales WHERE strftime('%Y-%m', date, 'localtime') = ?", (selected_month,)).fetchone()[0] or 0
expenses_total = cur.execute("SELECT SUM(amount) FROM expenses WHERE strftime('%Y-%m', date, 'localtime') = ?", (selected_month,)).fetchone()[0] or 0