diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAgenciasNaoImportadas.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAgenciasNaoImportadas.java new file mode 100644 index 000000000..a4fea77ce --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAgenciasNaoImportadas.java @@ -0,0 +1,126 @@ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioAgenciasNaoImportadasBean; + +public class RelatorioAgenciasNaoImportadas extends Relatorio { + + private List lsDadosRelatorio; + + public RelatorioAgenciasNaoImportadas(Map parametros, Connection conexao){ + super(parametros, conexao); + + try{ + this.setCustomDataSource(new DataSource(this) { + @Override + public void initDados() throws Exception { + + Connection conexao = this.relatorio.getConexao(); + + Map parametros = this.relatorio.getParametros(); + + String fecInicio = parametros.get("fecInicio").toString() + " 00:00:00"; + String fecFinal = parametros.get("fecFinal").toString() + " 23:59:59"; + + String sql = getSQL(); + + PreparedStatement stmt = conexao.prepareStatement(sql); + ResultSet rs = null; + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"); + + stmt.setTimestamp(1, new java.sql.Timestamp(sdf.parse(fecInicio).getTime())); + stmt.setTimestamp(2, new java.sql.Timestamp(sdf.parse(fecFinal).getTime())); + stmt.setTimestamp(3, new java.sql.Timestamp(sdf.parse(fecInicio).getTime())); + stmt.setTimestamp(4, new java.sql.Timestamp(sdf.parse(fecFinal).getTime())); + stmt.setTimestamp(5, new java.sql.Timestamp(sdf.parse(fecInicio).getTime())); + stmt.setTimestamp(6, new java.sql.Timestamp(sdf.parse(fecFinal).getTime())); + + rs = stmt.executeQuery(); + + lsDadosRelatorio = new ArrayList(); + + while (rs.next()) { + + RelatorioAgenciasNaoImportadasBean agencia = new RelatorioAgenciasNaoImportadasBean(); + + agencia.setNumpuntoventa(rs.getString(1)); + agencia.setNombpuntoventa(rs.getString(2)); + agencia.setFecha(rs.getDate(3)); + + lsDadosRelatorio.add(agencia); + } + + if (lsDadosRelatorio.size() > 0) { + + setLsDadosRelatorio(lsDadosRelatorio); + } + } + }); + } catch (Exception e){ + System.out.println(e.toString()); + } + } + + public void setLsDadosRelatorio(List lsDadosRelatorio) { + this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); + this.lsDadosRelatorio = lsDadosRelatorio; + } + + @Override + protected void processaParametros() throws Exception { + } + + private String getSQL() { + + StringBuilder sql = new StringBuilder(); + sql.append(" select distinct pu.numpuntoventa, pu.nombpuntoventa, t.fecha from "); + sql.append(" punto_venta pu "); + sql.append(" inner join ( "); + sql.append(" select "); + sql.append(" p.puntoventa_id puntoventa_id, "); + sql.append(" TRUNC(c.fechorventa ) fecha "); + sql.append(" from "); + sql.append(" punto_venta p "); + sql.append(" inner join caja c on c.puntoventa_id = p.puntoventa_id "); + sql.append(" where "); + sql.append(" c.fecintegracion is null "); + sql.append(" and c.FECHORVENTA between ? AND ? "); + sql.append(" union all "); + sql.append(" select "); + sql.append(" p.puntoventa_id puntoventa_id, "); + sql.append(" TRUNC(cd.fechorvta ) fecha "); + sql.append(" from "); + sql.append(" punto_venta p "); + sql.append(" inner join caja_diversos cd on cd.puntoventa_id = p.puntoventa_id "); + sql.append(" where "); + sql.append(" cd.fecintegracion is null "); + sql.append(" and cd.FECHORVTA between ? AND ? "); + sql.append(" union all "); + sql.append(" select "); + sql.append(" p.puntoventa_id puntoventa_id, "); + sql.append(" TRUNC(fb.fecdocumento ) fecha "); + sql.append(" from "); + sql.append(" punto_venta p "); + sql.append(" inner join fechamento_cntcorrente fc on fc.puntoventa_id = p.puntoventa_id "); + sql.append(" inner join fechamento_boleto fb on fb.FECHAMENTOCNTCORRENTE_ID = fc.FECHAMENTOCNTCORRENTE_ID "); + sql.append(" where "); + sql.append(" fb.fecintegracion is null "); + sql.append(" and fb.fecdocumento between ? AND ? "); + sql.append(" ) t on t.puntoventa_id = pu.puntoventa_id "); + sql.append(" order by "); + sql.append(" t.fecha, pu.nombpuntoventa "); + + return sql.toString(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAgenciasNaoImportadas_es .properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAgenciasNaoImportadas_es .properties new file mode 100644 index 000000000..de0eb6e10 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAgenciasNaoImportadas_es .properties @@ -0,0 +1,8 @@ +#geral +msg.noData=No se pudo obtener datos con los parámetros reportados. +msg.a=a + +#Labels header +header.numpuntoventa=Num. Punto Venta +header.nombpuntoventa=Punto Venta +header.fecha=Fecha diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAgenciasNaoImportadas_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAgenciasNaoImportadas_pt_BR.properties new file mode 100644 index 000000000..de16c0bef --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAgenciasNaoImportadas_pt_BR.properties @@ -0,0 +1,8 @@ +#geral +msg.noData=No se pudo obtener datos con los parámetros reportados. +msg.a=a + +#Labels header +header.numpuntoventa=Número Agência +header.nombpuntoventa=Agência +header.fecha=Data \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAgenciasNaoImportadas.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAgenciasNaoImportadas.jasper new file mode 100644 index 000000000..a6f40bf2e Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAgenciasNaoImportadas.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAgenciasNaoImportadas.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAgenciasNaoImportadas.jrxml new file mode 100644 index 000000000..65ea89613 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAgenciasNaoImportadas.jrxml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioAgenciasNaoImportadasBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioAgenciasNaoImportadasBean.java new file mode 100644 index 000000000..73b3e9195 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioAgenciasNaoImportadasBean.java @@ -0,0 +1,28 @@ +package com.rjconsultores.ventaboletos.relatorios.utilitarios; + +import java.util.Date; + +public class RelatorioAgenciasNaoImportadasBean { + private String numpuntoventa; + private String nombpuntoventa; + private Date fecha; + + public String getNumpuntoventa() { + return numpuntoventa; + } + public void setNumpuntoventa(String numpuntoventa) { + this.numpuntoventa = numpuntoventa; + } + public String getNombpuntoventa() { + return nombpuntoventa; + } + public void setNombpuntoventa(String nombpuntoventa) { + this.nombpuntoventa = nombpuntoventa; + } + public Date getFecha() { + return fecha; + } + public void setFecha(Date fecha) { + this.fecha = fecha; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAgenciasNaoImportadasController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAgenciasNaoImportadasController.java new file mode 100644 index 000000000..6ca9b19f3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAgenciasNaoImportadasController.java @@ -0,0 +1,75 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; + +import java.text.SimpleDateFormat; +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.apache.log4j.Logger; +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.Datebox; +import org.zkoss.zul.Paging; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAgenciaFechamento; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAgenciasNaoImportadas; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.EmpresaService; +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("relatorioAgenciasNaoImportadasController") +@Scope("prototype") +public class RelatorioAgenciasNaoImportadasController extends MyGenericForwardComposer { + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(RelatorioAgenciasNaoImportadasController.class); + + @Autowired + private DataSource dataSourceRead; + + private Datebox datInicial; + private Datebox datFinal; + + private void executarRelatorio() throws Exception { + + Map parametros = new HashMap(); + + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + parametros.put("fecInicio", sdf.format(this.datInicial.getValue())); + parametros.put("fecFinal", sdf.format(this.datFinal.getValue())); + + parametros.put("TITULO", Labels.getLabel("indexController.mniRelatorioAgenciasNaoImportadas.label")); + + Relatorio relatorio = new RelatorioAgenciasNaoImportadas(parametros, dataSourceRead.getConnection()); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("indexController.mniRelatorioAgenciasNaoImportadas.label"), args, MODAL); + + } + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { + executarRelatorio(); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioAgenciasNaoImportadas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioAgenciasNaoImportadas.java new file mode 100644 index 000000000..2c7025372 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioAgenciasNaoImportadas.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 ItemMenuRelatorioAgenciasNaoImportadas extends DefaultItemMenuSistema { + + public ItemMenuRelatorioAgenciasNaoImportadas() { + super("indexController.mniRelatorioAgenciasNaoImportadas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVAGENCIASNAOIMPORTADAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioAgenciasNaoImportadas.zul", + Labels.getLabel("indexController.mniRelatorioAgenciasNaoImportadas.label"), getArgs() ,desktop); + } + +} diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 047ff7984..71c68c681 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -233,6 +233,7 @@ indexController.mniRelatorioEmpresaOnibus.label = Reporte de la empresa autobús indexController.mniRelatorioOCD.label = Reporte OCD por la empresa indexController.mniRelatorioGratuidade.label = Reporte Gratuidade indexController.mniRelatorioVendasBilheteiro.label = Reporte de Ventas por Agente de Billetes +indexController.mniRelatorioAgenciasNaoImportadas.label = Reporte Puntos Venta no Importados indexController.mniFechamentoParamgeral.label = Fechamento Conta Corrente indexController.mniFechamentoParamptovta.label = Fechamento Conta Corrente Agência indexController.mniRelatorioCorridas.label = Reporte de Corridas @@ -5146,6 +5147,10 @@ relatorioGratuidadeController.lbLinhas.value = Ruta relatorioGratuidadeController.lbDataIni.value = Fecha Inicio relatorioGratuidadeController.lbDataFin.value = Fecha Final +# Filtro Relatorio de Agências Não Importadas +filtroRelatorioAgenciasNaoImportadas.lbDataIni.value = Fecha Inicio +filtroRelatorioAgenciasNaoImportadas.lbDataFin.value = Fecha Final + indexController.mniRelatorioAgenciaFechamento.label= Relatorio Agências Fechamento integracion.totvs=ERRO ao fazer integracion com a TOTVS diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 71911072a..fa2592c9d 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -237,6 +237,7 @@ indexController.mniRelatorioEmpresaOnibus.label = Relatório por Empresa Ônibus indexController.mniRelatorioOCD.label = Relatório OCD por Empresa indexController.mniRelatorioGratuidade.label = Relatório Gratuidade indexController.mniRelatorioVendasBilheteiro.label = Relatório de Vendas por Bilheteiro +indexController.mniRelatorioAgenciasNaoImportadas.label = Relatório de Agências não Importadas indexController.mniFechamentoParamgeral.label = Fechamento Conta Corrente indexController.mniFechamentoParamptovta.label = Fechamento Conta Corrente Agência indexController.mniRelatorioCorridas.label = Relatório de Serviços @@ -5265,4 +5266,8 @@ busquedaRelgerencialEmpresaController.btnPesquisa.label=Pesquisar editarRelgerencialEmpresaController.MSG.suscribirOK=Relatorio Gerencial gravado com sucesso! editarRelgerencialEmpresaController.window.title=Impressão Fiscal :: Editar Relatorio Gerencial editarRelgerencialEmpresaController.MSG.borrarPergunta=Deseja eliminar Relatorio Gerencial? -editarRelgerencialEmpresaController.MSG.borrarOK=Relatorio Gerencial eliminada com sucesso! \ No newline at end of file +editarRelgerencialEmpresaController.MSG.borrarOK=Relatorio Gerencial eliminada com sucesso! + +# Filtro Relatorio de Agências Não Importadas +filtroRelatorioAgenciasNaoImportadas.lbDataIni.value = Data Inicio +filtroRelatorioAgenciasNaoImportadas.lbDataFin.value = Data Final diff --git a/web/gui/relatorios/filtroRelatorioAgenciasNaoImportadas.zul b/web/gui/relatorios/filtroRelatorioAgenciasNaoImportadas.zul new file mode 100644 index 000000000..0598980a6 --- /dev/null +++ b/web/gui/relatorios/filtroRelatorioAgenciasNaoImportadas.zul @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + +