diff --git a/accountant/api/views/entries.py b/accountant/api/views/entries.py index dd63a18..370ce2f 100644 --- a/accountant/api/views/entries.py +++ b/accountant/api/views/entries.py @@ -38,7 +38,7 @@ def get_entries(account_id, year, month): whens={Operation.canceled: None}, else_=func.sum(Operation.value).over( partition_by="canceled", - order_by="operation_date, value desc, label desc") + order_by=["operation_date", desc("value"), desc("label")]) ).label("sold") ).filter(Operation.account_id == account_id).order_by( desc(Operation.operation_date),