diff --git a/relatorios/callcenter/geral/desempenhoOperacao.php b/relatorios/callcenter/geral/desempenhoOperacao.php index f39b96af..e66cdc56 100644 --- a/relatorios/callcenter/geral/desempenhoOperacao.php +++ b/relatorios/callcenter/geral/desempenhoOperacao.php @@ -251,13 +251,15 @@ $agt_duracaoseg = $data[$row['data']]['tempo_login']; $agt_pausa = $data[$row['data']]['tempo_pausa']; - $livre = $agt_duracaoseg - ($agt_pausa + $tempo_calc); - + $livre = $agt_duracaoseg - ($agt_pausa + $tempo_calc); $row['conexoes'] = ($data[$row['data']]['conexoes'] ? $data[$row['data']]['conexoes'] : 0); - $row['agtAtend'] = $agt_duracaoseg ? round($tempo_calc / ($agt_duracaoseg / 100), 2) : 0; $row['agtLivre'] = $agt_duracaoseg ? round($livre / ($agt_duracaoseg / 100), 2) : 0; $row['agtPausa'] = $agt_duracaoseg ? round($agt_pausa / ($agt_duracaoseg / 100), 2) : 0; + + $residualPercentage = ($row['agtAtend'] + $row['agtLivre'] + $row['agtPausa']) - 100; + $row['agtLivre'] = $this->adjustPercentageResidual($residualPercentage, $row['agtLivre']); + $x++; $linha = array(); foreach ($dadosField as $key) { @@ -357,6 +359,9 @@ $row['agtLivre'] = $agt_duracaoseg ? round($livre / ($agt_duracaoseg / 100), 2) : 0; $row['agtPausa'] = $agt_duracaoseg ? round($agt_pausa / ($agt_duracaoseg / 100), 2) : 0; + $residualPercentage = ($row['agtAtend'] + $row['agtLivre'] + $row['agtPausa']) - 100; + $row['agtLivre'] = $this->adjustPercentageResidual($residualPercentage, $row['agtLivre']); + // Formata linha de dados. $linha = array('DADOS'); foreach ($dadosField as $key) { @@ -511,6 +516,9 @@ $row['agtLivre'] = $agt_duracaoseg ? round($livre / ($agt_duracaoseg / 100), 2) : 0; $row['agtPausa'] = $agt_duracaoseg ? round($agt_pausa / ($agt_duracaoseg / 100), 2) : 0; + $residualPercentage = ($row['agtAtend'] + $row['agtLivre'] + $row['agtPausa']) - 100; + $row['agtLivre'] = $this->adjustPercentageResidual($residualPercentage, $row['agtLivre']); + $linha = "