add: more tests

This commit is contained in:
Michael 2024-08-14 12:46:25 +02:00
parent ce7f620984
commit fcd76cf130
11 changed files with 232 additions and 15 deletions

View file

@ -34,10 +34,9 @@ class CsvAgentCost
function calculate_agents_cost(array $array, array $agents_time, float $minute_cost)
{
$minute_cost = utils::round_up_to_two_decimals($minute_cost);
foreach ($agents_time as $name => $agent_time) {
//Identify agents involved in the issue
$agent_cost = utils::round_up_to_two_decimals($agent_time / 60 * $minute_cost);
$agent_cost = utils::round_up_to_two_decimals($agent_time * $minute_cost / 60);
$array[$name] = gmdate('H:i:s', $agent_time);
$array[$name . ' costo'] = $agent_cost;
}