diff --git a/chezbetty/models/model.py b/chezbetty/models/model.py index d75cc64..9618fd2 100644 --- a/chezbetty/models/model.py +++ b/chezbetty/models/model.py @@ -15,7 +15,8 @@ ForeignKey, Boolean, LargeBinary, - desc + desc, + asc ) from sqlalchemy.ext.declarative import declarative_base diff --git a/chezbetty/models/transaction.py b/chezbetty/models/transaction.py index 0b88ffc..e5972d7 100644 --- a/chezbetty/models/transaction.py +++ b/chezbetty/models/transaction.py @@ -473,7 +473,7 @@ def __relevant_cash_deposits(self): # Now get all cash deposits between that cash box empty and this one q = object_session(self).query(event.Deposit)\ .filter(event.Event.timestamp < self.timestamp)\ - .filter(event.Event.deleted==False) + .order_by(asc(event.Event.timestamp)) if previous_cb_empty: q = q.filter(event.Event.timestamp >= previous_cb_empty.timestamp) diff --git a/chezbetty/templates/admin/event.jinja2 b/chezbetty/templates/admin/event.jinja2 index a5fc6db..874e157 100644 --- a/chezbetty/templates/admin/event.jinja2 +++ b/chezbetty/templates/admin/event.jinja2 @@ -152,8 +152,8 @@