This commit is contained in:
ldestailleur 2025-06-27 00:52:48 +02:00
parent 51253c1ee4
commit 7909b0f17a
3 changed files with 8 additions and 16 deletions

View file

@ -595,7 +595,7 @@ function dol_get_next_week($day, $week, $month, $year)
* True or 1 or 'gmt' to compare with GMT date.
* Example: dol_get_first_day(1970,1,false) will return -3600 with TZ+1, a dol_print_date on it will return 1970-01-01 00:00:00
* Example: dol_get_first_day(1970,1,true) will return 0 whatever is TZ, a dol_print_date on it will return 1970-01-01 00:00:00
* @return int|string Date as a timestamp, '' if error
* @return int|'' Date as a timestamp, '' if error
*/
function dol_get_first_day($year, $month = 1, $gm = false)
{
@ -614,7 +614,7 @@ function dol_get_first_day($year, $month = 1, $gm = false)
* @param int $month Month
* @param bool|int<0,1>|'gmt'|'tzserver'|'tzref'|'tzuser'|'tzuserrel' $gm False or 0 or 'tzserver' = Return date to compare with server TZ,
* True or 1 or 'gmt' to compare with GMT date.
* @return int|string Date as a timestamp, '' if error
* @return int|'' Date as a timestamp, '' if error
*/
function dol_get_last_day($year, $month = 12, $gm = false)
{

View file

@ -3904,7 +3904,7 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '')
* 'tzuserrel' = local to user TZ taking dst into account at the given date. Use this one to convert date input from user into a GMT date.
* 'tz,TimeZone' = use specified timezone
* @param int $check 0=No check on parameters (Can use day 32, etc...)
* @return int|string Date as a timestamp, '' if error
* @return int|'' Date as a timestamp, '' if error
* @see dol_print_date(), dol_stringtotime(), dol_getdate()
*/
function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto', $check = 1)

View file

@ -178,13 +178,6 @@ if ($id == '' && $ref == '') {
exit();
}
if ($dates === '') {
$dates = null;
}
if ($datee === '') {
$datee = null;
}
$mine = GETPOST('mode') == 'mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
@ -766,10 +759,10 @@ if (!$showdatefilter) {
print '<input type="hidden" name="tablename" value="'.(empty($tablename) ? '' : $tablename).'">';
print '<input type="hidden" name="action" value="view">';
print '<div class="inline-block">';
print $form->selectDate((int) $dates, 'dates', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($dates, 'dates', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="inline-block">';
print $form->selectDate((int) $datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print $form->selectDate($datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '<div class="inline-block">';
print '<input type="submit" name="refresh" value="'.$langs->trans("Refresh").'" class="button small">';
@ -804,11 +797,10 @@ foreach ($listofreferent as $key => $value) {
$name = $langs->trans($value['name']);
$qualified = $value['test'];
$margin = empty($value['margin']) ? '' : $value['margin'];
if ($qualified && isset($margin)) { // If this element must be included into profit calculation ($margin is 'minus' or 'add')
if ($qualified && $margin) { // If this element must be included into profit calculation ($margin is 'minus' or 'add')
if ($margin === 'add') {
$tooltiponprofitplus .= ' &gt; '.$name." (+)<br>\n";
}
if ($margin === 'minus') {
} elseif ($margin === 'minus') {
$tooltiponprofitminus .= ' &gt; '.$name." (-)<br>\n";
}
}
@ -853,7 +845,7 @@ foreach ($listofreferent as $key => $value) {
$qualified = $value['test'];
$margin = empty($value['margin']) ? 0 : $value['margin'];
$project_field = empty($value['project_field']) ? '' : $value['project_field'];
if ($qualified && isset($margin)) { // If this element must be included into profit calculation ($margin is 'minus' or 'add')
if ($qualified) { // If this element must be included into profit summary table ($margin is '', 'minus' or 'add')
$element = new $classname($db);
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field) ? $project_field : 'fk_projet');