From 7a8f155ea0623215f427939c8ab5af1357f6a9b8 Mon Sep 17 00:00:00 2001
From: George Katsikas <giorgakis.katsikas@gmail.com>
Date: Wed, 26 Jun 2024 20:19:01 +0300
Subject: [PATCH] add subsidy payment sorting

---
 .../0045_alter_subsidypayment_options.py         | 16 ++++++++++++++++
 .../finances/models/subsidy_payment.py           |  3 +++
 2 files changed, 19 insertions(+)
 create mode 100644 scipost_django/finances/migrations/0045_alter_subsidypayment_options.py

diff --git a/scipost_django/finances/migrations/0045_alter_subsidypayment_options.py b/scipost_django/finances/migrations/0045_alter_subsidypayment_options.py
new file mode 100644
index 000000000..107cb62bc
--- /dev/null
+++ b/scipost_django/finances/migrations/0045_alter_subsidypayment_options.py
@@ -0,0 +1,16 @@
+# Generated by Django 4.2.10 on 2024-06-26 17:18
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+    dependencies = [
+        ("finances", "0044_remove_subsidy_algorithm_and_more"),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name="subsidypayment",
+            options={"ordering": ["date_scheduled", "reference", "amount"]},
+        ),
+    ]
diff --git a/scipost_django/finances/models/subsidy_payment.py b/scipost_django/finances/models/subsidy_payment.py
index 65543c295..c6778831a 100644
--- a/scipost_django/finances/models/subsidy_payment.py
+++ b/scipost_django/finances/models/subsidy_payment.py
@@ -33,6 +33,9 @@ class SubsidyPayment(models.Model):
 
     objects = SubsidyPaymentQuerySet.as_manager()
 
+    class Meta:
+        ordering = ["date_scheduled", "reference", "amount"]
+
     def __str__(self):
         return f"payment {self.reference} for {self.subsidy}"
 
-- 
GitLab