From bd1346f9da4e606057c8d8a0b4ca7de5110b2329 Mon Sep 17 00:00:00 2001 From: Carlos Escalante Date: Thu, 26 Mar 2026 23:29:45 -0600 Subject: [PATCH] Exclude DEPOSITO transactions from budget projections Salary deposits were being counted as expenses in uncovered actuals, causing negative balances. DEPOSITO transactions are income tracked separately in the Salarios page. Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/app/services/budget_projection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/app/services/budget_projection.py b/backend/app/services/budget_projection.py index a235881..27d21b2 100644 --- a/backend/app/services/budget_projection.py +++ b/backend/app/services/budget_projection.py @@ -93,6 +93,7 @@ def compute_actuals_by_source( Transaction.date >= start, Transaction.date < end, Transaction.source == source, + Transaction.transaction_type != TransactionType.DEPOSITO, ) ).one() @@ -124,6 +125,7 @@ def compute_actuals_by_category( Transaction.date >= start, Transaction.date < end, Transaction.category_id.is_not(None), # type: ignore[union-attr] + Transaction.transaction_type != TransactionType.DEPOSITO, ) .group_by(Transaction.category_id, Transaction.transaction_type) ).all() @@ -217,6 +219,7 @@ def compute_monthly_projection( Transaction.date >= start, Transaction.date < end, Transaction.category_id.is_(None), # type: ignore[union-attr] + Transaction.transaction_type != TransactionType.DEPOSITO, ) .group_by(Transaction.transaction_type) ).all()