diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoVendaOrgaoConcedente.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoVendaOrgaoConcedente.java new file mode 100644 index 000000000..5c7d73dff --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoVendaOrgaoConcedente.java @@ -0,0 +1,158 @@ +/** + * + */ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioResumoVendaOrgaoConcedenteBean; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; + +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; + +/** + * @author Wallace + * + */ +public class RelatorioResumoVendaOrgaoConcedente extends Relatorio { + + public RelatorioResumoVendaOrgaoConcedente(Map parametros, Connection conexao) throws Exception { + super(parametros, conexao); + } + + private List lsDadosRelatorio; + + @Override + protected void processaParametros() throws Exception { + + this.setCustomDataSource(new ArrayDataSource(this) { + @Override + public void initDados() throws Exception { + + Connection conexao = this.relatorio.getConexao(); + Map parametros = this.relatorio.getParametros(); + + StringBuilder sb = new StringBuilder(); + + sb.append("SELECT "); + sb.append(" CAJA.PONTOVENTA,"); + sb.append(" COALESCE(SUM(CASE WHEN CAJA.ORGAOCONCEDENTEID IN(3) THEN CAJA.IMPORTE END), 0) AS ANTT,"); + sb.append(" COALESCE(SUM(CASE WHEN CAJA.ORGAOCONCEDENTEID IN(27) THEN CAJA.IMPORTE END), 0) AS AGERBA, "); + sb.append(" COALESCE(SUM(CASE WHEN CAJA.FORMAPAGO IN(2) THEN CAJA.IMPORTE END), 0) AS CARTAO,"); + sb.append(" COALESCE(SUM(CASE WHEN CAJA.FORMAPAGO IN(1, 3) THEN CAJA.IMPORTE END), 0) AS AVISTA,"); + sb.append(" COALESCE(SUM(CAJA.IMPORTE - (CAJA.IMPORTE * COALESCE(CAJA.porcredbaseicms / 100,0))) , 0) AS VALORBASECALCULO, "); + sb.append(" SUM(CAJA.IMPORTE) AS ISENTO, "); + sb.append(" CAJA.NOMECLASSE AS NOMECLASSE, "); + sb.append(" CAJA.NOMEESTADO AS NOMEESTADO "); + sb.append("FROM "); + sb.append(" (SELECT PV.NOMBPUNTOVENTA AS PONTOVENTA,"); + sb.append(" OC.DESCORGAO AS ORGAO,"); + sb.append(" OC.ORGAOCONCEDENTE_ID AS ORGAOCONCEDENTEID,"); + sb.append(" CASE WHEN C.MOTIVOCANCELACION_ID IS NULL THEN CFP.IMPORTE ELSE 0 END AS IMPORTE, "); + sb.append(" FP.FORMAPAGO_ID AS FORMAPAGO,"); + sb.append(" EI.porcredbaseicms,"); + sb.append(" EST.NOMBESTADO AS NOMEESTADO, "); + sb.append(" CS.DESCCLASE AS NOMECLASSE "); + sb.append(" "); + sb.append(" FROM CAJA C"); + sb.append(" INNER JOIN CAJA_FORMAPAGO CFP ON (C.CAJA_ID = CFP.CAJA_ID AND CFP.ACTIVO = 1)"); + sb.append(" INNER JOIN FORMA_PAGO FP ON (FP.FORMAPAGO_ID = CFP.FORMAPAGO_ID)"); + sb.append(" INNER JOIN PUNTO_VENTA PV ON C.PUNTOVENTA_ID = PV.PUNTOVENTA_ID"); + sb.append(" INNER JOIN MARCA M ON M.MARCA_ID = C.MARCA_ID"); + sb.append(" INNER JOIN RUTA R ON (C.RUTA_ID = R.RUTA_ID)"); + sb.append(" INNER JOIN ORGAO_CONCEDENTE OC ON (R.ORGAOCONCEDENTE_ID = OC.ORGAOCONCEDENTE_ID)"); + sb.append(" INNER JOIN empresa_imposto ei on ei.empresa_id = c.empresacorrida_id"); + sb.append(" "); + sb.append(" INNER JOIN PARADA ORI ON C.ORIGEN_ID = ORI.PARADA_ID"); + sb.append(" INNER JOIN CIUDAD CO ON CO.CIUDAD_ID = ORI.CIUDAD_ID"); + sb.append(" INNER JOIN ESTADO EST ON EST.ESTADO_ID = CO.ESTADO_ID "); + sb.append(" INNER JOIN CLASE_SERVICIO CS ON (C.CLASESERVICIO_ID = CS.CLASESERVICIO_ID ) "); + sb.append(" WHERE C.ACTIVO = 1"); + sb.append(" and C.FECHORVENTA >= :DATA_INICIAL "); + sb.append(" and C.FECHORVENTA <= :DATA_FINAL "); + sb.append(" AND C.TIPOVENTA_ID <> 6"); + sb.append(" AND C.INDREIMPRESION = 0"); + + if (parametros.get("NUMPUNTOVENTA") != null && !parametros.get("NUMPUNTOVENTA").equals("-1")) { + sb.append(" and C.PUNTOVENTA_ID IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")"); + } + if (parametros.get("ESTADOS_ID") != null && !parametros.get("ESTADOS_ID").equals("-1")) { + sb.append(" and EST.estado_id in (" + parametros.get("ESTADOS_ID").toString() + ")"); + } + if (parametros.get("EMPRESA_ID") != null && !parametros.get("EMPRESA_ID").equals("-1")) { + sb.append(" and M.EMPRESA_ID IN (" + parametros.get("EMPRESA_ID").toString() + ")"); + } + if (parametros.get("CLASESERVICIO_ID") != null && !parametros.get("CLASESERVICIO_ID").toString().equals("-1")) { + sb.append(" AND C.CLASESERVICIO_ID = " + parametros.get("CLASESERVICIO_ID").toString() + " "); + } + sb.append(" ) CAJA "); + sb.append(" GROUP BY CAJA.PONTOVENTA, CAJA.NOMEESTADO, CAJA.NOMECLASSE "); + sb.append(" ORDER BY CAJA.NOMEESTADO, CAJA.PONTOVENTA, CAJA.NOMECLASSE "); + + NamedParameterStatement stmt = new NamedParameterStatement(conexao, sb.toString()); + + + stmt.setTimestamp("DATA_INICIAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime())); + stmt.setTimestamp("DATA_FINAL", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime())); + + ResultSet rset = stmt.executeQuery(); + rset.setFetchSize(1000); + + lsDadosRelatorio = new ArrayList(); + DecimalFormat df = new DecimalFormat("0.00"); + df.setMaximumFractionDigits(2); + df.setRoundingMode(RoundingMode.DOWN); + + while (rset.next()) { + + RelatorioResumoVendaOrgaoConcedenteBean bean = new RelatorioResumoVendaOrgaoConcedenteBean(); + + bean.setAgencia(StringUtils.defaultString(rset.getString("PONTOVENTA"))); + bean.setANTT(getValor("ANTT", rset)); + bean.setAGERBA(getValor("AGERBA", rset)); + bean.setCartao(getValor("CARTAO", rset)); + bean.setAVista(getValor("AVISTA", rset)); + bean.setIsento(getValor("ISENTO", rset)); + bean.setValorBaseCalculo(getValor("VALORBASECALCULO", rset)); + bean.setNomeEstado(StringUtils.defaultString(rset.getString("NOMEESTADO"))); + bean.setNomeClasse(StringUtils.defaultString(rset.getString("NOMECLASSE"))); + + lsDadosRelatorio.add(bean); + + } + + if (lsDadosRelatorio.size() > 0) { + setLsDadosRelatorio(lsDadosRelatorio); + } + } + }); + } + + private BigDecimal getValor(String campo, ResultSet resultSet) throws SQLException { + if (resultSet.getObject(campo) == null) { + return BigDecimal.ZERO; + } + return new BigDecimal(resultSet.getString(campo)); + } + + public void setLsDadosRelatorio(List lsDadosRelatorio) { + this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); + this.lsDadosRelatorio = lsDadosRelatorio; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoVendaOrgaoConcedente_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoVendaOrgaoConcedente_es.properties new file mode 100644 index 000000000..84c1644ce --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoVendaOrgaoConcedente_es.properties @@ -0,0 +1,26 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +label.titulo=Relatório Resumo Venda por Órgão Concedente +label.periodoVenda=Data Venda: +label.periodoA=à +label.periodo=Período +label.dataHora=Data/Hora: +label.impressorPor=Impressor por: +label.pagina=Página +label.de=de +label.filtros=Filtros: +header.filtro.total=Total Geral: + +label.agencia=Agência +label.ANTT=ANTT +label.AGERBA=AGERBA +label.cartao=Cartão +label.avista=À Vista +label.isento=Isento +label.valorBaseCalculo=Valor Base Cálculo +label.total=Total +label.nomeEstado=Estado: +label.nomeClasse=Classe +label.totalGeral=Total Geral diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoVendaOrgaoConcedente_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoVendaOrgaoConcedente_pt_BR.properties new file mode 100644 index 000000000..84c1644ce --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoVendaOrgaoConcedente_pt_BR.properties @@ -0,0 +1,26 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +label.titulo=Relatório Resumo Venda por Órgão Concedente +label.periodoVenda=Data Venda: +label.periodoA=à +label.periodo=Período +label.dataHora=Data/Hora: +label.impressorPor=Impressor por: +label.pagina=Página +label.de=de +label.filtros=Filtros: +header.filtro.total=Total Geral: + +label.agencia=Agência +label.ANTT=ANTT +label.AGERBA=AGERBA +label.cartao=Cartão +label.avista=À Vista +label.isento=Isento +label.valorBaseCalculo=Valor Base Cálculo +label.total=Total +label.nomeEstado=Estado: +label.nomeClasse=Classe +label.totalGeral=Total Geral diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoVendaOrgaoConcedente.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoVendaOrgaoConcedente.jasper new file mode 100644 index 000000000..893cdb3d9 Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoVendaOrgaoConcedente.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoVendaOrgaoConcedente.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoVendaOrgaoConcedente.jrxml new file mode 100644 index 000000000..9c2e863f4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoVendaOrgaoConcedente.jrxml @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioResumoVendaOrgaoConcedenteBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioResumoVendaOrgaoConcedenteBean.java new file mode 100644 index 000000000..303144307 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioResumoVendaOrgaoConcedenteBean.java @@ -0,0 +1,97 @@ +package com.rjconsultores.ventaboletos.relatorios.utilitarios; + +import java.math.BigDecimal; + +public class RelatorioResumoVendaOrgaoConcedenteBean { + + private BigDecimal aVista; + private BigDecimal cartao; + private BigDecimal AGERBA; + private BigDecimal valorBaseCalculo; + private BigDecimal isento; + private BigDecimal ANTT; + private String nomeEstado; + private String agencia; + private String nomeClasse; + + public BigDecimal getAVista() { + return aVista; + } + + public void setAVista(BigDecimal aVista) { + this.aVista = aVista; + } + + public BigDecimal getCartao() { + return cartao; + } + + public void setCartao(BigDecimal cartao) { + this.cartao = cartao; + } + + public BigDecimal getAGERBA() { + return AGERBA; + } + + public void setAGERBA(BigDecimal aGERBA) { + AGERBA = aGERBA; + } + + public BigDecimal getValorBaseCalculo() { + return valorBaseCalculo; + } + + public void setValorBaseCalculo(BigDecimal valorBaseCalculo) { + this.valorBaseCalculo = valorBaseCalculo; + } + + public BigDecimal getANTT() { + return ANTT; + } + + public void setANTT(BigDecimal aNTT) { + ANTT = aNTT; + } + + public String getNomeEstado() { + return nomeEstado; + } + + public void setNomeEstado(String nomeEstado) { + this.nomeEstado = nomeEstado; + } + + public String getAgencia() { + return agencia; + } + + public void setAgencia(String agencia) { + this.agencia = agencia; + } + + public BigDecimal getIsento() { + return isento; + } + + public void setIsento(BigDecimal isento) { + this.isento = isento; + } + + public BigDecimal getaVista() { + return aVista; + } + + public void setaVista(BigDecimal aVista) { + this.aVista = aVista; + } + + public String getNomeClasse() { + return nomeClasse; + } + + public void setNomeClasse(String nomeClasse) { + this.nomeClasse = nomeClasse; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioResumoVendaOrgaoConcedenteController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioResumoVendaOrgaoConcedenteController.java new file mode 100644 index 000000000..59a207390 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioResumoVendaOrgaoConcedenteController.java @@ -0,0 +1,339 @@ +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.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioResumoVendaOrgaoConcedente; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.EstadoService; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandarEmpresaUsuario; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEstadoUf; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioVendasBilheteiro; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioVendasBilheteiroSelecionados; + +@Controller("relatorioResumoVendaOrgaoConcedenteController") +@Scope("prototype") +public class RelatorioResumoVendaOrgaoConcedenteController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + + private Datebox dtInicio; + private Datebox dtFim; + private MyComboboxEstandarEmpresaUsuario cmbEmpresa; + private Combobox cmbPuntoVenta; + private MyListbox estadoList; + private MyListbox puntoVentaList; + private Textbox txtNombrePuntoVenta; + private Paging pagingPuntoVenta; + private Bandbox bbPesquisaPuntoVenta; + private List lsEmpresa; + private List lsEstado; + @Autowired + private transient PagedListWrapper plwPuntoVenta; + private MyListbox puntoVentaSelList; + @Autowired + private DataSource dataSourceRead; + @Autowired + private EmpresaService empresaService; + @Autowired + private EstadoService estadoService; + @Autowired + private ClaseServicioService claseServicioService; + private MyComboboxEstandar cmbClasseServicio; + private List lsClasseServico; + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresa = empresaService.obtenerTodos(); + lsEstado = estadoService.obtenerTodos(); + super.doAfterCompose(comp); + + estadoList.setItemRenderer(new RenderEstadoUf()); + estadoList.setData(lsEstado); + puntoVentaList.setItemRenderer(new RenderRelatorioVendasBilheteiro()); + puntoVentaSelList.setItemRenderer(new RenderRelatorioVendasBilheteiroSelecionados()); + lsClasseServico = claseServicioService.obtenerTodos(); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + private void executarRelatorio() throws Exception { + 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(";"); + + if (!validar()) { + return; + } + + if (dtInicio.getValue() != null && dtFim.getValue() != null) { + filtro.append("Data: ") + .append(DateUtil.getStringDate(dtInicio.getValue(), "dd/MM/yyyy")) + .append(" - ") + .append(DateUtil.getStringDate(dtFim.getValue(), "dd/MM/yyyy")) + .append(";"); + parametros.put("DATA_INICIAL", (java.util.Date) dtInicio.getValue()); + parametros.put("DATA_FINAL", (java.util.Date) dtFim.getValue()); + } + + + parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioResumoVendaOrgaoConcedenteController.window.title")); + parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString()); + parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario()); + + filtro.append("UF: "); + String estadosIds = ""; + String UFs = ""; + List lsEstadosSelecionados = estadoList.getItensSelecionados(); + + if (!lsEstadosSelecionados.isEmpty()) { + for (int i = 0; i < lsEstadosSelecionados.size(); i++) { + Estado estado = (Estado) lsEstadosSelecionados.get(i); + UFs = UFs + estado.getCveestado() + ","; + estadosIds = estadosIds + estado.getEstadoId() + ","; + } + + estadosIds = estadosIds.substring(0, estadosIds.length() - 1); + UFs = UFs.substring(0, UFs.length() - 1); + parametros.put("ESTADOS_ID", estadosIds); + } else { + filtro.append("Todos "); + } + + filtro.append(UFs).append(";"); + + filtro.append("Empresa: "); + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { + Empresa empresa = (Empresa) itemEmpresa.getValue(); + parametros.put("EMPRESA_ID", empresa.getEmpresaId()); + filtro.append(empresa.getNombempresa()).append(";"); + } else { + filtro.append(" Todas; "); + } + + Comboitem itemClasseServico = cmbClasseServicio.getSelectedItem(); + if (itemClasseServico != null) { + ClaseServicio claseServicio = (ClaseServicio) itemClasseServico.getValue(); + parametros.put("CLASESERVICIO_ID", claseServicio.getClaseservicioId()); + filtro.append(claseServicio.getDescclase()).append(";"); + } else { + filtro.append(" Todas; "); + } + + parametros.put("FILTROS", filtro.toString()); + + Relatorio relatorio = new RelatorioResumoVendaOrgaoConcedente(parametros, dataSourceRead.getConnection()); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("relatorioBPeController.window.title"), args, MODAL); + } + + private boolean validar() { + try { + + if (dtInicio.getValue() == null || dtFim.getValue() == null) { + Messagebox.show(Labels.getLabel("relatorioBPeController.MSG.informarData"), + Labels.getLabel("relatorioBPeController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + + if(dtInicio.getValue().after(dtFim.getValue())){ + Messagebox.show(Labels.getLabel("relatorioBPeController.MSG.dataInicialMaiorQueFinal"), + Labels.getLabel("relatorioBPeController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + + + } catch (InterruptedException ex) { + return false; + } + return true; + } + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { + executarRelatorio(); + } + + private void executarPesquisa() { + 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) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + executarPesquisa(); + } + + 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 Datebox getDtInicio() { + return dtInicio; + } + + public void setDtInicio(Datebox dtInicio) { + this.dtInicio = dtInicio; + } + + public Datebox getDtFim() { + return dtFim; + } + + public void setDtFim(Datebox dtFim) { + this.dtFim = dtFim; + } + + public MyComboboxEstandar getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(MyComboboxEstandarEmpresaUsuario cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(Combobox cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + + public MyListbox getEstadoList() { + return estadoList; + } + + public void setEstadoList(MyListbox estadoList) { + this.estadoList = estadoList; + } + + 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; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public DataSource getDataSourceRead() { + return dataSourceRead; + } + + public void setDataSourceRead(DataSource dataSourceRead) { + this.dataSourceRead = dataSourceRead; + } + + public EstadoService getEstadoService() { + return estadoService; + } + + public void setEstadoService(EstadoService estadoService) { + this.estadoService = estadoService; + } + public List getLsClasseServico() { + return lsClasseServico; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioResumoVendaOrgaoConcedente.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioResumoVendaOrgaoConcedente.java new file mode 100644 index 000000000..3cf06c11b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioResumoVendaOrgaoConcedente.java @@ -0,0 +1,24 @@ +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 ItemMenuRelatorioResumoVendaOrgaoConcedente extends DefaultItemMenuSistema { + + public ItemMenuRelatorioResumoVendaOrgaoConcedente() { + super("indexController.mniRelatorioResumoVendaOrgaoConcedente.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RESUMOVENDAORGAOCONCEDENTE"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioResumoVendaOrgaoConcedente.zul", Labels.getLabel("relatorioResumoVendaOrgaoConcedenteController.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 01b645fe3..4395f5230 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 @@ -220,6 +220,7 @@ analitico.gerenciais.financeiro.vendasConexao=com.rjconsultores.ventaboletos.web analitico.gerenciais.financeiro.vendasRequisicao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasRequisicao analitico.gerenciais.financeiro.aproveitamentoFinanceiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAproveitamentoFinanceiro analitico.gerenciais.financeiro.relatorioOperacionalFinanceiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioCaixaOrgaoConcedente +analitico.gerenciais.financeiro.relatorioResumoVendaOrgaoConcedente=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioResumoVendaOrgaoConcedente analitico.gerenciais.pacote=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.pacote.SubMenuRelatorioPacote analitico.gerenciais.pacote.boletos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesBoletos analitico.gerenciais.pacote.detalhado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesDetalhado diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 8f3e6a1c1..6379b789d 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -8242,6 +8242,19 @@ relatorioBPeController.lbAlias.value = ALIAS Origen / Destino de boletos relatorioBPeController.MSG.informarData = Favor informar data inicial e final. relatorioBPeController.MSG.dataInicialMaiorQueFinal = Data de inicio não pode ser maior do que a final. + +#Relatorio Resumo Venda por Orgao Concedente +relatorioResumoVendaOrgaoConcedenteController.window.title = Relatorio Resumo Venda por Orgao Concedente +relatorioResumoVendaOrgaoConcedenteController.lbEmpresa.value = Empresa +relatorioResumoVendaOrgaoConcedenteController.lbDtInicio.value = Data Inicio Venda +relatorioResumoVendaOrgaoConcedenteController.lbDtFim.value = Data Fim Venda +relatorioResumoVendaOrgaoConcedenteController.lbUF.value = UF +indexController.mniRelatorioResumoVendaOrgaoConcedente.label= Relatorio Resumo Venda Órgao Concedente +relatorioResumoVendaOrgaoConcedenteController.lbPuntoVenta.value=Agência +relatorioResumoVendaOrgaoConcedenteController.btnPesquisa.label=Pesquisar +relatorioResumoVendaOrgaoConcedenteController.btnLimpar.label=Limpar +relatorioResumoVendaOrgaoConcedenteController.lbClasse.value = Classe + # Dispositivo Venda Embarcada dispositivoVendaEmbarcadaController.window.title = Dispositivo Venda Embarcada editarDispositivoVendaEmbarcadaController.window.title = Cadastro de Dispositivo Venda Embarcada diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index a6043219b..5082034c4 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -8812,6 +8812,22 @@ relatorioBPeController.lbAlias.value = ALIAS Origen / Destino de boletos relatorioBPeController.MSG.informarData = Favor informar data inicial e final. relatorioBPeController.MSG.dataInicialMaiorQueFinal = Data de inicio não pode ser maior do que a final. +#Relatorio Resumo Venda por Orgao Concedente +relatorioResumoVendaOrgaoConcedenteController.window.title = Relatorio Resumo Venda por Orgao Concedente +relatorioResumoVendaOrgaoConcedenteController.lbEmpresa.value = Empresa +relatorioResumoVendaOrgaoConcedenteController.lbDtInicio.value = Data Inicio Venda +relatorioResumoVendaOrgaoConcedenteController.lbDtFim.value = Data Fim Venda +relatorioResumoVendaOrgaoConcedenteController.lbUF.value = UF +indexController.mniRelatorioResumoVendaOrgaoConcedente.label= Relatorio Resumo Venda Órgao Concedente +relatorioResumoVendaOrgaoConcedenteController.lbPuntoVenta.value=Agência +relatorioResumoVendaOrgaoConcedenteController.btnPesquisa.label=Pesquisar +relatorioResumoVendaOrgaoConcedenteController.btnLimpar.label=Limpar +relatorioResumoVendaOrgaoConcedenteController.lbClasse.value = Classe + + +relatorioResumoVendaOrgaoConcedenteController.MSG.informarData = Favor informar data inicial e final. +relatorioResumoVendaOrgaoConcedenteController.MSG.dataInicialMaiorQueFinal = Data de inicio não pode ser maior do que a final. + # Dispositivo Venda Embarcada dispositivoVendaEmbarcadaController.window.title = Dispositivo Venda Embarcada painelVendaEmbarcadaController.window.title = Painel Venda Embarcada diff --git a/web/gui/relatorios/filtroRelatorioResumoVendaOrgaoConcedente.zul b/web/gui/relatorios/filtroRelatorioResumoVendaOrgaoConcedente.zul new file mode 100644 index 000000000..db80cb11d --- /dev/null +++ b/web/gui/relatorios/filtroRelatorioResumoVendaOrgaoConcedente.zul @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +