From 760d96f27e5e1ff74b91b5a879d0781b1386ce7b Mon Sep 17 00:00:00 2001 From: Romain B <8530352+Rom1-B@users.noreply.github.com> Date: Fri, 24 Nov 2023 12:39:52 +0100 Subject: [PATCH] fix(ticket): percentage of resolution time (#15948) * fix(ticket): percentage of resolution time * cedric --- src/Search.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Search.php b/src/Search.php index 5783200cec5..6724b7049a3 100644 --- a/src/Search.php +++ b/src/Search.php @@ -7098,6 +7098,7 @@ public static function giveItem( $item->fields['date'], $data[$ID][0]['name'] ); + $waitingtime = $slaField === 'slas_id_ttr' ? $item->fields['sla_waiting_duration'] : 0; } else { $calendars_id = Entity::getUsedConfig( 'calendars_strategy', @@ -7121,9 +7122,10 @@ public static function giveItem( $totaltime = strtotime($data[$ID][0]['name']) - strtotime($item->fields['date']); } + $waitingtime = 0; } if ($totaltime != 0) { - $percentage = round((100 * $currenttime) / $totaltime); + $percentage = round((100 * ($currenttime - $waitingtime)) / ($totaltime - $waitingtime)); } else { // Total time is null : no active time $percentage = 100;