From 97d9b4571a90e9b5bcf83c64dfc1e0ba6ae9c0d3 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 6 Jan 2022 11:21:46 +0100 Subject: [PATCH] FIX : late warning calculation on action comm list --- htdocs/comm/action/list.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 2db2d988add..6891b696be4 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -657,6 +657,8 @@ if ($resql) $actionstatic->label = $obj->label; $actionstatic->location = $obj->location; $actionstatic->note_private = dol_htmlentitiesbr($obj->note); + $actionstatic->datep = $db->jdate($obj->dp); + $actionstatic->percentage = $obj->percent; $actionstatic->fetchResources(); @@ -738,10 +740,7 @@ if ($resql) print ''; print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser'); $late = 0; - if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1; - if ($obj->percent == 0 && !$obj->dp && $obj->dp2 && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1; - if ($obj->percent > 0 && $obj->percent < 100 && $obj->dp2 && $db->jdate($obj->dp2) < ($now - $delay_warning)) $late = 1; - if ($obj->percent > 0 && $obj->percent < 100 && !$obj->dp2 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1; + if($actioncomm->hasDelay() && $actioncomm->percentage >= 0 && $actioncomm->percentage < 100 ) $late = 1; if ($late) print img_warning($langs->trans("Late")).' '; print ''; }