productionScheduler - action time fix
This commit is contained in:
@@ -149,10 +149,15 @@ WHERE ps.deleted = 0 ";
|
||||
$row['action_index'] = $r['action_index'];
|
||||
$row['action_category'] = $app_list_strings['ecmactions_category_dom'][$r['action_category']];
|
||||
|
||||
// check if action_performance is number and is not 0
|
||||
if (is_numeric($r['action_performance']) && $r['action_performance'] != 0) {
|
||||
$timeInHours = $r['scheduledQuantity'] / $r['action_performance'];
|
||||
$hours = floor($timeInHours);
|
||||
$minutes = round(($timeInHours - $hours) * 60);
|
||||
$row['action_time'] = sprintf('%02d:%02d', $hours, $minutes);
|
||||
} else {
|
||||
$row['action_time'] = '---';
|
||||
}
|
||||
|
||||
$data[] = $row;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user