leonardo 2015-05-20 14:23:25 +00:00
parent 4f7c25241d
commit bf5700a3ee
11 changed files with 452 additions and 1 deletions

View File

@ -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<RelatorioAgenciasNaoImportadasBean> lsDadosRelatorio;
public RelatorioAgenciasNaoImportadas(Map<String, Object> parametros, Connection conexao){
super(parametros, conexao);
try{
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> 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<RelatorioAgenciasNaoImportadasBean>();
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<RelatorioAgenciasNaoImportadasBean> 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();
}
}

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioAgenciaFechamento" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty" uuid="94834362-0ecc-46da-b0a2-5cdee355da3e">
<property name="ireport.zoom" value="2.1961500000000007"/>
<property name="ireport.x" value="318"/>
<property name="ireport.y" value="37"/>
<parameter name="fecInicio" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="fecFinal" class="java.lang.String"/>
<parameter name="TITULO" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="numpuntoventa" class="java.lang.String"/>
<field name="nombpuntoventa" class="java.lang.String"/>
<field name="fecha" class="java.util.Date"/>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="41" splitType="Stretch">
<textField>
<reportElement uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716" x="231" y="20" width="49" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.data}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="66b2d0f6-2bf1-4bc7-9ec0-a34444e04d60" x="397" y="0" width="56" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement uuid="8ca68351-fc00-4f19-b94f-f2fd1f41964f" x="529" y="20" width="22" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="be1692e9-f130-4d08-9173-6ca3e4699030" x="463" y="20" width="42" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.pagina}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="4914d9e7-6ce8-4512-b1f8-13f3b572ac50" x="280" y="20" width="182" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{fecInicio} + " à " + $P{fecFinal}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="652312bd-292a-424d-a234-5f157e3699c6" x="0" y="0" width="231" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="6f671365-868e-41a6-81ee-a308d1d91e1d" x="453" y="0" width="98" height="20"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="7548d623-fb6c-48d4-b8b7-504f5437a79a" x="505" y="20" width="24" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="25" splitType="Stretch">
<textField>
<reportElement uuid="c0bf8f56-20d8-47af-a650-4a6ba4442c8c" x="93" y="4" width="226" height="17"/>
<textElement textAlignment="Center" markup="none">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.nombpuntoventa}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="eb16bd4c-e5d9-423e-a089-a9b2bcbe4189" x="319" y="4" width="78" height="17"/>
<textElement textAlignment="Right" markup="none">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.fecha}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="890b61c9-2195-455a-9c28-316d48ab5fea" x="0" y="4" width="93" height="17"/>
<textElement textAlignment="Right" markup="none">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.numpuntoventa}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="ae94e51c-f84c-405c-a9c3-d8fd0c48f03a" x="0" y="24" width="571" height="1"/>
</line>
<line>
<reportElement uuid="83809dd0-64dc-4779-9552-440eabef278e" x="0" y="0" width="571" height="1"/>
</line>
</band>
</columnHeader>
<detail>
<band height="17" splitType="Stretch">
<textField isBlankWhenNull="true">
<reportElement uuid="b2a04e5c-f61e-4380-990e-604417465e9d" x="0" y="0" width="93" height="17"/>
<textElement textAlignment="Right" markup="none">
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{numpuntoventa}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement uuid="5eac8194-63bd-43d7-8da2-8ed75f4f9219" x="319" y="0" width="78" height="17"/>
<textElement textAlignment="Right">
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{fecha}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="3f2de0d3-e1e1-4c38-abe4-539529605c34" x="103" y="0" width="216" height="17"/>
<textElement textAlignment="Left" markup="none">
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{nombpuntoventa}]]></textFieldExpression>
</textField>
</band>
</detail>
<noData>
<band height="20">
<textField>
<reportElement uuid="5a6c1b7b-2242-4cf1-b957-723b906ee620" x="0" y="0" width="803" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -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;
}
}

View File

@ -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<String, Object> parametros = new HashMap<String, Object>();
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<String, Object> args = new HashMap<String, Object>();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("indexController.mniRelatorioAgenciasNaoImportadas.label"), args, MODAL);
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
}
}

View File

@ -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);
}
}

View File

@ -233,6 +233,7 @@ indexController.mniRelatorioEmpresaOnibus.label = Reporte de la empresa autobús
indexController.mniRelatorioOCD.label = Reporte OCD por la empresa indexController.mniRelatorioOCD.label = Reporte OCD por la empresa
indexController.mniRelatorioGratuidade.label = Reporte Gratuidade indexController.mniRelatorioGratuidade.label = Reporte Gratuidade
indexController.mniRelatorioVendasBilheteiro.label = Reporte de Ventas por Agente de Billetes 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.mniFechamentoParamgeral.label = Fechamento Conta Corrente
indexController.mniFechamentoParamptovta.label = Fechamento Conta Corrente Agência indexController.mniFechamentoParamptovta.label = Fechamento Conta Corrente Agência
indexController.mniRelatorioCorridas.label = Reporte de Corridas indexController.mniRelatorioCorridas.label = Reporte de Corridas
@ -5146,6 +5147,10 @@ relatorioGratuidadeController.lbLinhas.value = Ruta
relatorioGratuidadeController.lbDataIni.value = Fecha Inicio relatorioGratuidadeController.lbDataIni.value = Fecha Inicio
relatorioGratuidadeController.lbDataFin.value = Fecha Final 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 indexController.mniRelatorioAgenciaFechamento.label= Relatorio Agências Fechamento
integracion.totvs=ERRO ao fazer integracion com a TOTVS integracion.totvs=ERRO ao fazer integracion com a TOTVS

View File

@ -237,6 +237,7 @@ indexController.mniRelatorioEmpresaOnibus.label = Relatório por Empresa Ônibus
indexController.mniRelatorioOCD.label = Relatório OCD por Empresa indexController.mniRelatorioOCD.label = Relatório OCD por Empresa
indexController.mniRelatorioGratuidade.label = Relatório Gratuidade indexController.mniRelatorioGratuidade.label = Relatório Gratuidade
indexController.mniRelatorioVendasBilheteiro.label = Relatório de Vendas por Bilheteiro 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.mniFechamentoParamgeral.label = Fechamento Conta Corrente
indexController.mniFechamentoParamptovta.label = Fechamento Conta Corrente Agência indexController.mniFechamentoParamptovta.label = Fechamento Conta Corrente Agência
indexController.mniRelatorioCorridas.label = Relatório de Serviços 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.MSG.suscribirOK=Relatorio Gerencial gravado com sucesso!
editarRelgerencialEmpresaController.window.title=Impressão Fiscal :: Editar Relatorio Gerencial editarRelgerencialEmpresaController.window.title=Impressão Fiscal :: Editar Relatorio Gerencial
editarRelgerencialEmpresaController.MSG.borrarPergunta=Deseja eliminar Relatorio Gerencial? editarRelgerencialEmpresaController.MSG.borrarPergunta=Deseja eliminar Relatorio Gerencial?
editarRelgerencialEmpresaController.MSG.borrarOK=Relatorio Gerencial eliminada com sucesso! 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

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winRelatorioAgenciasNaoImportadas"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winRelatorioAgenciasNaoImportadas"
apply="${relatorioAgenciasNaoImportadasController}"
contentStyle="overflow:auto" height="250px" width="560px"
border="normal">
<grid fixedLayout="true">
<columns>
<column width="20%" />
<column width="30%" />
<column width="20%" />
<column width="30%" />
</columns>
<rows>
<row>
<label
value="${c:l('filtroRelatorioAgenciasNaoImportadas.lbDataIni.value')}" />
<datebox id="datInicial" width="90%"
format="dd/MM/yyyy" lenient="false" constraint="no empty"
maxlength="10" />
<label
value="${c:l('filtroRelatorioAgenciasNaoImportadas.lbDataFin.value')}" />
<datebox id="datFinal" width="90%"
format="dd/MM/yyyy" lenient="false" constraint="no empty"
maxlength="10" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>