fixed bug #7112 - desenvolvimento relatório de tabela de preços

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@52968 d1611594-4594-4d17-8e1d-87c2c4800839
master
frederico 2016-02-17 11:36:31 +00:00
parent e54f11e6e5
commit 4adb95f375
10 changed files with 741 additions and 0 deletions

View File

@ -0,0 +1,95 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
public class RelatorioTabelaPreco extends Relatorio {
public RelatorioTabelaPreco(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new ArrayDataSource(this) {
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
NamedParameterStatement stmt = new NamedParameterStatement(conexao, getSql());
stmt.setTimestamp("dataInicial", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
stmt.setTimestamp("dataFinal", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
ResultSet rset = stmt.executeQuery();
while (rset.next()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
dataResult.put("origem", rset.getString("origem"));
dataResult.put("destino", rset.getString("destino"));
dataResult.put("tarifa", rset.getBigDecimal("tarifa"));
dataResult.put("pedagio", rset.getBigDecimal("pedagio"));
dataResult.put("taxaEmbarque", rset.getBigDecimal("taxaEmbarque"));
dataResult.put("seguro", rset.getBigDecimal("seguro"));
dataResult.put("outros", rset.getBigDecimal("outros"));
dataResult.put("tipoClasse", rset.getString("tipoClasse"));
dataResult.put("linha", rset.getString("linha"));
dataResult.put("empresa", rset.getString("empresa"));
dataResult.put("dataVigencia", rset.getString("dataVigencia"));
this.dados.add(dataResult);
}
this.resultSet = rset;
}
});
}
@Override
protected void processaParametros() throws Exception {
}
private String getSql() {
StringBuilder sql = new StringBuilder();
sql.append("SELECT pOrigem.DESCPARADA as origem, ");
sql.append(" pDestino.DESCPARADA as destino, ");
sql.append(" COALESCE(t.precio,0) as tarifa, ");
sql.append(" COALESCE(t.IMPORTEPEDAGIO, 0) as pedagio, ");
sql.append(" COALESCE(t.IMPORTETAXAEMBARQUE, 0) as taxaEmbarque, ");
sql.append(" COALESCE(t.IMPORTESEGURO, 0) as seguro, ");
sql.append(" COALESCE(t.IMPORTEOUTROS, 0) as outros, ");
sql.append(" cs.DESCCLASE as tipoClasse, ");
sql.append(" r.DESCRUTA as linha, ");
sql.append(" e.NOMBEMPRESA as empresa, ");
sql.append(" vt.FECINICIOVIGENCIA || ' à ' || vt.FECFINVIGENCIA as dataVigencia ");
sql.append("FROM TARIFA t ");
sql.append("INNER JOIN PARADA pOrigem ON t.ORIGEN_ID = pOrigem.PARADA_ID ");
sql.append("INNER JOIN PARADA pDestino ON t.DESTINO_ID = pDestino.PARADA_ID ");
sql.append("INNER JOIN CLASE_SERVICIO cs ON cs.CLASESERVICIO_ID = t.CLASESERVICIO_ID ");
sql.append("INNER JOIN RUTA r ON r.RUTA_ID = t.RUTA_ID ");
sql.append("INNER JOIN MARCA m ON m.MARCA_ID = t.MARCA_ID ");
sql.append("INNER JOIN EMPRESA e ON e.EMPRESA_ID = m.EMPRESA_ID ");
sql.append("INNER JOIN VIGENCIA_TARIFA vt ON vt.VIGENCIATARIFA_ID = t.VIGENCIATARIFA_ID ");
sql.append("WHERE (:dataInicial BETWEEN vt.FECINICIOVIGENCIA AND vt.FECFINVIGENCIA ) ");
sql.append("AND (:dataFinal BETWEEN vt.FECINICIOVIGENCIA AND vt.FECFINVIGENCIA ) ");
if (parametros.get("EMPRESA_ID") != null) {
sql.append(" AND e.empresa_id = " + parametros.get("EMPRESA_ID"));
}
if (parametros.get("RUTA_ID") != null) {
sql.append(" AND r.RUTA_ID = " + parametros.get("RUTA_ID"));
}
return sql.toString();
}
}

