2
0
forked from Wavyzz/dolibarr

Fix: more simple

This commit is contained in:
Regis Houssin
2012-09-22 09:18:36 +02:00
parent eee4434850
commit 6151bc3a42
2 changed files with 32 additions and 37 deletions

View File

@@ -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);
//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 ($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 before of next new year date
if ($date < $nextnewyeardate && $yearoffsettype == '+') $yearoffset=1;
}
// If after or equal of current new year date
else if ($date >= $newyeardate && $yearoffsettype == '-') $yearoffset=-1;
}
// 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