From 1880e51d1c7d6857f3551daa9feab6f67efc61ff Mon Sep 17 00:00:00 2001 From: Lars Wallenborn Date: Thu, 7 Jan 2021 11:43:08 +0100 Subject: [PATCH] [FIX] sort order in birthday box The current sort order is by date and not by day of month. This yields the following unexpected results: Given * Person A, born on 1980-01-10 * Person B, born on 1970-01-30 I expect Person A to be listed first because their birthday is before that of Person B _in January_. But without this fix, Person B would show up first because 1970 is before 1980. --- htdocs/core/boxes/box_birthdays.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index 9a2ccd33cf7..d984635bdd6 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -91,7 +91,7 @@ class box_birthdays extends ModeleBoxes $sql .= " WHERE u.entity IN (".getEntity('user').")"; $sql .= " AND u.statut = 1"; $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0); - $sql .= " ORDER BY u.birth ASC"; + $sql .= " ORDER BY DAYOFMONTH(u.birth) ASC"; $sql .= $this->db->plimit($max, 0); dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);