From 91a48ad31367bfeda10ac50a09d9bf7155f166a3 Mon Sep 17 00:00:00 2001 From: bruno Date: Sun, 18 Aug 2024 17:53:39 -0400 Subject: [PATCH] =?UTF-8?q?relat=C3=B3rio=20para=20multiempresa=20Chamada?= =?UTF-8?q?=20Desligadas=20A/B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- relatorios/callcenter/geral/relDesligamento.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/relatorios/callcenter/geral/relDesligamento.php b/relatorios/callcenter/geral/relDesligamento.php index e47e560a..6e7774da 100644 --- a/relatorios/callcenter/geral/relDesligamento.php +++ b/relatorios/callcenter/geral/relDesligamento.php @@ -5,9 +5,11 @@ private $___duracao; private $___agente; + private $___tipoRelatorio; public function __construct($idProg, $dbcon, $incDac) { parent::__construct($idProg, $dbcon, $incDac); + $this->___tipoRelatorio = isset($_REQUEST['tipoRelatorio']) ? $_REQUEST['tipoRelatorio'] : 0; $this->___duracao = isset($_REQUEST['duracao']) ? $_REQUEST['duracao'] : ''; $this->___dac = isset($_POST['listaDacs']) ? $_POST['listaDacs'] : 0; $this->___agente = isset($_POST["listaAgente"]) ? $_POST["listaAgente"] : 0; @@ -104,12 +106,13 @@ CASE WHEN(b.evento IN('COMPLETECALLER', 'COMPLETEAGENTRAMAL'))THEN 'A' ELSE 'B' END AS desligado_por, CASE WHEN(b.evento IN('COMPLETEAGENT', 'COMPLETECALLER', 'TRANSFER'))THEN 'F' ELSE 'R' END AS tipo_ligacao FROM pbx_bilhetes a - INNER JOIN pbx_eventos_dacs b ON b.uid2 = a.uniqueid - INNER JOIN pbx_dacs c ON c.nome = b.fila + INNER JOIN pbx_eventos_dacs b ON b.uid2 = a.uniqueid AND b.org_id = a.org_id + INNER JOIN pbx_dacs c ON c.nome = b.fila AND c.org_id = b.org_id INNER JOIN pbx_usuarios d ON d.matricula = substring(b.agente, 7, 4) AND calldate::date >= '%s' AND calldate::date <= '%s' AND c.id = %s + AND a.org_id = %d AND b.evento in('COMPLETEAGENT', 'COMPLETECALLER', 'TRANSFER','COMPLETEAGENTRAMAL','COMPLETECALLERRAMAL') "; if ($agente) { @@ -119,7 +122,7 @@ $query .= "AND CASE WHEN(b.param2 <> '' AND length(b.param2)::INT <= 5)THEN b.param2::INT ELSE 0 END <= $duracao"; } $query .= "ORDER BY calldate"; - $sqlQuery = sprintf($query, $dataIni, $dataFim, $dac); + $sqlQuery = sprintf($query, $dataIni, $dataFim, $dac, $this->GetOrgId()); $result = $this->___GetQuery($sqlQuery); $row = pg_fetch_all($result);