fix: align total costs with visible budgets

This commit is contained in:
2026-05-06 13:31:32 +02:00
parent 7cd85cc5ae
commit 3990a2ea49
5 changed files with 162 additions and 11 deletions
+15
View File
@@ -180,3 +180,18 @@ def test_personal_account_names_fill_with_admin_if_only_one_editor_is_active(app
assert personal_labels["persoenlich-flo"] == "Person A"
assert personal_labels["persoenlich-desi"] == "Admin"
def test_compute_summary_ignores_inactive_budget_entries(app):
service = app.extensions["saldo.month_service"]
month = Month.query.filter_by(label="2026-04").first()
value = next(item for item in month.entry_values if item.entry.name == "Miete")
baseline = service.compute_summary(month)
value.entry.is_active = False
db.session.commit()
summary = service.compute_summary(month)
assert summary.fixed_costs == baseline.fixed_costs - Decimal("920.00")
assert summary.total_costs == baseline.total_costs - Decimal("920.00")