37 -11=>
"Pacific/Midway",
38 -10=>
"Pacific/Fakaofo",
39 -9=>
"America/Anchorage",
40 -8=>
"America/Los_Angeles",
41 -7=>
"America/Dawson_Creek",
42 -6=>
"America/Chicago",
44 -4=>
"America/Anguilla",
45 -3=>
"America/Araguaina",
46 -2=>
"America/Noronha",
47 -1=>
"Atlantic/Azores",
58 10=>
"Australia/Sydney",
60 12=>
"Pacific/Auckland",
61 13=>
"Pacific/Enderbury"
74 return @date_default_timezone_get();
85 if (method_exists(
'DateTimeZone',
'getOffset'))
89 if ($refgmtdate ==
'now') $newrefgmtdate = $yearref.
'-'.$monthref.
'-'.$dayref;
90 elseif ($refgmtdate ==
'summer') $newrefgmtdate = $yearref.
'-08-01';
91 else $newrefgmtdate = $yearref.
'-01-01';
92 $newrefgmtdate .=
'T00:00:00+00:00';
94 $localdt =
new DateTime($newrefgmtdate, $localtz);
95 $tmp = -1 * $localtz->getOffset($localdt);
101 $tz = round(($tmp < 0 ? 1 : -1) * abs($tmp / 3600));
118 if ($duration_value == 0)
return $time;
119 if ($duration_unit ==
'i')
return $time + (60 * $duration_value);
120 if ($duration_unit ==
'h')
return $time + (3600 * $duration_value);
121 if ($duration_unit ==
'w')
return $time + (3600 * 24 * 7 * $duration_value);
125 if ($duration_value > 0) { $deltastring .= abs($duration_value); $sub =
false; }
126 if ($duration_value < 0) { $deltastring .= abs($duration_value); $sub =
true; }
127 if ($duration_unit ==
'd') { $deltastring .=
"D"; }
128 if ($duration_unit ==
'm') { $deltastring .=
"M"; }
129 if ($duration_unit ==
'y') { $deltastring .=
"Y"; }
131 $date =
new DateTime();
132 if (!empty($conf->global->MAIN_DATE_IN_MEMORY_ARE_GMT)) $date->setTimezone(
new DateTimeZone(
'UTC'));
133 $date->setTimestamp($time);
134 $interval =
new DateInterval($deltastring);
136 if ($sub) $date->sub($interval);
137 else $date->add($interval);
139 return $date->getTimestamp();
154 $iResult = ($iHours * 3600) + ($iMinutes * 60) + $iSeconds;
184 if (empty($lengthOfDay)) $lengthOfDay = 86400;
185 if (empty($lengthOfWeek)) $lengthOfWeek = 7;
187 if ($format ==
'all' || $format ==
'allwithouthour' || $format ==
'allhour' || $format ==
'allhourmin' || $format ==
'allhourminsec')
189 if ((
int) $iSecond === 0)
return '0';
195 if ($iSecond >= $lengthOfDay)
197 for ($i = $iSecond; $i >= $lengthOfDay; $i -= $lengthOfDay)
200 $iSecond -= $lengthOfDay;
202 $dayTranslate = $langs->trans(
"Day");
203 if ($iSecond >= ($lengthOfDay * 2)) $dayTranslate = $langs->trans(
"Days");
206 if ($lengthOfWeek < 7)
210 if ($sDay >= $lengthOfWeek)
212 $sWeek = (int) (($sDay - $sDay % $lengthOfWeek) / $lengthOfWeek);
213 $sDay = $sDay % $lengthOfWeek;
214 $weekTranslate = $langs->trans(
"DurationWeek");
215 if ($sWeek >= 2) $weekTranslate = $langs->trans(
"DurationWeeks");
216 $sTime .= $sWeek.
' '.$weekTranslate.
' ';
222 $dayTranslate = $langs->trans(
"Day");
223 if ($sDay > 1) $dayTranslate = $langs->trans(
"Days");
224 $sTime .= $sDay.
' '.$dayTranslate.
' ';
227 if ($format ==
'all')
229 if ($iSecond || empty($sDay))
233 } elseif ($format ==
'allhourminsec')
235 return sprintf(
"%02d", ($sWeek * $lengthOfWeek * 24 + $sDay * 24 + (
int) floor($iSecond / 3600))).
':'.sprintf(
"%02d", ((
int) floor(($iSecond % 3600) / 60))).
':'.sprintf(
"%02d", ((
int) ($iSecond % 60)));
236 } elseif ($format ==
'allhourmin')
238 return sprintf(
"%02d", ($sWeek * $lengthOfWeek * 24 + $sDay * 24 + (
int) floor($iSecond / 3600))).
':'.sprintf(
"%02d", ((
int) floor(($iSecond % 3600) / 60)));
239 } elseif ($format ==
'allhour')
241 return sprintf(
"%02d", ($sWeek * $lengthOfWeek * 24 + $sDay * 24 + (
int) floor($iSecond / 3600)));
243 } elseif ($format ==
'hour')
246 } elseif ($format ==
'fullhour')
248 if (!empty($iSecond)) {
249 $iSecond = $iSecond / 3600;
254 } elseif ($format ==
'min')
257 } elseif ($format ==
'sec')
260 } elseif ($format ==
'month')
263 } elseif ($format ==
'year')
281 function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0)
285 if ($month_date > 0) {
286 if ($year_date > 0 && empty($day_date)) {
287 $sqldate .= ($excludefirstand ?
"" :
" AND ").$datefield.
" BETWEEN '".$db->idate(
dol_get_first_day($year_date, $month_date,
false));
288 $sqldate .=
"' AND '".$db->idate(
dol_get_last_day($year_date, $month_date,
false)).
"'";
289 } elseif ($year_date > 0 && !empty($day_date)) {
290 $sqldate .= ($excludefirstand ?
"" :
" AND ").$datefield.
" BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $month_date, $day_date, $year_date));
291 $sqldate .=
"' AND '".$db->idate(
dol_mktime(23, 59, 59, $month_date, $day_date, $year_date)).
"'";
292 }
else $sqldate .= ($excludefirstand ?
"" :
" AND ").
" date_format( ".$datefield.
", '%c') = '".$db->escape($month_date).
"'";
293 } elseif ($year_date > 0) {
294 $sqldate .= ($excludefirstand ?
"" :
" AND ").$datefield.
" BETWEEN '".$db->idate(
dol_get_first_day($year_date, 1,
false));
295 $sqldate .=
"' AND '".$db->idate(
dol_get_last_day($year_date, 12,
false)).
"'";
323 if (preg_match(
'/^([0-9]+)\/([0-9]+)\/([0-9]+)\s?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $string, $reg))
325 dol_syslog(
"dol_stringtotime call to function with deprecated parameter format", LOG_WARNING);
334 if ($syear < 50) $syear += 1900;
335 if ($syear >= 50 && $syear < 100) $syear += 2000;
336 $string = sprintf(
"%04d%02d%02d%02d%02d%02d", $syear, $smonth, $sday, $shour, $smin, $ssec);
338 preg_match(
'/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i', $string, $reg)
339 || preg_match(
'/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i', $string, $reg)
340 || preg_match(
'/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i', $string, $reg)
349 $string = sprintf(
"%04d%02d%02d%02d%02d%02d", $syear, $smonth, $sday, $shour, $smin, $ssec);
352 $string = preg_replace(
'/([^0-9])/i',
'', $string);
353 $tmp = $string.
'000000';
354 $date =
dol_mktime(substr($tmp, 8, 2), substr($tmp, 10, 2), substr($tmp, 12, 2), substr($tmp, 4, 2), substr($tmp, 6, 2), substr($tmp, 0, 4), ($gm ? 1 : 0));
369 $time =
dol_mktime(12, 0, 0, $month, $day, $year, 1, 0);
370 $time -= 24 * 60 * 60;
372 return array(
'year' => $tmparray[
'year'],
'month' => $tmparray[
'mon'],
'day' => $tmparray[
'mday']);
385 $time =
dol_mktime(12, 0, 0, $month, $day, $year, 1, 0);
386 $time += 24 * 60 * 60;
388 return array(
'year' => $tmparray[
'year'],
'month' => $tmparray[
'mon'],
'day' => $tmparray[
'mday']);
403 $prev_year = $year - 1;
405 $prev_month = $month - 1;
408 return array(
'year' => $prev_year,
'month' => $prev_month);
423 $next_year = $year + 1;
425 $next_month = $month + 1;
428 return array(
'year' => $next_year,
'month' => $next_month);
444 $time =
dol_mktime(12, 0, 0, $month, $tmparray[
'first_day'], $year, 1, 0);
445 $time -= 24 * 60 * 60 * 7;
447 return array(
'year' => $tmparray[
'year'],
'month' => $tmparray[
'mon'],
'day' => $tmparray[
'mday']);
463 $time =
dol_mktime(12, 0, 0, $tmparray[
'first_month'], $tmparray[
'first_day'], $tmparray[
'first_year'], 1, 0);
464 $time += 24 * 60 * 60 * 7;
467 return array(
'year' => $tmparray[
'year'],
'month' => $tmparray[
'mon'],
'day' => $tmparray[
'mday']);
483 if ($year > 9999)
return '';
484 return dol_mktime(0, 0, 0, $month, 1, $year, $gm);
500 if ($year > 9999)
return '';
510 $datelim =
dol_mktime(23, 59, 59, $month, 1, $year, $gm);
511 $datelim -= (3600 * 24);
527 return dol_mktime(23, 59, 59, $tmparray[
'mon'], $tmparray[
'mday'], $tmparray[
'year'], $gm);
541 return dol_mktime(0, 0, 0, $tmparray[
'mon'], $tmparray[
'mday'], $tmparray[
'year'], $gm);
558 $date =
dol_mktime(0, 0, 0, $month, $day, $year, $gm);
561 $start_week = (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1);
566 $days = $start_week - $tmparray[
'wday'];
567 if ($days >= 1) $days = 7 - $days;
569 $seconds = $days * 24 * 60 * 60;
573 $tmpdaytms = date($tmparray[0]) - $seconds;
574 $tmpday = date(
"d", $tmpdaytms);
579 $prev_month = $month - 1;
582 if ($prev_month == 0)
585 $prev_year = $year - 1;
588 $prev_month = $month;
591 $tmpmonth = $prev_month;
592 $tmpyear = $prev_year;
595 $tmptime =
dol_mktime(12, 0, 0, $month, $tmpday, $year, 1, 0);
596 $tmptime -= 24 * 60 * 60 * 7;
598 $prev_day = $tmparray[
'mday'];
601 if ($prev_day > $tmpday)
603 $prev_month = $month - 1;
606 if ($prev_month == 0)
609 $prev_year = $year - 1;
613 $week = date(
"W",
dol_mktime(0, 0, 0, $tmpmonth, $tmpday, $tmpyear, $gm));
615 return array(
'year' => $year,
'month' => $month,
'week' => $week,
'first_day' => $tmpday,
'first_month' => $tmpmonth,
'first_year' => $tmpyear,
'prev_year' => $prev_year,
'prev_month' => $prev_month,
'prev_day' => $prev_day);
627 $base =
new DateTime(
"$year-03-21",
new DateTimeZone(
"UTC"));
628 $days = easter_days($year);
629 $tmp = $base->add(
new DateInterval(
"P{$days}D"));
630 return $tmp->getTimestamp();
647 function num_public_holiday($timestampStart, $timestampEnd, $country_code =
'', $lastday = 0, $includesaturday = -1, $includesunday = -1)
649 global $db, $conf, $mysoc;
654 if ((($timestampEnd - $timestampStart) % 86400) != 0)
return 'Error Dates must use same hours and must be GMT dates';
656 if (empty($country_code)) $country_code = $mysoc->country_code;
658 if ($includesaturday < 0) $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1);
659 if ($includesunday < 0) $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1);
661 $country_id =
dol_getIdFromCode($db, $country_code,
'c_country',
'code',
'rowid');
664 while ((($lastday == 0 && $timestampStart < $timestampEnd) || ($lastday && $timestampStart <= $timestampEnd))
668 $specialdayrule = array();
670 $jour = gmdate(
"d", $timestampStart);
671 $mois = gmdate(
"m", $timestampStart);
672 $annee = gmdate(
"Y", $timestampStart);
678 $sql =
"SELECT code, entity, fk_country, dayrule, year, month, day, active";
679 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_hrm_public_holiday";
680 $sql .=
" WHERE active = 1 and fk_country IN (0".($country_id > 0 ?
", ".$country_id : 0).
")";
682 $resql = $db->query($sql);
685 $num_rows = $db->num_rows(
$resql);
687 while ($i < $num_rows)
689 $obj = $db->fetch_object(
$resql);
691 if (!empty($obj->dayrule) && $obj->dayrule !=
'date')
693 $specialdayrule[$obj->dayrule] = $obj->dayrule;
696 if (!empty($obj->year) && $obj->year != $annee) $match = 0;
697 if ($obj->month != $mois) $match = 0;
698 if ($obj->day != $jour) $match = 0;
700 if ($match) $ferie =
true;
707 return 'Error sql '.$db->lasterror();
714 if (in_array(
'easter', $specialdayrule))
718 $jour_paques = gmdate(
"d", $date_paques);
719 $mois_paques = gmdate(
"m", $date_paques);
720 if ($jour_paques == $jour && $mois_paques == $mois) $ferie =
true;
724 if (in_array(
'eastermonday', $specialdayrule))
729 $date_lundi_paques = $date_paques + (3600 * 24);
730 $jour_lundi_paques = gmdate(
"d", $date_lundi_paques);
731 $mois_lundi_paques = gmdate(
"m", $date_lundi_paques);
732 if ($jour_lundi_paques == $jour && $mois_lundi_paques == $mois) $ferie =
true;
737 if (in_array(
'ascension', $specialdayrule))
741 $date_ascension = $date_paques + (3600 * 24 * 39);
742 $jour_ascension = gmdate(
"d", $date_ascension);
743 $mois_ascension = gmdate(
"m", $date_ascension);
744 if ($jour_ascension == $jour && $mois_ascension == $mois) $ferie =
true;
748 if (in_array(
'pentecote', $specialdayrule))
752 $date_pentecote = $date_paques + (3600 * 24 * 49);
753 $jour_pentecote = gmdate(
"d", $date_pentecote);
754 $mois_pentecote = gmdate(
"m", $date_pentecote);
755 if ($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie =
true;
758 if (in_array(
'pentecotemonday', $specialdayrule))
762 $date_pentecote = $date_paques + (3600 * 24 * 50);
763 $jour_pentecote = gmdate(
"d", $date_pentecote);
764 $mois_pentecote = gmdate(
"m", $date_pentecote);
765 if ($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie =
true;
769 if (in_array(
'viernessanto', $specialdayrule))
773 $date_viernes = $date_paques - (3600 * 24 * 2);
774 $jour_viernes = gmdate(
"d", $date_viernes);
775 $mois_viernes = gmdate(
"m", $date_viernes);
776 if ($jour_viernes == $jour && $mois_viernes == $mois) $ferie =
true;
780 if (in_array(
'fronleichnam', $specialdayrule))
784 $date_fronleichnam = $date_paques + (3600 * 24 * 60);
785 $jour_fronleichnam = gmdate(
"d", $date_fronleichnam);
786 $mois_fronleichnam = gmdate(
"m", $date_fronleichnam);
787 if ($jour_fronleichnam == $jour && $mois_fronleichnam == $mois) $ferie =
true;
795 if ($includesaturday || $includesunday)
797 $jour_julien = unixtojd($timestampStart);
798 $jour_semaine = jddayofweek($jour_julien, 0);
799 if ($includesaturday)
801 if ($jour_semaine == 6) $ferie =
true;
805 if ($jour_semaine == 0) $ferie =
true;
812 if ($ferie) $nbFerie++;
837 if ($timestampStart < $timestampEnd)
845 $nbjours = (int) floor(($timestampEnd - $timestampStart) / (60 * 60 * 24)) + 1 - $bit;
863 function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, $halfday = 0, $country_code =
'')
865 global $langs, $mysoc;
867 if (empty($country_code)) $country_code = $mysoc->country_code;
869 dol_syslog(
'num_open_day timestampStart='.$timestampStart.
' timestampEnd='.$timestampEnd.
' bit='.$lastday.
' country_code='.$country_code);
872 if (!is_int($timestampStart) && !is_float($timestampStart))
return 'ErrorBadParameter_num_open_day';
873 if (!is_int($timestampEnd) && !is_float($timestampEnd))
return 'ErrorBadParameter_num_open_day';
876 if ($timestampStart < $timestampEnd)
880 $numholidays =
num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday);
881 $nbOpenDay = ($numdays - $numholidays);
882 if ($inhour == 1 && $nbOpenDay <= 3) $nbOpenDay = ($nbOpenDay * 24);
883 return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));
884 } elseif ($timestampStart == $timestampEnd)
888 $numholidays =
num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday);
889 if ($numholidays == 1)
return 0;
892 $nbOpenDay = $lastday;
894 if ($inhour == 1) $nbOpenDay = ($nbOpenDay * 24);
895 return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));
897 return $langs->trans(
"Error");
914 1 => $outputlangs->trans(
"Month01"),
915 2 => $outputlangs->trans(
"Month02"),
916 3 => $outputlangs->trans(
"Month03"),
917 4 => $outputlangs->trans(
"Month04"),
918 5 => $outputlangs->trans(
"Month05"),
919 6 => $outputlangs->trans(
"Month06"),
920 7 => $outputlangs->trans(
"Month07"),
921 8 => $outputlangs->trans(
"Month08"),
922 9 => $outputlangs->trans(
"Month09"),
923 10 => $outputlangs->trans(
"Month10"),
924 11 => $outputlangs->trans(
"Month11"),
925 12 => $outputlangs->trans(
"Month12")
931 1 => $outputlangs->trans(
"MonthShort01"),
932 2 => $outputlangs->trans(
"MonthShort02"),
933 3 => $outputlangs->trans(
"MonthShort03"),
934 4 => $outputlangs->trans(
"MonthShort04"),
935 5 => $outputlangs->trans(
"MonthShort05"),
936 6 => $outputlangs->trans(
"MonthShort06"),
937 7 => $outputlangs->trans(
"MonthShort07"),
938 8 => $outputlangs->trans(
"MonthShort08"),
939 9 => $outputlangs->trans(
"MonthShort09"),
940 10 => $outputlangs->trans(
"MonthShort10"),
941 11 => $outputlangs->trans(
"MonthShort11"),
942 12 => $outputlangs->trans(
"MonthShort12")
957 $nb_days = cal_days_in_month(CAL_GREGORIAN, $month, $year);
959 for ($day = 1; $day < $nb_days; $day++) {
961 $TWeek[$week_number] = $week_number;
974 $TFirstDayOfWeek = array();
975 foreach ($TWeek as $weekNb) {
976 if (in_array(
'01', $TWeek) && in_array(
'52', $TWeek) && $weekNb ==
'01') $year++;
977 $TFirstDayOfWeek[$weekNb] = date(
'd', strtotime($year.
'W'.$weekNb));
979 return $TFirstDayOfWeek;
990 $TLastDayOfWeek = array();
991 foreach ($TWeek as $weekNb) {
992 $TLastDayOfWeek[$weekNb] = date(
'd', strtotime($year.
'W'.$weekNb.
'+6 days'));
994 return $TLastDayOfWeek;
1006 $date =
new DateTime($year.
'-'.$month.
'-'.$day);
1007 $week = $date->format(
"W");
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_get_prev_month($month, $year)
Return previous month.
dol_get_first_day_week($day, $month, $year, $gm=false)
Return first day of week for a date.
dol_now($mode= 'auto')
Return date for now.
getFirstDayOfEachWeek($TWeek, $year)
Return array of first day of weeks.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
dol_stringtotime($string, $gm=1)
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not s...
getServerTimeZoneString()
Return server timezone string.
getWeekNumbersOfMonth($month, $year)
Return array of week numbers.
getLastDayOfEachWeek($TWeek, $year)
Return array of last day of weeks.
dol_get_prev_day($day, $month, $year)
Return previous day.
convertTime2Seconds($iHours=0, $iMinutes=0, $iSeconds=0)
Convert hours and minutes into seconds.
dol_get_next_week($day, $week, $month, $year)
Return next week.
dol_get_last_hour($date, $gm= 'tzserver')
Return GMT time for last hour of a given GMT date (it removes hours, min and second part) ...
num_between_day($timestampStart, $timestampEnd, $lastday=0)
Function to return number of days between two dates (date must be UTC date !) Example: 2012-01-01 201...
getServerTimeZoneInt($refgmtdate= 'now')
Return server timezone int.
dol_get_next_month($month, $year)
Return next month.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
dol_get_next_day($day, $month, $year)
Return next day.
dol_getdate($timestamp, $fast=false, $forcetimezone= '')
Return an array with locale date info.
num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code= '')
Function to return number of working days (and text of units) between two dates (working days) ...
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0)
Generate a SQL string to make a filter into a range (for second of date until last second of date) ...
dol_get_first_hour($date, $gm= 'tzserver')
Return GMT time for first hour of a given GMT date (it removes hours, min and second part) ...
monthArray($outputlangs, $short=0)
Return array of translated months or selected month.
num_public_holiday($timestampStart, $timestampEnd, $country_code= '', $lastday=0, $includesaturday=-1, $includesunday=-1)
Return the number of non working days including saturday and sunday (or not) between 2 dates in times...
getWeekNumber($day, $month, $year)
Return week number.
dol_get_prev_week($day, $week, $month, $year)
Return previous week.
dol_getIdFromCode($db, $key, $tablename, $fieldkey= 'code', $fieldid= 'id', $entityfilter=0)
Return an id or code from a code or id.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
get_tz_array()
Return an array with timezone values.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getGMTEasterDatetime($year)
Return the easter day in GMT time.
dol_time_plus_duree($time, $duration_value, $duration_unit)
Add a delay to a date.
convertSecondToTime($iSecond, $format= 'all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.