View File

@ -0,0 +1,25 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.relatorio=Relatório:
cabecalho.periodo=Período:
cabecalho.periodoA=à
cabecalho.dataHora=Data/Hora:
cabecalho.impressorPor=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
#Labels header
label.origem=Origem
label.destino=Destino
label.tarifa=Tarifa
label.pedagio=Pedágio
label.taxaEmbarque=Taxa
label.seguro=Seguro
label.outros=Outros
label.tipoClasse=Classe
label.linha=Linha
label.empresa=Empresa
label.dataVigencia=Vigência

View File

@ -0,0 +1,25 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.relatorio=Relatório:
cabecalho.periodo=Período:
cabecalho.periodoA=à
cabecalho.dataHora=Data/Hora:
cabecalho.impressorPor=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
#Labels header
label.origem=Origem
label.destino=Destino
label.tarifa=Tarifa
label.pedagio=Pedágio
label.taxaEmbarque=Taxa
label.seguro=Seguro
label.outros=Outros
label.tipoClasse=Classe
label.linha=Linha
label.empresa=Empresa
label.dataVigencia=Vigência

View File

@ -0,0 +1,315 @@
<?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="RelatorioTabelaPreco" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c092ef85-9334-4225-93d7-1acb7cf4d021">
<property name="ireport.zoom" value="1.2100000000000055"/>
<property name="ireport.x" value="112"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="pageHeader"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/>
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
<parameter name="DATA_INICIAL" class="java.util.Date"/>
<parameter name="DATA_FINAL" class="java.util.Date"/>
<parameter name="USUARIO" class="java.lang.String"/>
<parameter name="FILTROS" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="origem" class="java.lang.String"/>
<field name="destino" class="java.lang.String"/>
<field name="tarifa" class="java.math.BigDecimal"/>
<field name="pedagio" class="java.math.BigDecimal"/>
<field name="seguro" class="java.math.BigDecimal"/>
<field name="outros" class="java.math.BigDecimal"/>
<field name="tipoClasse" class="java.lang.String"/>
<field name="linha" class="java.lang.String"/>
<field name="empresa" class="java.lang.String"/>
<field name="dataVigencia" class="java.lang.String"/>
<field name="taxaEmbarque" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="75" splitType="Stretch">
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="136a5066-d141-4362-af36-0780f0d16542" mode="Transparent" x="0" y="0" width="457" height="35" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="3dca1764-758d-4e1c-80c0-85cc02e47813" mode="Transparent" x="0" y="42" width="46" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodo}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="8948c0fc-e878-45e2-8505-7934add98ab9" mode="Transparent" x="116" y="42" width="10" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodoA}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="false">
<reportElement uuid="7f1b9715-baaf-4e20-9a9d-a7ec4c696587" mode="Transparent" x="46" y="42" width="62" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$P{DATA_INICIAL}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="false">
<reportElement uuid="64632058-9466-479c-ae28-0a11c9ed2c7f" mode="Transparent" x="132" y="42" width="62" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="a9d471fb-1e1d-4d9a-9783-bbf988931192" x="615" y="0" width="100" height="25"/>
<textElement textAlignment="Right">
<font size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false">
<reportElement uuid="0d200750-aabf-4c7e-b27b-c0e7af4802a9" mode="Transparent" x="715" y="0" width="86" height="25" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="bae9bec6-8c42-4bee-a070-34b0a7f1aee4" mode="Transparent" x="668" y="26" width="112" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina}+" "+$V{PAGE_NUMBER}+" "+$R{cabecalho.de}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
<reportElement uuid="314e312c-8f24-42de-8354-3c1f7241a985" mode="Transparent" x="781" y="26" width="20" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="4e030613-9cee-443e-9eaa-b19fa3090976" mode="Transparent" x="701" y="42" width="100" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="b29d0494-2695-420b-bdc1-b13c08bdbcda" x="0" y="59" width="801" height="14"/>
<box leftPadding="2">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="18" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement uuid="337f441e-ca7f-402c-8407-f3406ec2b4b0" x="0" y="0" width="102" height="18" isPrintWhenDetailOverflows="true"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.origem}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="0ddedacd-7ebc-4aa7-9535-2f5695ee9c8c" x="568" y="0" width="88" height="18"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.linha}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="8506ac47-d72f-4ef5-b53a-da3970fb7edc" x="479" y="0" width="89" height="18"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.tipoClasse}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="859d4892-377e-4313-8a88-6454a88ce936" x="424" y="0" width="55" height="18"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.outros}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d9a2225c-8883-4a35-9c16-8af9bcfe6577" x="259" y="0" width="55" height="18"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.pedagio}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="0583701e-920a-473b-b1e4-6137f8d022df" mode="Transparent" x="204" y="0" width="55" height="18" forecolor="#000000" backcolor="#FFFFFF"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.tarifa}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="82e75550-fae7-4cea-acf9-f9f56f083400" x="656" y="0" width="93" height="18"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.empresa}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="f9ea7239-48e1-4207-b957-dc4aadcaa590" mode="Transparent" x="102" y="0" width="102" height="18" forecolor="#000000" backcolor="#FFFFFF"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="876fa163-5ff5-4eef-b32c-0f5b6b40672c" x="314" y="0" width="55" height="18"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.taxaEmbarque}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="77a2f088-9771-472c-bffe-cd1345050e51" x="369" y="0" width="55" height="18"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.seguro}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="2daa8450-9151-4464-abd8-29d744df1e26" x="749" y="0" width="53" height="18"/>
<box>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.dataVigencia}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement uuid="4a0efda0-b112-4092-8164-292ab7fb1950" x="0" y="0" width="102" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="f544e769-3f8c-4200-86ed-01f6c4024334" x="102" y="0" width="102" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="">
<reportElement uuid="b81fcb18-2337-4514-be27-fe7d3c88acc5" x="204" y="0" width="55" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="">
<reportElement uuid="8a545d22-875e-46cd-8011-444a8e884bca" x="259" y="0" width="55" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="">
<reportElement uuid="6f76912d-0eef-439c-9fb8-236181d94033" x="424" y="0" width="55" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{outros}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="">
<reportElement uuid="ac958e4e-b8ad-4abc-b58a-1aaca4992db6" x="314" y="0" width="55" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{taxaEmbarque}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="">
<reportElement uuid="72858663-765d-4843-bc51-ec6a80a0b7d0" x="369" y="0" width="55" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{seguro}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="11f32d65-9824-47f6-95f5-482cce626d4b" x="479" y="0" width="89" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{tipoClasse}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="e3c11bc0-5229-4925-b7fe-6a1e572ce946" x="568" y="0" width="88" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{linha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="abf746f7-be60-48af-9882-6723c50f4ae1" x="656" y="0" width="93" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy">
<reportElement uuid="5c9ae216-19d0-48f6-a405-6ee51dcd55ef" x="749" y="0" width="52" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{dataVigencia}]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band splitType="Stretch"/>
</summary>
<noData>
<band height="26">
<textField>
<reportElement uuid="6f13c961-dd50-4e44-ba73-65e0752b8b83" x="0" y="0" width="802" height="26"/>
<textElement textAlignment="Center" markup="none">
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -0,0 +1,185 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.util.Calendar;
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.Comboitem;
import org.zkoss.zul.Datebox;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioTabelaPreco;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.RutaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@Controller("relatorioTabelaPrecoController")
@Scope("prototype")
public class RelatorioTabelaPrecoController extends MyGenericForwardComposer {
private static final long serialVersionUID = 1L;
private Datebox datInicial;
private Datebox datFinal;
private MyComboboxEstandar cmbEmpresa;
private List<Empresa> lsEmpresa;
private MyComboboxEstandar cmbRuta;
private List<Ruta> lsRuta;
@Autowired
private EmpresaService empresaService;
@Autowired
private RutaService rutaService;
@Autowired
private DataSource dataSourceRead;
@Override
public void doAfterCompose(Component comp) throws Exception {
lsEmpresa = empresaService.obtenerTodos();
lsRuta = rutaService.obtenerTodos();
super.doAfterCompose(comp);
}
/**
* @throws Exception
*
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private void executarRelatorio() throws Exception {
{
if (datInicial != null && datFinal != null && datFinal.getValue().compareTo(datInicial.getValue()) < 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("relatorioTabelaPrecoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
} else
{
Relatorio relatorio;
Map<String, Object> parametros = new HashMap<String, Object>();
StringBuilder filtro = new StringBuilder();
filtro.append("Início período: ");
Calendar cal = Calendar.getInstance();
cal.setTime(datInicial.getValue());
filtro.append(cal.get(Calendar.DATE) + "/");
filtro.append((cal.get(Calendar.MONTH) + 1) + "/");
filtro.append(cal.get(Calendar.YEAR) + "; ");
filtro.append("Fim período: ");
cal.setTime(datFinal.getValue());
filtro.append(cal.get(Calendar.DATE) + "/");
filtro.append((cal.get(Calendar.MONTH) + 1) + "/");
filtro.append(cal.get(Calendar.YEAR) + "; ");
parametros.put("DATA_INICIAL", (java.util.Date) datInicial.getValue());
parametros.put("DATA_FINAL", (java.util.Date) datFinal.getValue());
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioTabelaPrecoController.window.title"));
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario());
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() + ";");
} else {
filtro.append(" Todas;");
}
filtro.append("Linha: ");
Comboitem itemRuta = cmbRuta.getSelectedItem();
if (itemRuta != null) {
Ruta ruta = (Ruta) itemRuta.getValue();
parametros.put("RUTA_ID", ruta.getRutaId());
filtro.append(ruta.getDescruta() + ";");
} else {
filtro.append(" Todas;");
}
parametros.put("FILTROS", filtro.toString());
relatorio = new RelatorioTabelaPreco(parametros, dataSourceRead.getConnection());
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioTabelaPrecoController.window.title"), args, MODAL);
}
}
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception{
executarRelatorio();
}
public Datebox getDatInicial() {
return datInicial;
}
public void setDatInicial(Datebox datInicial) {
this.datInicial = datInicial;
}
public Datebox getDatFinal() {
return datFinal;
}
public void setDatFinal(Datebox datFinal) {
this.datFinal = datFinal;
}
public List<Empresa> getLsEmpresa() {
return lsEmpresa;
}
public void setLsEmpresa(List<Empresa> lsEmpresa) {
this.lsEmpresa = lsEmpresa;
}
public MyComboboxEstandar getCmbEmpresa() {
return cmbEmpresa;
}
public void setCmbEmpresa(MyComboboxEstandar cmbEmpresa) {
this.cmbEmpresa = cmbEmpresa;
}
public MyComboboxEstandar getCmbRuta() {
return cmbRuta;
}
public void setCmbRuta(MyComboboxEstandar cmbRuta) {
this.cmbRuta = cmbRuta;
}
public List<Ruta> getLsRuta() {
return lsRuta;
}
public void setLsRuta(List<Ruta> lsRuta) {
this.lsRuta = lsRuta;
}
}

View File

@ -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 ItemMenuRelatorioTabelaPreco extends DefaultItemMenuSistema {
public ItemMenuRelatorioTabelaPreco() {
super("indexController.mniRelatorioTabelaPreco.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TABELAPRECO";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioTabelaPreco.zul",
Labels.getLabel("relatorioTabelaPrecoController.window.title"), getArgs(), desktop);
}
}

View File

@ -250,6 +250,7 @@ indexController.mniRelatorioDemandas.label = Reporte de Demandas
indexController.mniRelatorioReceitaServico.label = Reporte de Ingreso por Servicio
indexController.mniRelatorioCancelamentoVendaCartao.label = Reporte Cancelación de Venta con Tarjeta
indexController.mniRelatorioCancelamentoTransacao.label = Relatório de Cancelamento de Transação
indexController.mniRelatorioTabelaPreco.label = Relátorio de Tabela de Preços
indexController.mniRelatorioAIDF.label = Reporte AIDF
indexController.mniPrecoApanhe.label = Preço Apanhe
indexController.mniRelatorioVendasPacotesResumido.label = Ventas de Paquetes - Resumido
@ -4177,6 +4178,13 @@ relatorioCancelamentoTransacaoController.btnLimpar.label = Limpar
relatorioCancelamentoTransacaoController.lbNumero.value = Número Agência
relatorioCancelamentoTransacaoController.lbBilheteiro.value = Bilheteiro
#Relatorio de Tabela Preco
relatorioTabelaPrecoController.window.title = Relatório de Tabela de Preços
relatorioTabelaPrecoController.dataInicial.value = Data Inicial
relatorioTabelaPrecoController.dataFinal.value = Data Final
relatorioTabelaPrecoController.lbEmpresa.value = Empresa
relatorioTabelaPrecoController.lbLinha.value = Linha
# Editar Motivo cancelación equivalencia
editarMotivoCancelacionEquivalenciaController.window.title = Equivalencia motivo de cancelación
editarMotivoCancelacionEquivalenciaController.btnApagar.tooltiptext = Eliminar

View File

@ -255,6 +255,7 @@ indexController.mniRelatorioDemandas.label = Relatório de Demandas
indexController.mniRelatorioReceitaServico.label = Relatório de Receita por Serviço
indexController.mniRelatorioCancelamentoVendaCartao.label = Relatório Cancelamento de Venda de Cartão
indexController.mniRelatorioCancelamentoTransacao.label = Relatório de Cancelamento de Transação
indexController.mniRelatorioTabelaPreco.label = Relátorio de Tabela de Preços
indexController.mniRelatorioAIDF.label = Relatório AIDF
indexController.mniPrecoApanhe.label = Preço Apanhe
indexController.mniRelatorioVendasPacotesResumido.label = Vendas de Pacotes - Resumido
@ -4239,6 +4240,12 @@ relatorioCancelamentoTransacaoController.btnLimpar.label = Limpar
relatorioCancelamentoTransacaoController.lbNumero.value = Número Agência
relatorioCancelamentoTransacaoController.lbBilheteiro.value = Bilheteiro
#Relatorio de Tabela Preco
relatorioTabelaPrecoController.window.title = Relatório de Tabela de Preços
relatorioTabelaPrecoController.dataInicial.value = Data Inicial
relatorioTabelaPrecoController.dataFinal.value = Data Final
relatorioTabelaPrecoController.lbEmpresa.value = Empresa
relatorioTabelaPrecoController.lbLinha.value = Linha
# Editar Motivo cancelamento equivalencia
editarMotivoCancelacionEquivalenciaController.window.title = Equivalencia Motivo de Cancelamento

View File

@ -0,0 +1,57 @@
<?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="winFiltroRelatorioTabelaPreco"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioTabelaPreco"
apply="${relatorioTabelaPrecoController}" contentStyle="overflow:auto"
height="285px" width="550px" border="normal">
<grid fixedLayout="true">
<columns>
<column width="25%" />
<column width="30%" />
<column width="15%" />
<column width="30%" />
</columns>
<rows>
<row>
<label
value="${c:l('relatorioTabelaPrecoController.dataInicial.value')}" />
<datebox id="datInicial" format="dd/MM/yyyy"
width="90%" lenient="true" constraint="no empty"
maxlength="10" />
<label
value="${c:l('relatorioTabelaPrecoController.dataFinal.value')}" />
<datebox id="datFinal" format="dd/MM/yyyy"
width="90%" lenient="true" constraint="no empty"
maxlength="10" />
</row>
<row spans="1,3">
<label
value="${c:l('relatorioTabelaPrecoController.lbEmpresa.value')}" />
<combobox id="cmbEmpresa"
buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioTabelaPreco$composer.lsEmpresa}"
width="100%" />
</row>
<row spans="1,3">
<label
value="${c:l('relatorioTabelaPrecoController.lbLinha.value')}" />
<combobox id="cmbRuta" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioTabelaPreco$composer.lsRuta}"
width="100%" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>