Browse Source

ajustes relatorios

master
Lucas Awade 1 year ago
parent
commit
30e461fd16
  1. 11
      relatorios/pbx/chamadasEntrantes/chamadasEntrantesGeral.php
  2. 17
      relatorios/pbx/chamadasSaintes/saintesGeral.php
  3. 8
      relatorios/pbx/geral/pbxResumoFone.php

11
relatorios/pbx/chamadasEntrantes/chamadasEntrantesGeral.php

@ -188,7 +188,7 @@
$dataRel[] = GenerateCsvFromArray($filtro);
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Tipo', 'Duracao', 'Atendida', 'Fila', 'Agente/Ramal', 'Municipio', 'UF');
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Tipo', 'Duracao', 'Atendida', 'Fila', 'Agente', 'Municipio', 'UF');
$dadosField = array('calldate', 'src', 'dst', 'tplg_descricao', 'tempo_atendimento', 'status', 'fila', 'agente', 'nome_municipio', 'uf');
$dataRel[] = GenerateCsvFromArray(array_keys($dadosCabecalio));
@ -252,7 +252,7 @@
$dataRel[] = $linha;
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Tipo', 'Duracao', 'Atendida', 'Fila', 'Agente/Ramal', 'Municipio', 'UF');
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Tipo', 'Duracao', 'Atendida', 'Fila', 'Agente', 'Municipio', 'UF');
$dadosField = array('calldate', 'src', 'dst', 'tplg_descricao', 'tempo_atendimento', 'status', 'fila', 'agente', 'nome_municipio', 'uf');
/*
@ -304,7 +304,7 @@
'Duração' => 'align="center"',
'Atendida' => 'align="center"',
'Fila' => 'align="left"',
'Agente/Ramal' => 'align="left"',
'Agente' => 'align="left"',
'Município' => 'align="left"',
'UF' => 'align="center"'
);
@ -377,6 +377,9 @@
* Fecha relatorio.
*/
$dataRel[] = '</table>';
$dataRel[] = '<table width="50%">';
$dataRel[] = '<tr><td><b>* CHAMADAS ABANDONADAS OU NÃO ATENDIDAS, NO CAMPO DESTINO SERÁ APRESENTADO O NÚMERO DA FILA!</b></td></tr>';
$dataRel[] = '</table>';
$this->___dataRel[] = $dataRel;
}
@ -415,7 +418,7 @@
'Duração' => 'C',
'Atend.' => 'C',
'Fila' => 'L',
'Agente/Ramal' => 'L',
'Agente' => 'L',
'Município' => 'L',
'UF' => 'C');
$dataHeader = array(

17
relatorios/pbx/chamadasSaintes/saintesGeral.php

@ -132,13 +132,13 @@
$query = sprintf("select a.uniqueid, a.calldate, a.src, a.dst, case when(d.evento = 'ABANDON')then strtoint(d.param3) else a.billsec end as tempo_atendimento, coalesce(d.fila, '-') as fila, coalesce(e.apelido, '-') as agente,
d.evento, case when(tplg_codigo in(33,34))then 'MÓVEL' else c.nome_municipio end as nome_municipio, c.uf, b.tplg_descricao,
case when((d.evento in('COMPLETEAGENT','COMPLETECALLER') and (billsec > 3) ) or ((d.evento is null) and (billsec > 3)))then 'ATENDIDA' else 'N ATENDIDA' end as status
from pbx_bilhetes a
case when((d.evento in('COMPLETAAGENT','COMPLETACALLER') and (billsec > 3) ) or ((d.evento is null) and (billsec > 3)))then 'ATENDIDA' else 'N ATENDIDA' end as status
from pbx_bilhetes a
inner join pbx_tipo_ligacao b on b.tplg_codigo = a.tipo_chamada
inner join pbx_municipios c on c.id = a.id_municipio
left join pbx_eventos_dacs d on d.uid2 = a.uniqueid and d.evento in('COMPLETEAGENT','COMPLETECALLER','ABANDON')
left join pbx_eventos_dacs d on d.uid2 = a.uniqueid and d.evento in('COMPLETAAGENT','COMPLETACALLER','ABANDON')
left join pbx_usuarios e on e.matricula = substring(d.agente,7,4)
where b.tplg_tipo = 3
where b.tplg_tipo = 3
AND a.calldate = (SELECT MAX(calldate) FROM pbx_bilhetes WHERE uniqueid = a.uniqueid)
and a.calldate::timestamp >= '%s'
and a.calldate::timestamp <= '%s'
@ -159,10 +159,10 @@
}
if ($tipoAtendimento == 2) {
$query .= "AND ((d.evento IN('COMPLETEAGENT','COMPLETECALLER') AND (billsec > 3) ) OR ((d.evento is null) AND (billsec > 3)))";
$query .= "AND ((d.evento IN('COMPLETAAGENT','COMPLETACALLER') AND (billsec > 3) ) OR ((d.evento is null) AND (billsec > 3)))";
}
if ($tipoAtendimento == 3) {
$query .= "AND ((d.evento NOT IN('COMPLETEAGENT','COMPLETECALLER')) OR (billsec <= 3))";
$query .= "AND ((d.evento NOT IN('COMPLETAAGENT','COMPLETACALLER')) OR (billsec <= 3))";
}
$query .= " ORDER BY a.calldate";
@ -370,7 +370,6 @@
$row["tempo_atendimento"] = SecondToStrTime($row["tempo_atendimento"]);
$somaQuantidade ++;
// Formata linha de dados.
$linha = "<tr>";
foreach ($dadosField as $key => $value) {
@ -389,6 +388,10 @@
* Fecha relatorio.
*/
$dataRel[] = '</table>';
$dataRel[] = '<table width="50%">';
$dataRel[] = '<tr><td><b>* CHAMADAS ABANDONADAS OU NÃO ATENDIDAS, NO CAMPO DESTINO SERÁ APRESENTADO O NÚMERO DA FILA!</b></td></tr>';
$dataRel[] = '</table>';
$this->___dataRel[] = $dataRel;
}

8
relatorios/pbx/geral/pbxResumoFone.php

@ -221,7 +221,7 @@
$dataRel[] = GenerateCsvFromArray($filtro);
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Status', 'Tempo Espera', 'Tempo Atendimento', 'Tempo Abandono', 'Agente/Ramal', 'Fila', 'Tipo');
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Status', 'Tempo Espera', 'Tempo Atendimento', 'Tempo Abandono', 'Agente', 'Fila', 'Tipo');
$dadosField = array('calldate', 'src', 'dst', 'evento', 'espera', 'billsec', 'tempo_abandon', 'agente', 'fila', 'tplg_descricao');
$dataRel[] = GenerateCsvFromArray($dadosCabecalio);
@ -313,7 +313,7 @@
$dataRel[] = $linha;
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Status', 'Tempo Espera', 'Tempo Atendimento', 'Tempo Abandono', 'Agente/Ramal', 'Fila', 'Tipo');
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Status', 'Tempo Espera', 'Tempo Atendimento', 'Tempo Abandono', 'Agente', 'Fila', 'Tipo');
$dadosField = array('calldate', 'src', 'dst', 'evento', 'espera', 'billsec', 'tempo_abandon', 'agente', 'fila', 'tplg_descricao');
/*
@ -396,7 +396,7 @@
'Tempo Espera' => 'align="center"',
'Tempo Atendimento' => 'align="center"',
'Tempo Abandono' => 'align="center"',
'Agente/Ramal' => 'align="left"',
'Agente' => 'align="left"',
'Fila' => 'align="left"',
'Tipo' => 'align="center"'
);
@ -516,7 +516,7 @@
'Tempo Espera' => 'C',
'Tempo Atendimento' => 'C',
'Tempo Abandono' => 'C',
'Agente/Ramal' => 'C',
'Agente' => 'C',
'Fila' => 'C',
'Tipo' => 'C'
);

Loading…
Cancel
Save