diff --git a/pom.xml b/pom.xml index d5317c5bb..3eafba0aa 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores ventaboletosadm - 1.55.10 + 1.55.11 war diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosEstoqueAgencia.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosEstoqueAgencia.java index f6c621a5d..0fd033790 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosEstoqueAgencia.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosEstoqueAgencia.java @@ -14,11 +14,9 @@ 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; @@ -35,6 +33,7 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { super(parametros, conexao); this.setCustomDataSource(new ArrayDataSource(this) { + @SuppressWarnings("unused") @Override public void initDados() throws Exception { @@ -44,12 +43,16 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { Integer empresa = (Integer) parametros.get("EMPRESA_ID"); Date datainicial = (Date) parametros.get("DATA_INICIAL"); Date dataFinal = (Date) parametros.get("DATA_FINAL"); + Integer aidfTipoId = (Integer) parametros.get("AIDFTIPO_ID"); - NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql(pnutoVentasIds)); + NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql(pnutoVentasIds, aidfTipoId)); 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"); + if(aidfTipoId != null) { + stmt.setInt("aidfTipo",aidfTipoId); + } ResultSet rset = stmt.executeQuery(); List lsTemp = new ArrayList<>(); @@ -67,7 +70,7 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { bean.setChave(rset.getString("chave")); bean.setFolio(rset.getString("folio")); bean.setNomeEmpresa(rset.getString("nomeEmpresa")); - bean.setTipoEvento("Incluir"); + bean.setTipoEvento(rset.getString("tipoAidf")); lsRelatorioBilhetesVendidosEstoqueAgenciaBean.add(bean); this.dados.add(dataResult); @@ -84,7 +87,7 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { lsTemp.add(i); } } - + for (RelatorioBilhetesVendidosEstoqueAgenciaBean bean : lsTemp) { lsRelatorioBilhetesVendidosEstoqueAgenciaBeanGeradoSequencia.addAll(agruparSequenciasBilhetes(lsTemp)); break; @@ -114,7 +117,7 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { return lsDadosRelatorio; } - private String sql(String puntoVentasId) { + private String sql(String puntoVentasId, Integer aidfTipoId) { StringBuilder sql = new StringBuilder(); @@ -124,21 +127,22 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { 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(" TB.nomeEmpresa as nomeEmpresa , TB.folio as folio, TB.tipoAidf as tipoAidf "); 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(" em.nombEmpresa as nomeEmpresa , c.numfoliopreimpreso as folio, AIT.DESCTIPO tipoAidf "); sql.append(" FROM caja c, "); sql.append(" PUNTO_VENTA PV, "); sql.append(" EMPRESA EM, "); - sql.append(" AIDF AI, "); + sql.append(" AIDF_TIPO AIT, "); + 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(" 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")) { @@ -147,12 +151,13 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { 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(aidfTipoId != null ? " AND (AI.AIDFTIPO_ID =:aidfTipo AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID) " : " AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_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(" em.nombEmpresa, AIT.DESCTIPO "); sql.append(" "); sql.append(" UNION ALL "); sql.append(" SELECT DAB.AIDF_ID AS aidfId, "); @@ -161,31 +166,32 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio { 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(" em.nombEmpresa as nomeEmpresa , c.numfoliopreimpreso as folio, AIT.DESCTIPO tipoAidf "); sql.append(" FROM caja_diversos c, "); sql.append(" PUNTO_VENTA PV, "); sql.append(" EMPRESA EM, "); sql.append(" AIDF AI, "); + sql.append(" AIDF_TIPO AIT, "); 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(" 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 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(aidfTipoId != null ? " AND (AI.AIDFTIPO_ID =:aidfTipo AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID) " : " AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_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(" em.nombEmpresa, AIT.DESCTIPO "); sql.append(" )TB "); - sql.append(" ORDER BY to_number(TB.FOLIO) "); - System.out.println(sql.toString()); + sql.append(" ORDER BY to_number(TB.FOLIO) "); return sql.toString(); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jasper index 73e4ff4df..0da02e2c5 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jrxml index 0d887a7e2..13007a6d6 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBilhetesVendidosEstoqueAgencia.jrxml @@ -1,8 +1,8 @@ - - - + + + @@ -109,11 +109,11 @@ - + - + @@ -123,28 +123,28 @@ - + - + - + - + @@ -177,7 +177,7 @@ - + @@ -192,14 +192,14 @@ - + - + @@ -221,14 +221,14 @@ - + - + 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 index ff5b21f0a..c185a1e2f 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBilhetesVendidosEstoqueAgenciaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBilhetesVendidosEstoqueAgenciaController.java @@ -23,6 +23,7 @@ import org.zkoss.zul.Datebox; import org.zkoss.zul.Paging; import org.zkoss.zul.Radiogroup; +import com.rjconsultores.ventaboletos.entidad.AidfTipo; import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Estado; import com.rjconsultores.ventaboletos.entidad.Moneda; @@ -32,6 +33,7 @@ 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.AidfService; import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EstadoService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; @@ -59,7 +61,6 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaController extends MyGeneric private Datebox datInicial; private Datebox datFinal; private MyComboboxEstandar cmbEmpresa; - private Combobox cmbMoeda; private List lsEmpresa; private List lsEstado; @Autowired @@ -69,6 +70,11 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaController extends MyGeneric private MyListbox puntoVentaList; private MyListbox puntoVentaSelList; private Paging pagingPuntoVenta; + private Combobox cmbAidfTipo; + private List lsAidfTipo; + @Autowired + private AidfService aidfService; + @Override @@ -77,24 +83,10 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaController extends MyGeneric super.doAfterCompose(comp); puntoVentaList.setItemRenderer(new RenderRelatorioVendasBilheteiro()); puntoVentaSelList.setItemRenderer(new RenderRelatorioVendasBilheteiroSelecionados()); - + lsAidfTipo = aidfService.obtenerTodosAdifTipo(); } - 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()); @@ -199,6 +191,14 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaController extends MyGeneric } else { filtro.append(" Todas;"); } + Comboitem cmbItem = cmbAidfTipo.getSelectedItem(); + if (cmbItem != null) { + AidfTipo aidfTipo = (AidfTipo) cmbItem.getValue(); + parametros.put("AIDFTIPO_ID", aidfTipo.getAidftipoId()); + filtro.append(aidfTipo.getDesctipo() + ";"); + } else { + filtro.append(" Todas; "); + } relatorio = new RelatorioBilhetesVendidosEstoqueAgencia(parametros, dataSourceRead.getConnection()); parametros.put("FILTROS", filtro.toString()); @@ -209,5 +209,29 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaController extends MyGeneric openWindow("/component/reportView.zul", Labels.getLabel("relatorioBilhetesVendidosController.window.title"), args, MODAL); } + public List getLsAidfTipo() { + return lsAidfTipo; + } + + public void setLsAidfTipo(List lsAidfTipo) { + this.lsAidfTipo = lsAidfTipo; + } + + 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; + } + } diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index eb78ada9f..b38faa7e8 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -598,7 +598,7 @@ relatorioBilhetesVendidosController.marcado.label = Marcado relatorioBilhetesVendidosController.categoria.label = Categoria # Relatório Bilhetes Vendidos Estoque Agencia -relatorioBilhetesVendidosEstoqueAgenciaController.window.title = Bilhetes Vendidos Estoque Agência +relatorioBilhetesVendidosEstoqueAgenciaController.window.title = Relatório Consumo de Estoque relatorioBilhetesVendidosEstoqueAgenciaController.lbDatInicial.value = Data Inicial relatorioBilhetesVendidosEstoqueAgenciaController.lbDatFinal.value = Data Final relatorioBilhetesVendidosEstoqueAgenciaController.lbDatFinal.value = Data Final diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 61dad3d6b..42be94bd3 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -361,7 +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.mniRelatorioBilhetesVendidosEstoqueAgencia.label = Relatório Consumo de Estoque indexController.mniRelatorioGratuidadeIdosoDeficiente.label = Gratuidades Idoso/Deficiente indexController.mniRelatorioAproveitamentoFinanceiro.label = Aproveitamento Financeiro indexController.mniRelatorioVendasBilheteiro.label = Vendas por Bilheteiro @@ -8439,7 +8439,7 @@ relatorioBilhetesVendidosController.marcado.label = Marcado relatorioBilhetesVendidosController.categoria.label = Categoria # Relatório Bilhetes Vendidos Estoque Agencia -relatorioBilhetesVendidosEstoqueAgenciaController.window.title = Bilhetes Vendidos Estoque Agência +relatorioBilhetesVendidosEstoqueAgenciaController.window.title = Relatório Consumo de Estoque relatorioBilhetesVendidosEstoqueAgenciaController.lbDatInicial.value = Data Inicial relatorioBilhetesVendidosEstoqueAgenciaController.lbDatFinal.value = Data Final relatorioBilhetesVendidosEstoqueAgenciaController.lbDatFinal.value = Data Final diff --git a/web/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul b/web/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul index 42221a695..08ffc74a9 100644 --- a/web/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul +++ b/web/gui/relatorios/filtroRelatorioBilhetesVendidosEstoqueAgencia.zul @@ -6,7 +6,7 @@ @@ -99,27 +99,17 @@ - + + - - - - - - - - - - - - - - - - -