From c709cb7aca3a3089e2e5c15cacf6d1080ec74739 Mon Sep 17 00:00:00 2001 From: "wallace.henrique" Date: Sun, 3 Mar 2024 21:13:41 -0300 Subject: [PATCH] fixes bug#AL-3915 --- pom.xml | 4 +- ...latorioBilhetesVendidosEstoqueAgencia.java | 266 ++++++++++++++++++ ...lhetesVendidosEstoqueAgencia_es.properties | 20 ++ ...tesVendidosEstoqueAgencia_pt_BR.properties | 20 ++ ...torioBilhetesVendidosEstoqueAgencia.jasper | Bin 0 -> 33252 bytes ...atorioBilhetesVendidosEstoqueAgencia.jrxml | 254 +++++++++++++++++ ...rioBilhetesVendidosEstoqueAgenciaBean.java | 111 ++++++++ ...hetesVendidosEstoqueAgenciaController.java | 213 ++++++++++++++ ...latorioBilhetesVendidosEstoqueAgencia.java | 25 ++ .../utilerias/menu/menu_original.properties | 1 + web/WEB-INF/i3-label_es_MX.label | 25 ++ web/WEB-INF/i3-label_pt_BR.label | 25 ++ ...elatorioBilhetesVendidosEstoqueAgencia.zul | 129 +++++++++ 13 files changed, 1091 insertions(+), 2 deletions(-) create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosEstoqueAgencia.java create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_es.properties create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_pt_BR.properties create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jasper create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jrxml create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBilhetesVendidosEstoqueAgenciaBean.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBilhetesVendidosEstoqueAgenciaController.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioBilhetesVendidosEstoqueAgencia.java create mode 100644 web/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul diff --git a/pom.xml b/pom.xml index 8476acbd6..0a9b4db6a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ 4.0.0 br.com.rjconsultores ventaboletosadm - 1.54.9 + 1.55.0 war 1.40.7 - 1.30.1 + 1.31.0 UTF-8 UTF-8 diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosEstoqueAgencia.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosEstoqueAgencia.java new file mode 100644 index 000000000..f6c621a5d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosEstoqueAgencia.java @@ -0,0 +1,266 @@ +/** + * + */ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioBilhetesVendidosEstoqueAgenciaBean; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioIndiceIRKBean; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; + +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; + +/** + * @author Wallace + * + */ +public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { + private List lsDadosRelatorio; + + public RelatorioBilhetesVendidosEstoqueAgencia(Map parametros, Connection conexao) throws Exception { + super(parametros, conexao); + + this.setCustomDataSource(new ArrayDataSource(this) { + @Override + public void initDados() throws Exception { + + Connection conexao = this.relatorio.getConexao(); + Map parametros = this.relatorio.getParametros(); + String pnutoVentasIds = (String) parametros.get("NUMPUNTOVENTA"); + Integer empresa = (Integer) parametros.get("EMPRESA_ID"); + Date datainicial = (Date) parametros.get("DATA_INICIAL"); + Date dataFinal = (Date) parametros.get("DATA_FINAL"); + + NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql(pnutoVentasIds)); + + stmt.setInt("EMPRESA_ID", empresa); + stmt.setString("dataInicio", DateUtil.getStringDate(datainicial, "dd/MM/yyyy") + " 00:00:00"); + stmt.setString("dataFinal", DateUtil.getStringDate(dataFinal, "dd/MM/yyyy") + " 23:59:59"); + + ResultSet rset = stmt.executeQuery(); + List lsTemp = new ArrayList<>(); + List lsRelatorioBilhetesVendidosEstoqueAgenciaBean = new ArrayList<>(); + List lsRelatorioBilhetesVendidosEstoqueAgenciaBeanGeradoSequencia = new ArrayList<>(); + while (rset.next()) { + + Map dataResult = new HashMap(); + + RelatorioBilhetesVendidosEstoqueAgenciaBean bean = new RelatorioBilhetesVendidosEstoqueAgenciaBean(); + bean.setAidfId(rset.getInt("aidfId")); + bean.setNombpuntoventa(rset.getString("descpuntoVenta")); + bean.setSerie(rset.getString("serie")); + bean.setFechorVenta(DateUtil.getDateFromString(rset.getString("dataVenda"), "ddMMyyyy")); + bean.setChave(rset.getString("chave")); + bean.setFolio(rset.getString("folio")); + bean.setNomeEmpresa(rset.getString("nomeEmpresa")); + bean.setTipoEvento("Incluir"); + lsRelatorioBilhetesVendidosEstoqueAgenciaBean.add(bean); + + this.dados.add(dataResult); + + } + + Map map = new HashMap(); + for (RelatorioBilhetesVendidosEstoqueAgenciaBean i : lsRelatorioBilhetesVendidosEstoqueAgenciaBean) { + map.put(i.getChave(), i.getChave()); + } + for (Map.Entry entry : map.entrySet()) { + for (RelatorioBilhetesVendidosEstoqueAgenciaBean i : lsRelatorioBilhetesVendidosEstoqueAgenciaBean) { + if(entry.getKey().equals(i.getChave())) { + lsTemp.add(i); + } + } + + for (RelatorioBilhetesVendidosEstoqueAgenciaBean bean : lsTemp) { + lsRelatorioBilhetesVendidosEstoqueAgenciaBeanGeradoSequencia.addAll(agruparSequenciasBilhetes(lsTemp)); + break; + } + lsTemp = new ArrayList<>(); + } + + Collections.sort(lsRelatorioBilhetesVendidosEstoqueAgenciaBeanGeradoSequencia, new Comparator() { + @Override + public int compare(RelatorioBilhetesVendidosEstoqueAgenciaBean rel1, RelatorioBilhetesVendidosEstoqueAgenciaBean rel2) { + return DateUtil.compareDate(rel1.getFechorVenta(), rel2.getFechorVenta()); + } + }); + + this.resultSet = rset; + setLsDadosRelatorio(lsRelatorioBilhetesVendidosEstoqueAgenciaBeanGeradoSequencia); + } + }); + } + + public void setLsDadosRelatorio(List lsDadosRelatorio) { + this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); + this.lsDadosRelatorio = lsDadosRelatorio; + } + + public List getLsDadosRelatorio() { + return lsDadosRelatorio; + } + + private String sql(String puntoVentasId) { + + StringBuilder sql = new StringBuilder(); + + sql.append(" SELECT TB.aidfId as aidfId, "); + sql.append(" TB.descpuntoVenta as descpuntoVenta, "); + sql.append(" TB.SERIE as serie, "); + sql.append(" TB.puntoventaId, "); + sql.append(" TB.dataVenda as dataVenda, "); + sql.append(" TB.chave as chave, "); + sql.append(" TB.nomeEmpresa as nomeEmpresa , TB.folio as folio "); + sql.append(" FROM (SELECT DAB.AIDF_ID AS aidfId, "); + sql.append(" pv.nombpuntoventa AS descpuntoVenta, "); + sql.append(" c.numseriepreimpresa AS SERIE, "); + sql.append(" c.puntoventa_id AS puntoventaId, "); + sql.append(" to_char(c.fechorventa, 'ddMMyyyy') AS dataVenda, "); + sql.append(" DAB.AIDF_ID || c.numseriepreimpresa || c.puntoventa_id || to_char(c.fechorventa, 'ddMMyyyy') AS chave, "); + sql.append(" em.nombEmpresa as nomeEmpresa , c.numfoliopreimpreso as folio "); + sql.append(" FROM caja c, "); + sql.append(" PUNTO_VENTA PV, "); + sql.append(" EMPRESA EM, "); + sql.append(" AIDF AI, "); + sql.append(" ABASTO_BOLETO AB "); + sql.append(" LEFT JOIN DET_ABASTO_BOLETO DAB ON (AB.ABASTOBOLETO_ID = DAB.ABASTOBOLETO_ID) "); + sql.append(" WHERE fechorventa BETWEEN TO_DATE(:dataInicio,'dd/mm/yyyy hh24:mi:ss') AND TO_DATE(:dataFinal,'dd/mm/yyyy hh24:mi:ss') "); + sql.append(" AND TO_NUMBER(c.NUMFOLIOPREIMPRESO) BETWEEN TO_NUMBER(DAB.NUMFOLIOINICIAL) AND TO_NUMBER(DAB.NUMFOLIOFINAL) "); + sql.append(" AND c.PUNTOVENTA_ID = AB.PUNTOVENTA_ID "); + if (puntoVentasId != null && !puntoVentasId.equals("-1")) { + sql.append(" AND c.PUNTOVENTA_ID in (" + puntoVentasId + ") "); + } + sql.append(" AND EM.EMPRESA_ID = AB.EMPRESA_ID "); + sql.append(" AND c.PUNTOVENTA_ID = PV.PUNTOVENTA_ID "); + sql.append(" AND DAB.AIDF_ID = AI.AIDF_ID "); + sql.append(" AND EM.EMPRESA_ID =:EMPRESA_ID "); + sql.append(" GROUP BY DAB.AIDF_ID,c.numseriepreimpresa, c.numfoliopreimpreso, "); + sql.append(" c.puntoventa_id, "); + sql.append(" to_char(c.fechorventa, 'ddMMyyyy'), "); + sql.append(" pv.nombpuntoventa, "); + sql.append(" em.nombEmpresa "); + sql.append(" "); + sql.append(" UNION ALL "); + sql.append(" SELECT DAB.AIDF_ID AS aidfId, "); + sql.append(" pv.nombpuntoventa AS descpuntoVenta, "); + sql.append(" c.numseriepreimpresa AS SERIE, "); + sql.append(" c.puntoventa_id AS puntoventaId, "); + sql.append(" to_char(c.FECHORVTA, 'ddMMyyyy') AS dataVenda, "); + sql.append(" DAB.AIDF_ID || c.numseriepreimpresa || c.puntoventa_id || to_char(c.FECHORVTA, 'ddMMyyyy') AS chave, "); + sql.append(" em.nombEmpresa as nomeEmpresa , c.numfoliopreimpreso as folio "); + sql.append(" FROM caja_diversos c, "); + sql.append(" PUNTO_VENTA PV, "); + sql.append(" EMPRESA EM, "); + sql.append(" AIDF AI, "); + sql.append(" ABASTO_BOLETO AB "); + sql.append(" LEFT JOIN DET_ABASTO_BOLETO DAB ON (AB.ABASTOBOLETO_ID = DAB.ABASTOBOLETO_ID) "); + sql.append(" WHERE FECHORVTA BETWEEN TO_DATE(:dataInicio,'dd/mm/yyyy hh24:mi:ss') AND TO_DATE(:dataFinal,'dd/mm/yyyy hh24:mi:ss') "); + sql.append(" AND TO_NUMBER(c.NUMFOLIOPREIMPRESO) BETWEEN TO_NUMBER(DAB.NUMFOLIOINICIAL) AND TO_NUMBER(DAB.NUMFOLIOFINAL) "); + sql.append(" AND c.PUNTOVENTA_ID = AB.PUNTOVENTA_ID "); + if (puntoVentasId != null && !puntoVentasId.equals("-1")) { + sql.append(" AND c.PUNTOVENTA_ID in (" + puntoVentasId + ") "); + } + sql.append(" AND EM.EMPRESA_ID = AB.EMPRESA_ID "); + sql.append(" AND c.PUNTOVENTA_ID = PV.PUNTOVENTA_ID "); + sql.append(" AND DAB.AIDF_ID = AI.AIDF_ID "); + sql.append(" AND EM.EMPRESA_ID =:EMPRESA_ID "); + sql.append(" GROUP BY DAB.AIDF_ID,c.numseriepreimpresa, c.numfoliopreimpreso, "); + sql.append(" c.puntoventa_id, "); + sql.append(" to_char(c.FECHORVTA, 'ddMMyyyy'), "); + sql.append(" pv.nombpuntoventa, "); + sql.append(" em.nombEmpresa "); + sql.append(" )TB "); + sql.append(" ORDER BY to_number(TB.FOLIO) "); + System.out.println(sql.toString()); + return sql.toString(); + + + } + + private List agruparSequenciasBilhetes(List lista) { + + + int[] bilhetesInt = new int[lista.size()]; + int i = 0; + + for (RelatorioBilhetesVendidosEstoqueAgenciaBean relatorioBilhetesVendidosEstoqueAgenciaBean : lista) { + bilhetesInt[i] = Integer.parseInt(relatorioBilhetesVendidosEstoqueAgenciaBean.getFolio()); + i++; + } + Arrays.sort(bilhetesInt); + List listaAgrupada = new ArrayList<>(); + + RelatorioBilhetesVendidosEstoqueAgenciaBean bean = lista.get(0); + + bilhetesInt = reajustarPosicaoArray(bilhetesInt.length, bilhetesInt, bilhetesInt[0], 1); + int inicio = bilhetesInt[0]; + int fim = bilhetesInt.length == 1 ? bilhetesInt[0] : bilhetesInt[1]; + + for (int j = 2; j < bilhetesInt.length; ++j) { + if (fim + 1 == bilhetesInt[j]) { + fim++; + } else { + listaAgrupada.add(gerarAgrupamento(inicio, fim, new RelatorioBilhetesVendidosEstoqueAgenciaBean(bean))); + inicio = bilhetesInt[j]; + fim = bilhetesInt[j]; + } + } + + listaAgrupada.add(gerarAgrupamento(inicio, fim, bean)); + + return listaAgrupada; + } + + + private RelatorioBilhetesVendidosEstoqueAgenciaBean gerarAgrupamento(int inicio, int fim, RelatorioBilhetesVendidosEstoqueAgenciaBean bean) { + + RelatorioBilhetesVendidosEstoqueAgenciaBean object = new RelatorioBilhetesVendidosEstoqueAgenciaBean(bean); + + + if (inicio != fim) { + object.setQuantidade((fim-inicio+1)); + object.setFolioInicial(inicio); + object.setFolioFinal(fim); + + } else { + object.setQuantidade(1); + object.setFolioInicial(inicio); + object.setFolioFinal(inicio); + } + return object; + } + private int[] reajustarPosicaoArray(int numero, int arr[],int x, int posicao) + { + int novoArray[] = new int[numero + 1]; + + for (int i = 0; i < numero + 1; i++) { + if (i < posicao - 1) + novoArray[i] = arr[i]; + else if (i == posicao - 1) + novoArray[i] = x; + else + novoArray[i] = arr[i - 1]; + } + return novoArray; + } + + @Override + protected void processaParametros() throws Exception { + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_es.properties new file mode 100644 index 000000000..6128dbef4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_es.properties @@ -0,0 +1,20 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +cabecalho.relatorio=Relatório: +cabecalho.periodo=Período: +cabecalho.periodoA=à +cabecalho.dataHora=Data/Hora: +cabecalho.impressorPor=Impressor por: +cabecalho.pagina=Página +cabecalho.de=de +cabecalho.filtros=Filtros: + +#Labels header +label.aidf=AIDF +label.empresa=Empresa +label.agencia=Agencia +label.serie=Serie +label.bilhete=Bilhetes +label.numeracao=Numeração diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_pt_BR.properties new file mode 100644 index 000000000..6128dbef4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_pt_BR.properties @@ -0,0 +1,20 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +cabecalho.relatorio=Relatório: +cabecalho.periodo=Período: +cabecalho.periodoA=à +cabecalho.dataHora=Data/Hora: +cabecalho.impressorPor=Impressor por: +cabecalho.pagina=Página +cabecalho.de=de +cabecalho.filtros=Filtros: + +#Labels header +label.aidf=AIDF +label.empresa=Empresa +label.agencia=Agencia +label.serie=Serie +label.bilhete=Bilhetes +label.numeracao=Numeração diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jasper new file mode 100644 index 0000000000000000000000000000000000000000..73e4ff4dfabde1ea085ec2518cc54793b8ddbf0a GIT binary patch literal 33252 zcmeHwd7NBDwSQI5)-%(YOfuO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;JetPF)5dLEf;m4CE z{0gRoU%`~{t0yJ=#~8w|$|>PjPfGYzxnYH$9|eVY49oIbb}paA&WEU8#^vnlv+<`wtgJh&_U{b)Mqw>=_=$d_4kjUd3MLXF!ZU z$=>B>VkR5q^?V(l$NTt6d_7;vH}ZZSN1EcB`6j-N5Aq9fcM0Fluj6O)8~LaCt^9nx z1Gzi-MSK^(jPK=_^L_kk2>&$@{_7$9H$eDrg7DuA;r}v({}u@U*C70NLimsUKjA+( z;jb+~`01UGLHPfF)BOBi2>*8>{NIQ0-w)w`5W>F?!hZn5|04+hBM|;aA^cB5_)vk{y#wY{|MoK1H%6{g#XVF{=Y)_{|4cI zAHx3ug#San8I#6szG8l%uY_OXE9ckwD)^1QDt@bPG~eN?;X8ff_%7chzSnmM-{+gk zAM+i?pY%=V&-sqzzwsT*U-Ql2ulr{6cYVk4_k45thrUG+{#gw64MQB*c+b^f{JT5( SHUc;+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBilhetesVendidosEstoqueAgenciaBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBilhetesVendidosEstoqueAgenciaBean.java new file mode 100644 index 000000000..50ef35b41 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBilhetesVendidosEstoqueAgenciaBean.java @@ -0,0 +1,111 @@ +package com.rjconsultores.ventaboletos.relatorios.utilitarios; + +import java.util.Date; + +public class RelatorioBilhetesVendidosEstoqueAgenciaBean { + + private String nombpuntoventa; + private Date fechorVenta; + private Integer quantidade; + private String tipoEvento; + private String serie; + private Integer folioInicial; + private Integer folioFinal; + private Integer aidfId; + private String nomeEmpresa; + private String range; + private String chave; + private String folio; + + + public RelatorioBilhetesVendidosEstoqueAgenciaBean(RelatorioBilhetesVendidosEstoqueAgenciaBean bean) { + this.aidfId = bean.getAidfId(); + this.nombpuntoventa = bean.getNombpuntoventa(); + this.nomeEmpresa = bean.getNomeEmpresa(); + this.tipoEvento = bean.getTipoEvento(); + this.serie = bean.getSerie(); + this.chave = bean.getChave(); + this.range = bean.getRange(); + this.fechorVenta = bean.getFechorVenta(); + + } + + public RelatorioBilhetesVendidosEstoqueAgenciaBean() { + + } + public String getNombpuntoventa() { + return nombpuntoventa; + } + public void setNombpuntoventa(String nombpuntoventa) { + this.nombpuntoventa = nombpuntoventa; + } + public Date getFechorVenta() { + return fechorVenta; + } + public void setFechorVenta(Date fechorVenta) { + this.fechorVenta = fechorVenta; + } + public Integer getQuantidade() { + return quantidade; + } + public void setQuantidade(Integer quantidade) { + this.quantidade = quantidade; + } + public String getTipoEvento() { + return tipoEvento; + } + public void setTipoEvento(String tipoEvento) { + this.tipoEvento = tipoEvento; + } + public String getSerie() { + return serie; + } + public void setSerie(String serie) { + this.serie = serie; + } + public Integer getFolioInicial() { + return folioInicial; + } + public void setFolioInicial(Integer folioInicial) { + this.folioInicial = folioInicial; + } + public Integer getFolioFinal() { + return folioFinal; + } + public void setFolioFinal(Integer folioFinal) { + this.folioFinal = folioFinal; + } + public Integer getAidfId() { + return aidfId; + } + public void setAidfId(Integer aidfId) { + this.aidfId = aidfId; + } + public String getNomeEmpresa() { + return nomeEmpresa; + } + public void setNomeEmpresa(String nomeEmpresa) { + this.nomeEmpresa = nomeEmpresa; + } + public String getRange() { + return range; + } + public void setRange(String range) { + this.range = range; + } + public String getChave() { + return chave; + } + public void setChave(String chave) { + this.chave = chave; + } + + public String getFolio() { + return folio; + } + + public void setFolio(String folio) { + this.folio = folio; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBilhetesVendidosEstoqueAgenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBilhetesVendidosEstoqueAgenciaController.java new file mode 100644 index 000000000..ff5b21f0a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBilhetesVendidosEstoqueAgenciaController.java @@ -0,0 +1,213 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.sql.DataSource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Bandbox; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Radiogroup; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.enums.IndStatusBoleto; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBilhetesVendidos; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBilhetesVendidosEstoqueAgencia; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBilhetesVendidosNovoLayout; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.EstadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioVendasBilheteiro; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioVendasBilheteiroSelecionados; + +@Controller("relatorioBilhetesVendidosEstoqueAgenciaController") +@Scope("prototype") +public class RelatorioBilhetesVendidosEstoqueAgenciaController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + + @Autowired + private DataSource dataSourceRead; + + @Autowired + private EmpresaService empresaService; + + private Datebox datInicial; + private Datebox datFinal; + private MyComboboxEstandar cmbEmpresa; + private Combobox cmbMoeda; + private List lsEmpresa; + private List lsEstado; + @Autowired + private transient PagedListWrapper plwPuntoVenta; + private MyTextbox txtNombrePuntoVenta; + private Bandbox bbPesquisaPuntoVenta; + private MyListbox puntoVentaList; + private MyListbox puntoVentaSelList; + private Paging pagingPuntoVenta; + + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresa = empresaService.obtenerTodos(); + super.doAfterCompose(comp); + puntoVentaList.setItemRenderer(new RenderRelatorioVendasBilheteiro()); + puntoVentaSelList.setItemRenderer(new RenderRelatorioVendasBilheteiroSelecionados()); + + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsEstado() { + return lsEstado; + } + + public void setLsEstado(List lsEstado) { + this.lsEstado = lsEstado; + } + + private void executarPesquisaAgencia() { + HibernateSearchObject puntoVentaBusqueda = new HibernateSearchObject<>(PuntoVenta.class, pagingPuntoVenta.getPageSize()); + + puntoVentaBusqueda.addFilterILike("nombpuntoventa", "%" + txtNombrePuntoVenta.getValue() + "%"); + puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + puntoVentaBusqueda.addSortAsc("nombpuntoventa"); + + puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta); + + if (puntoVentaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("relatorioVendasBilheteiroController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + } + + public void onClick$btnPesquisa(Event ev) { + executarPesquisaAgencia(); + } + + public void onDoubleClick$puntoVentaSelList(Event ev) { + PuntoVenta puntoVenta = (PuntoVenta) puntoVentaSelList.getSelected(); + puntoVentaSelList.removeItem(puntoVenta); + } + + public void onDoubleClick$puntoVentaList(Event ev) { + PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected(); + puntoVentaSelList.addItemNovo(puntoVenta); + } + + public void onClick$btnLimpar(Event ev) { + puntoVentaList.setData(new ArrayList()); + + bbPesquisaPuntoVenta.setText(""); + } + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { + executarRelatorio(false); + } + + public void onClick$btnExecutarRelatorioNovoLayout(Event ev) throws Exception { + executarRelatorio(true); + } + + /** + * @throws Exception + * + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + private void executarRelatorio(boolean novoLayout) throws Exception { + Relatorio relatorio; + Map parametros = new HashMap(); + StringBuilder filtro = new StringBuilder(); + + filtro.append("Agência: "); + String puntoVentaIds = ""; + String puntoVentas = ""; + List lsPuntoVentaSelecionados = new ArrayList(Arrays.asList(puntoVentaSelList.getData())); + if (lsPuntoVentaSelecionados.isEmpty()) { + puntoVentas = "Todas"; + } else { + for (int i = 0; i < lsPuntoVentaSelecionados.size(); i++) { + PuntoVenta puntoVenta = lsPuntoVentaSelecionados.get(i); + puntoVentas = puntoVentas + puntoVenta.getNombpuntoventa() + ","; + + puntoVentaIds = puntoVentaIds + puntoVenta.getPuntoventaId() + ","; + } + + // removendo ultima virgula + puntoVentaIds = puntoVentaIds.substring(0, puntoVentaIds.length() - 1); + puntoVentas = puntoVentas.substring(0, puntoVentas.length() - 1); + parametros.put("NUMPUNTOVENTA", puntoVentaIds); + } + + filtro.append(puntoVentas).append(";"); + + parametros.put("DATA_INICIAL", (java.util.Date) this.datInicial.getValue()); + parametros.put("DATA_FINAL", (java.util.Date) this.datFinal.getValue()); + parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioBilhetesVendidosEstoqueAgenciaController.window.title")); + parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getNombusuario()); + + String status = ""; + + parametros.put("STATUS", status); + + filtro.append(" Empresa: "); + + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { + Empresa empresa = (Empresa) itemEmpresa.getValue(); + parametros.put("EMPRESA_ID", empresa.getEmpresaId()); + parametros.put("EMPRESA", empresa.getNombempresa()); + filtro.append(empresa.getNombempresa() + ";"); + } else { + filtro.append(" Todas;"); + } + + relatorio = new RelatorioBilhetesVendidosEstoqueAgencia(parametros, dataSourceRead.getConnection()); + parametros.put("FILTROS", filtro.toString()); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", Labels.getLabel("relatorioBilhetesVendidosController.window.title"), args, MODAL); + } + +} + diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioBilhetesVendidosEstoqueAgencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioBilhetesVendidosEstoqueAgencia.java new file mode 100644 index 000000000..cb2f68069 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioBilhetesVendidosEstoqueAgencia.java @@ -0,0 +1,25 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuRelatorioBilhetesVendidosEstoqueAgencia extends DefaultItemMenuSistema { + + public ItemMenuRelatorioBilhetesVendidosEstoqueAgencia() { + super("indexController.mniRelatorioBilhetesVendidosEstoqueAgencia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOBILHETESVENDIDOSESTOQUEAGENCIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul", + Labels.getLabel("relatorioBilhetesVendidosEstoqueAgenciaController.window.title"), getArgs() ,desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties index 48c75451a..9a8926c47 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties @@ -184,6 +184,7 @@ analitico.gerenciais.operacionais.linhasHorario=com.rjconsultores.ventaboletos.w analitico.gerenciais.operacionais.demandas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioDemandas analitico.gerenciais.operacionais.embarqueLocalidade=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioEmbarqueLocalidade analitico.gerenciais.operacionais.remarcacaoTransferencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioRemarcacaoPassagensTransferencia +analitico.gerenciais.operacionais.bilhetesVendidosEstoqueAgencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioBilhetesVendidosEstoqueAgencia analitico.gerenciais.estatisticos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.estatisticos.SubMenuRelatorioEstatisticos analitico.gerenciais.estatisticos.quadroDemonstrativoPassageiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioQuadroDemonstrativoMovimentoPassageiros analitico.gerenciais.estatisticos.receitaLinhaOperacional=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioLinhaOperacional diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 2d0636668..a4ba6b581 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -593,6 +593,31 @@ relatorioBilhetesVendidosController.reimpresso.label = Reimpresso relatorioBilhetesVendidosController.marcado.label = Marcado relatorioBilhetesVendidosController.categoria.label = Categoria +# Relatório Bilhetes Vendidos Estoque Agencia +relatorioBilhetesVendidosEstoqueAgenciaController.window.title = Bilhetes Vendidos Estoque Agência +relatorioBilhetesVendidosEstoqueAgenciaController.lbDatInicial.value = Data Inicial +relatorioBilhetesVendidosEstoqueAgenciaController.lbDatFinal.value = Data Final +relatorioBilhetesVendidosEstoqueAgenciaController.lbDatFinal.value = Data Final +relatorioBilhetesVendidosEstoqueAgenciaController.lbEmpresa.value = Empresa +relatorioBilhetesVendidosEstoqueAgenciaController.lbPuntoVenta.value = Agência +relatorioBilhetesVendidosEstoqueAgenciaController.lbEstado.value = Estado +relatorioBilhetesVendidosEstoqueAgenciaController.lbStatus.value = Status +relatorioBilhetesVendidosEstoqueAgenciaController.lbNumero.value = Número +relatorioBilhetesVendidosEstoqueAgenciaController.vendido.label = Vendido +relatorioBilhetesVendidosEstoqueAgenciaController.cancelado.label = Cancelado +relatorioBilhetesVendidosEstoqueAgenciaController.IdaVolta.label = Ida/Volta +relatorioBilhetesVendidosEstoqueAgenciaController.dataVenda.label = Data Venda +relatorioBilhetesVendidosEstoqueAgenciaController.dataEmissao.label = Data Emissão +relatorioBilhetesVendidosEstoqueAgenciaController.dataViagem.label = Data Viagem +relatorioBilhetesVendidosEstoqueAgenciaController.transferido.label = Transferido +relatorioBilhetesVendidosEstoqueAgenciaController.entregue.label = Entregue +relatorioBilhetesVendidosEstoqueAgenciaController.reservado.label = Reservado +relatorioBilhetesVendidosEstoqueAgenciaController.extravidado.label = Extraviado +relatorioBilhetesVendidosEstoqueAgenciaController.reimpresso.label = Reimpresso +relatorioBilhetesVendidosEstoqueAgenciaController.marcado.label = Marcado +relatorioBilhetesVendidosEstoqueAgenciaController.categoria.label = Categoria + + # Relatório Recarga Rvhub indexController.mniRelatorioRecargaRvhub.label = Recarga Rvhub relatorioRecargaRvhubController.window.title = Recarga Rvhub diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 4e7fc71fc..5cdd3f498 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -361,6 +361,7 @@ indexController.mniRelatorioPassagensAGER.label = Relatório Passagens AGER indexController.mniRelatorioGratuidadeAGEPAN.label = Gratuidades AGEPAN indexController.mniRelatorioOperacionalFinanceiro.label = Relatório Operacional Financeiro indexController.mniRelatorioBilhetesVendidos.label = Bilhetes Vendidos +indexController.mniRelatorioBilhetesVendidosEstoqueAgencia.label = Bilhetes Vendidos Estoque Agencia indexController.mniRelatorioGratuidadeIdosoDeficiente.label = Gratuidades Idoso/Deficiente indexController.mniRelatorioAproveitamentoFinanceiro.label = Aproveitamento Financeiro indexController.mniRelatorioVendasBilheteiro.label = Vendas por Bilheteiro @@ -8432,6 +8433,30 @@ relatorioBilhetesVendidosController.reimpresso.label = Reimpresso relatorioBilhetesVendidosController.marcado.label = Marcado relatorioBilhetesVendidosController.categoria.label = Categoria +# Relatório Bilhetes Vendidos Estoque Agencia +relatorioBilhetesVendidosEstoqueAgenciaController.window.title = Bilhetes Vendidos Estoque Agência +relatorioBilhetesVendidosEstoqueAgenciaController.lbDatInicial.value = Data Inicial +relatorioBilhetesVendidosEstoqueAgenciaController.lbDatFinal.value = Data Final +relatorioBilhetesVendidosEstoqueAgenciaController.lbDatFinal.value = Data Final +relatorioBilhetesVendidosEstoqueAgenciaController.lbEmpresa.value = Empresa +relatorioBilhetesVendidosEstoqueAgenciaController.lbPuntoVenta.value = Agência +relatorioBilhetesVendidosEstoqueAgenciaController.lbEstado.value = Estado +relatorioBilhetesVendidosEstoqueAgenciaController.lbStatus.value = Status +relatorioBilhetesVendidosEstoqueAgenciaController.lbNumero.value = Número +relatorioBilhetesVendidosEstoqueAgenciaController.vendido.label = Vendido +relatorioBilhetesVendidosEstoqueAgenciaController.cancelado.label = Cancelado +relatorioBilhetesVendidosEstoqueAgenciaController.IdaVolta.label = Ida/Volta +relatorioBilhetesVendidosEstoqueAgenciaController.dataVenda.label = Data Venda +relatorioBilhetesVendidosEstoqueAgenciaController.dataEmissao.label = Data Emissão +relatorioBilhetesVendidosEstoqueAgenciaController.dataViagem.label = Data Viagem +relatorioBilhetesVendidosEstoqueAgenciaController.transferido.label = Transferido +relatorioBilhetesVendidosEstoqueAgenciaController.entregue.label = Entregue +relatorioBilhetesVendidosEstoqueAgenciaController.reservado.label = Reservado +relatorioBilhetesVendidosEstoqueAgenciaController.extravidado.label = Extraviado +relatorioBilhetesVendidosEstoqueAgenciaController.reimpresso.label = Reimpresso +relatorioBilhetesVendidosEstoqueAgenciaController.marcado.label = Marcado +relatorioBilhetesVendidosEstoqueAgenciaController.categoria.label = Categoria + # Relatório Recarga Rvhub indexController.mniRelatorioRecargaRvhub.label = Recarga Rvhub relatorioRecargaRvhubController.window.title = Recarga Rvhub diff --git a/web/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul b/web/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul new file mode 100644 index 000000000..42221a695 --- /dev/null +++ b/web/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +