2
0
forked from Wavyzz/dolibarr

Fix: homognisation du code

Add: modle de numrotation paramtrable "orchidee" pour les commandes fournisseurs
This commit is contained in:
Regis Houssin
2007-05-15 15:53:46 +00:00
parent cd6cb2a8f6
commit 8d2c92818b
18 changed files with 196 additions and 172 deletions

View File

@@ -2582,15 +2582,18 @@ function num_public_holiday($timestampStart, $timestampEnd)
*/
function num_between_day($timestampStart, $timestampEnd, $lastday=0)
{
if ($lastday == 1)
if ($timestampStart < $timestampEnd)
{
$bit = 0;
if ($lastday == 1)
{
$bit = 0;
}
else
{
$bit = 1;
}
$nbjours = round(($timestampEnd - $timestampStart)/(60*60*24)-$bit);
}
else
{
$bit = 1;
}
$nbjours = round(($timestampEnd - $timestampStart)/(60*60*24)-$bit);
return $nbjours;
}
@@ -2604,16 +2607,19 @@ function num_between_day($timestampStart, $timestampEnd, $lastday=0)
*/
function num_open_day($timestampStart, $timestampEnd,$inhour=0,$lastday=0)
{
if ($lastday == 1)
if ($timestampStart < $timestampEnd)
{
$bit = 1;
if ($lastday == 1)
{
$bit = 1;
}
else
{
$bit = 0;
}
$nbOpenDay = num_between_day($timestampStart, $timestampEnd, $bit) - num_public_holiday($timestampStart, $timestampEnd);
if ($inhour == 1) $nbOpenDay = $nbOpenDay*24;
}
else
{
$bit = 0;
}
$nbOpenDay = num_between_day($timestampStart, $timestampEnd, $bit) - num_public_holiday($timestampStart, $timestampEnd);
if ($inhour == 1) $nbOpenDay = $nbOpenDay*24;
return $nbOpenDay;
}