2
0
forked from Wavyzz/dolibarr
This commit is contained in:
ldestailleur
2025-04-07 12:23:17 +02:00
parent fee67ce8c7
commit 30da60c955

View File

@@ -1154,7 +1154,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
// Define $yearcomp and $monthcomp (that will be use in the select where to search max number) // Define $yearcomp and $monthcomp (that will be use in the select where to search max number)
$monthcomp = $maskraz; $monthcomp = $maskraz;
$yearcomp = 0; $yearcomp = '';
if (!empty($yearoffsettype) && !is_numeric($yearoffsettype) && $yearoffsettype != '=') { // $yearoffsettype is - or + if (!empty($yearoffsettype) && !is_numeric($yearoffsettype) && $yearoffsettype != '=') { // $yearoffsettype is - or +
$currentyear = (int) date("Y", $date); $currentyear = (int) date("Y", $date);
@@ -1183,7 +1183,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
} elseif ($yearlen == 2) { } elseif ($yearlen == 2) {
$yearcomp = sprintf("%02d", idate("y", $date) + $yearoffset); $yearcomp = sprintf("%02d", idate("y", $date) + $yearoffset);
} elseif ($yearlen == 1) { } elseif ($yearlen == 1) {
$yearcomp = (int) substr(date('y', $date), 1, 1) + $yearoffset; $yearcomp = (string) ((int) substr(date('y', $date), 1, 1) + $yearoffset);
} }
if ($monthcomp > 1 && empty($resetEveryMonth)) { // Test with month is useless if monthcomp = 1 (0 is same as 1) if ($monthcomp > 1 && empty($resetEveryMonth)) { // Test with month is useless if monthcomp = 1 (0 is same as 1)
if ($yearlen == 4) { if ($yearlen == 4) {