Merge pull request #19753 from atm-lena/13.0_FIX_ActionCommList_LateWarning

FIX : late warning calculation on action comm list
This commit is contained in:
Laurent Destailleur 2022-01-06 12:55:37 +01:00 committed by GitHub
commit 37daf7764d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 '<td class="center nowraponall">';
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 '</td>';
}