poprawa logiki liczenia w panelu

This commit is contained in:
Mateusz Gruszczyński
2025-07-31 13:06:38 +02:00
parent 0a44753eb2
commit 84ca3aee73
2 changed files with 11 additions and 6 deletions

11
app.py
View File

@@ -779,7 +779,11 @@ def get_admin_expense_summary():
active_lists = calc_sum(
base.filter(
ShoppingList.is_archived == False,
or_(ShoppingList.expires_at == None, ShoppingList.expires_at > now),
~(
(ShoppingList.is_temporary == True) &
(ShoppingList.expires_at != None) &
(ShoppingList.expires_at <= now)
)
)
)
@@ -790,8 +794,9 @@ def get_admin_expense_summary():
expired_lists = calc_sum(
base.filter(
ShoppingList.is_archived == False,
ShoppingList.expires_at != None,
ShoppingList.expires_at <= now,
(ShoppingList.is_temporary == True),
(ShoppingList.expires_at != None),
(ShoppingList.expires_at <= now),
)
)