summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/modules/Payment.sql1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/modules/Payment.sql b/sql/modules/Payment.sql
index b1093305..1af67e9b 100644
--- a/sql/modules/Payment.sql
+++ b/sql/modules/Payment.sql
@@ -269,6 +269,7 @@ BEGIN
(sum(p.due) > c.threshold
OR sum(case when a.batch_id = in_batch_id then 1
else 0 END) > 0)
+ ORDER BY c.meta_number DESC
LOOP
RETURN NEXT payment_item;
END LOOP;