Fix: more simple
This commit is contained in:
parent
eee4434850
commit
6151bc3a42
@ -635,19 +635,14 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
$nextnewyeardate=dol_mktime('0','0','0','1','1',$currentyear+1);
|
$nextnewyeardate=dol_mktime('0','0','0','1','1',$currentyear+1);
|
||||||
//echo 'currentyear='.$currentyear.' date='.dol_print_date($date, 'day').' fiscaldate='.dol_print_date($fiscaldate, 'day').'<br>';
|
//echo 'currentyear='.$currentyear.' date='.dol_print_date($date, 'day').' fiscaldate='.dol_print_date($fiscaldate, 'day').'<br>';
|
||||||
|
|
||||||
if ($date >= $fiscaldate) // If after or equal current fiscal date
|
// If after or equal of current fiscal date
|
||||||
|
if ($date >= $fiscaldate)
|
||||||
{
|
{
|
||||||
if ($date < $nextnewyeardate) // If before of next new year date
|
// If before of next new year date
|
||||||
{
|
if ($date < $nextnewyeardate && $yearoffsettype == '+') $yearoffset=1;
|
||||||
if ($yearoffsettype == '-') $yearoffset=0;
|
|
||||||
else if ($yearoffsettype == '+') $yearoffset=1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ($date >= $newyeardate) // If after or equal of current new year date
|
|
||||||
{
|
|
||||||
if ($yearoffsettype == '-') $yearoffset=-1;
|
|
||||||
else if ($yearoffsettype == '+') $yearoffset=0;
|
|
||||||
}
|
}
|
||||||
|
// If after or equal of current new year date
|
||||||
|
else if ($date >= $newyeardate && $yearoffsettype == '-') $yearoffset=-1;
|
||||||
}
|
}
|
||||||
// For backward compatibility
|
// For backward compatibility
|
||||||
else if (date("m",$date) < $maskraz) { $yearoffset=-1; } // If current month lower that month of return to zero, year is previous year
|
else if (date("m",$date) < $maskraz) { $yearoffset=-1; } // If current month lower that month of return to zero, year is previous year
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user