From ed2a9a22e8c7958093a85333b9232dbbba58751d Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 23 Nov 2022 08:36:20 +0100 Subject: [PATCH] FIX compute next value when year is on one digit for reset counter --- htdocs/core/lib/functions2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 0035688c66f..066027aa24a 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1215,7 +1215,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ } elseif ($yearlen == 2) { $yearcomp = sprintf("%02d", date("y", $date) + $yearoffset); } elseif ($yearlen == 1) { - $yearcomp = substr(date("y", $date), 2, 1) + $yearoffset; + $yearcomp = substr(date('y', $date), 1, 1) + $yearoffset; } if ($monthcomp > 1 && empty($resetEveryMonth)) { // Test with month is useless if monthcomp = 0 or 1 (0 is same as 1) (regis: $monthcomp can't equal 0) if ($yearlen == 4) {