mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Fix: problem with specific numbering module
This commit is contained in:
@@ -423,8 +423,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
if ($maskraz > 12) return 'ErrorBadMaskBadRazMonth';
|
if ($maskraz > 12) return 'ErrorBadMaskBadRazMonth';
|
||||||
|
|
||||||
// Define reg
|
// Define reg
|
||||||
if ($maskraz > 1 && ! preg_match('/^(.*)\{(y+)\}\{(m+)\}/i',$maskwithonlyymcode,$reg)) return 'ErrorCantUseRazInStartedYearIfNoYearMonthInMask';
|
if ($maskraz > 1 && ! preg_match('/^(.*)\{(y)+\}\{(m)+\}/i',$maskwithonlyymcode,$reg) && ! preg_match('/^(.*)\{(m)+\}\{(y)+\}/i',$maskwithonlyymcode,$reg)) return 'ErrorCantUseRazInStartedYearIfNoYearMonthInMask';
|
||||||
if ($maskraz <= 1 && ! preg_match('/^(.*)\{(y+)\}/i',$maskwithonlyymcode,$reg)) return 'ErrorCantUseRazIfNoYearInMask';
|
if ($maskraz <= 1 && ! preg_match('/^(.*)\{(y)+\}/i',$maskwithonlyymcode,$reg)) return 'ErrorCantUseRazIfNoYearInMask';
|
||||||
//print "x".$maskwithonlyymcode." ".$maskraz;
|
//print "x".$maskwithonlyymcode." ".$maskraz;
|
||||||
|
|
||||||
// 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)
|
||||||
@@ -448,7 +448,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
$sqlwhere.=') )';
|
$sqlwhere.=') )';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//print "masktri=".$masktri." maskcounter=".$maskcounter." maskraz=".$maskraz." maskoffset=".$maskoffset."<br>\n";
|
//print "masktri=".$masktri." maskcounter=".$maskcounter." maskraz=".$maskraz." maskoffset=".$maskoffset." yearcomp=".$yearcomp."<br>\n";
|
||||||
|
|
||||||
// Define $sqlstring
|
// Define $sqlstring
|
||||||
$posnumstart=strpos($maskwithnocode,$maskcounter); // Pos of counter in final string (from 0 to ...)
|
$posnumstart=strpos($maskwithnocode,$maskcounter); // Pos of counter in final string (from 0 to ...)
|
||||||
|
|||||||
Reference in New Issue
Block a user