Hi, my company started using dolibarr(10.0.4) a few days ago. In my company Sunday is and 2nd and 4th Saturday of a month is holiday can anyone suggest to me how to handle that in leave balancing?
Thank you.
Hi,
For now it is not possible.
It will come with the V11, that should be released mid-January 2020
Hi @ksar I have solved it with some modification in the code. I have manually included my code in \core\lib\date.lib.php file.
Good !
Can you share your code ? It could help others.
Thanks.
yeh sure,
$dateValue = date(“l”, $timestampStart);
$dateValue = strtolower($dateValue);
if ($countrycode == ‘IN’)
{
$countryfound=1;
if($jour == 1 && $mois == 1) $ferie=true; // New Year's Day
if($jour == 26 && $mois == 1) $ferie=true; // Republic Day
if($jour == 1 && $mois == 5) $ferie=true; // May Day
if($jour == 15 && $mois == 8) $ferie=true; // Independence Day
if($jour == 2 && $mois == 10) $ferie=true; // Gandhi Jayanti
if($jour == 25 && $mois == 12) $ferie=true; // Christmas
if($dateValue == "sunday") $ferie=true; //sunday
if($dateValue == "saturday"){
if($jour>7 && $jour<=14) $ferie=true;//2nd saturday
if($jour>21 && $jour<=28) $ferie=true;//4th saturday
}
}
I have done like that.
I have set $includesaturdysunday=0; and included this code.
Hi Prithwi,
How are you managing when someone will take a half day leave?
In version 10 and onward it is already there.
elseif ($timestampStart == $timestampEnd)
{
$nbOpenDay=$lastday;
if ($inhour == 1) $nbOpenDay = $nbOpenDay*24 . $langs->trans(“HourShort”);
return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));
}
in this code they are managing half day.
Thanks for you kind information.