diff --git a/pom.xml b/pom.xml index af16e7115..344344f64 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores ventaboletosadm - 1.48.6 + 1.49.0 war diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgenciaNovo.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgenciaNovo.java new file mode 100644 index 000000000..e564ca370 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgenciaNovo.java @@ -0,0 +1,116 @@ +/** + * + */ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource; +import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; + +public class RelatorioFormaPagamentoAgenciaNovo extends RelatorioDemandas { + public RelatorioFormaPagamentoAgenciaNovo(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(); + + Date dataInicial = (Date) parametros.get("DATA_INICIAL"); + Date dataFinal = (Date) parametros.get("DATA_FINAL"); + Integer empresa = (Integer) parametros.get("EMPRESA"); + Integer agencia = (Integer) parametros.get("AGENCIA"); + Short formaPagoId = (Short) parametros.get("FORMA_PAGO"); + + StringBuilder sql = new StringBuilder(); + sql.append(" SELECT " ); + sql.append(" c.fechorventa AS data, " ); + sql.append(" c.numfoliosistema AS bilhete, " ); + sql.append(" pv.nombpuntoventa AS agencia, " ); + sql.append(" p_origen.CVEPARADA AS origem , " ); + sql.append(" p_destino.CVEPARADA AS destino, " ); + sql.append(" fp.descpago AS forma_pagamento, " ); + sql.append(" coalesce(c.preciopagado, 0) AS tarifa, " ); + sql.append(" coalesce(c.importepedagio, 0) AS pedagio, " ); + sql.append(" coalesce(c.importeseguro, 0) AS seguro, " ); + sql.append(" coalesce(c.importetaxaembarque, 0) AS taxa, " ); + sql.append(" coalesce(cfp.importe, 0) AS valor, " ); + sql.append(" coalesce(seg.valor, 0) AS seg_opcional " ); + sql.append(" FROM " ); + sql.append(" caja c " ); + sql.append(" JOIN caja_formapago cfp ON c.caja_id = cfp.caja_id " ); + sql.append(" JOIN forma_pago fp ON cfp.formapago_id = fp.formapago_id " ); + sql.append(" JOIN punto_venta pv ON pv.puntoventa_id = c.puntoventa_id " ); + sql.append(" JOIN marca m ON m.marca_id = c.marca_id AND m.activo = 1 " ); + sql.append(" JOIN parada p_origen ON p_origen.parada_id = c.origen_id " ); + sql.append(" JOIN parada p_destino ON p_destino.parada_id = c.destino_id " ); + sql.append(" LEFT JOIN segpolv seg ON c.transacao_id = seg.boleto_id " ); + sql.append(" WHERE " ); + sql.append(" c.activo = 1 " ); + sql.append(" AND c.indreimpresion = 0 " ); + sql.append(" AND c.fechorventa >= :dataInicial " ); + sql.append(" AND c.fechorventa <= :dataFinal " ); + + if (empresa != null) { + sql.append(" AND c.empresa_id = :empresaId "); + } + + if (agencia != null) { + sql.append(" AND c.puntoventa_id = :agenciaId "); + } + + if (formaPagoId != null) { + sql.append(" AND cfp.FORMAPAGO_ID = :formaPagoId "); + } + + sql.append(" ORDER BY data, agencia, bilhete " ); + + NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString()); + + stmt.setDate("dataInicial", new java.sql.Date(dataInicial.getTime())); + stmt.setDate("dataFinal", new java.sql.Date(dataFinal.getTime())); + + if (empresa != null) { + stmt.setInt("empresaId", empresa); + } + + if (agencia != null) { + stmt.setInt("agenciaId", agencia); + } + + if (formaPagoId != null ) { + stmt.setInt("formapagoId", formaPagoId); + } + + ResultSet rset = stmt.executeQuery(); + + while (rset.next()) { + Map dataResult = new HashMap(); + + dataResult.put("DATA", rset.getDate("data")); + dataResult.put("BILHETE", rset.getString("bilhete")); + dataResult.put("ORIGEM", rset.getString("ORIGEM")); + dataResult.put("DESTINO", rset.getString("DESTINO")); + dataResult.put("AGENCIA", rset.getString("agencia")); + dataResult.put("FORMA_PAGAMENTO", rset.getString("forma_pagamento")); + dataResult.put("TARIFA", rset.getBigDecimal("tarifa")); + dataResult.put("PEDAGIO", rset.getBigDecimal("PEDAGIO")); + dataResult.put("SEGURO", rset.getBigDecimal("SEGURO")); + dataResult.put("SEG_OPCIONAL", rset.getBigDecimal("seg_opcional")); + dataResult.put("TAXA", rset.getBigDecimal("taxa")); + dataResult.put("VALOR", rset.getBigDecimal("valor")); + + this.dados.add(dataResult); + } + + this.resultSet = rset; + } + }); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_es.properties new file mode 100644 index 000000000..f97abf049 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_es.properties @@ -0,0 +1,31 @@ +TITULO = Relatório de Forma de Pagamento por Agência +PERIODO = PERÍODO +header.data.hora=Data/Hora\: +cabecalho.impressorPor=Impresso por + +DATA = DATA +AGENCIA = AGÊNCIA: +FORMA_PAG = FORMA DE PAG. +VALOR = TARIFA +PEDAGIO = PEDÁGIO +SEGURO = SEGURO +SEGURO_OPCIONAL = SEG. OPCI. +TAXAS = TAXAS +TOTAL = TOTAL +BILHETE = BILHETE +ORIGEM = ORIGEM +DESTINO = DESTINO +TOTAL_GERAL = Total Geral: +TOTAL_PV = Total Agência: + +#Labels cabeçalho +cabecalho.relatorio=Relatório: +cabecalho.periodo=Período: +cabecalho.periodoA=à +cabecalho.dataHora=Data/Hora: +cabecalho.impressorPor=Impresso por: +cabecalho.pagina=Página +cabecalho.de=de +cabecalho.filtros=Filtros: + +msg.noData=Não foi possivel obter dados com os parâmetros informados. \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_pt_BR.properties new file mode 100644 index 000000000..f97abf049 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_pt_BR.properties @@ -0,0 +1,31 @@ +TITULO = Relatório de Forma de Pagamento por Agência +PERIODO = PERÍODO +header.data.hora=Data/Hora\: +cabecalho.impressorPor=Impresso por + +DATA = DATA +AGENCIA = AGÊNCIA: +FORMA_PAG = FORMA DE PAG. +VALOR = TARIFA +PEDAGIO = PEDÁGIO +SEGURO = SEGURO +SEGURO_OPCIONAL = SEG. OPCI. +TAXAS = TAXAS +TOTAL = TOTAL +BILHETE = BILHETE +ORIGEM = ORIGEM +DESTINO = DESTINO +TOTAL_GERAL = Total Geral: +TOTAL_PV = Total Agência: + +#Labels cabeçalho +cabecalho.relatorio=Relatório: +cabecalho.periodo=Período: +cabecalho.periodoA=à +cabecalho.dataHora=Data/Hora: +cabecalho.impressorPor=Impresso por: +cabecalho.pagina=Página +cabecalho.de=de +cabecalho.filtros=Filtros: + +msg.noData=Não foi possivel obter dados com os parâmetros informados. \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_pt_BR.properties index f0f1a5f0c..900a7b6fd 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_pt_BR.properties @@ -9,7 +9,7 @@ FORMA_PAG = FORMA DE PAG. VALOR = TARIFA PEDAGIO = PEDÁGIO SEGURO = SEGURO -SEGURO_OPCIONAL = SEGURO OPCIONAL +SEGURO_OPCIONAL = SEG. OPCIO. TAXAS = TAXAS TOTAL = TOTAL QTDE = QTDE diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jasper new file mode 100644 index 000000000..2a9431ac8 Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jrxml new file mode 100644 index 000000000..cdfb3bf2c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jrxml @@ -0,0 +1,582 @@ + + + + + + + + + + +