Skip to content

Commit

Permalink
fix(ticket): percentage of resolution time (#15948)
Browse files Browse the repository at this point in the history
* fix(ticket): percentage of resolution time

* cedric
  • Loading branch information
Rom1-B authored Nov 24, 2023
1 parent 558e295 commit 760d96f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down

0 comments on commit 760d96f

Please sign in to comment.