diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index f184cdc201e..ea87ea6fda0 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -54,7 +54,7 @@ $month = GETPOST('month_start'); $year = GETPOST('year_start'); if(empty($month)) { - $month = date('m'); + $month = date('n'); } if(empty($year)) { $year = date('Y'); @@ -65,7 +65,7 @@ $sql.= " FROM llx_holiday cp"; $sql.= " LEFT JOIN llx_user u ON cp.fk_user = u.rowid"; $sql.= " WHERE cp.statut = 3"; // Approved // TODO Use BETWEEN instead of date_format -$sql.= " AND (date_format(cp.date_debut, '%Y-%m') = '$year-$month' OR date_format(cp.date_fin, '%Y-%m') = '$year-$month')"; +$sql.= " AND (date_format(cp.date_debut, '%Y-%c') = '$year-$month' OR date_format(cp.date_fin, '%Y-%c') = '$year-$month')"; $sql.= " ORDER BY u.lastname,cp.date_debut"; $result = $db->query($sql); @@ -77,8 +77,9 @@ print '