Exclude DEPOSITO transactions from budget projections
All checks were successful
Deploy to VPS / deploy (push) Successful in 12s

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) <noreply@anthropic.com>
This commit is contained in:
Carlos Escalante
2026-03-26 23:29:45 -06:00
parent 9cfa1c4eb1
commit bd1346f9da

View File

@@ -93,6 +93,7 @@ def compute_actuals_by_source(
Transaction.date >= start, Transaction.date >= start,
Transaction.date < end, Transaction.date < end,
Transaction.source == source, Transaction.source == source,
Transaction.transaction_type != TransactionType.DEPOSITO,
) )
).one() ).one()
@@ -124,6 +125,7 @@ def compute_actuals_by_category(
Transaction.date >= start, Transaction.date >= start,
Transaction.date < end, Transaction.date < end,
Transaction.category_id.is_not(None), # type: ignore[union-attr] Transaction.category_id.is_not(None), # type: ignore[union-attr]
Transaction.transaction_type != TransactionType.DEPOSITO,
) )
.group_by(Transaction.category_id, Transaction.transaction_type) .group_by(Transaction.category_id, Transaction.transaction_type)
).all() ).all()
@@ -217,6 +219,7 @@ def compute_monthly_projection(
Transaction.date >= start, Transaction.date >= start,
Transaction.date < end, Transaction.date < end,
Transaction.category_id.is_(None), # type: ignore[union-attr] Transaction.category_id.is_(None), # type: ignore[union-attr]
Transaction.transaction_type != TransactionType.DEPOSITO,
) )
.group_by(Transaction.transaction_type) .group_by(Transaction.transaction_type)
).all() ).all()