feat: improve transaction ordering on calendar

This commit is contained in:
Herculino Trotta
2024-10-29 15:05:39 -03:00
parent f12f489ad3
commit 28de7545b1
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -37,7 +37,12 @@ def get_transactions_by_day(year, month):
# Get all transactions for the month
transactions = Transaction.objects.filter(
date__year=year, date__month=month
).order_by("date")
).order_by(
"date",
"-type",
"-is_paid",
"id",
)
# Calculate padding days needed
padding_days = first_day.weekday() # Monday is 0, Sunday is 6