forked from Wavyzz/dolibarr
Correction Reset Mask (before do not work with FA{yy}{mm}-{0000@99} with
date 2014-01-01)
This commit is contained in:
@@ -612,13 +612,13 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
if ($maskraz > 0) // A reset is required
|
||||
{
|
||||
if ($maskraz == 99) {
|
||||
$maskraz = date('m');
|
||||
$maskraz = date('m',$date);
|
||||
$resetEveryMonth = true;
|
||||
}
|
||||
if ($maskraz > 12) return 'ErrorBadMaskBadRazMonth';
|
||||
|
||||
// Define posy, posm and reg
|
||||
if ($maskraz > 1)
|
||||
if ($maskraz >= 1)
|
||||
{
|
||||
if (! preg_match('/^(.*)\{(y+)\}\{(m+)\}/i',$maskwithonlyymcode)
|
||||
&& ! preg_match('/^(.*)\{(m+)\}\{(y+)\}/i',$maskwithonlyymcode)) return 'ErrorCantUseRazInStartedYearIfNoYearMonthInMask';
|
||||
|
||||
Reference in New Issue
Block a user