2
0
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:
Florian Henry
2014-01-21 12:57:32 +01:00
parent 8642e2027c
commit 57f8f30494

View File

@@ -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';