fixes bug#13947

qua:renato
dev:lucas

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@92638 d1611594-4594-4d17-8e1d-87c2c4800839
master
walace 2019-04-30 20:38:37 +00:00
parent 88350989f9
commit 8d4d93e224
9 changed files with 437 additions and 7 deletions

View File

@ -0,0 +1,12 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.util.Map;
public class RelatorioGratuidadeSimplificado extends RelatorioGratuidade {
public RelatorioGratuidadeSimplificado(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
}
}

View File

@ -0,0 +1,56 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
msg.a=à
#Labels header
header.periodo=Período:
header.data.hora=Data/Hora\:
header.pagina=Página\:
header.filtro=Filtro\:
header.filtro.servico=Serviço\:
header.filtro.linha=Linha\:
header.filtro.grupo=Grupo de Linhas\:
header.empresa=Empresa\:
header.periodo.viagem=Período Viagem
header.periodo.venda=Período Venda
#Labels detail
detail.data=Data
detail.dataServico=Data Serviço
detail.origen=Origem
detail.destino=Destino
detail.km=Km
detail.linha=Linha
detail.servicio=Serviço
detail.hora=Horário do Serviço
detail.tipobilhete=Tipo Venda
detail.tipopassagem=Tipo Passagem
detail.pasajero=Nome Passageiro
detail.documento=Doc
detail.precio=Preço
detail.desconto=Valor do Desconto
detail.valorCobrado=Vlr.Cobrado
detail.tarifa=Tarifa
detail.bilheteiro=Bilheteiro
detail.agencia=Agência
detail.dataMD=Data MD
detail.empresa=Empresa
detail.tipo=Tipo de Passagem
detail.tipoDoc=Tipo Doc.
detail.tarifa=Tarifa
detail.seguro=Seguro
detail.utr=UTR
detail.tpp=TPP
detail.pedagio=Pedágio
detail.rg=RG
detail.status=Status
detail.codOrigem=Cod. Origem
detail.codDestino=Cod. Destino
detail.total=Total
detail.ccf=CCf
linhas=Linhas
detail.numfoliosistema=Bilhete
detail.numasiento=Poltrona

View File

@ -0,0 +1,56 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
msg.a=à
#Labels header
header.periodo=Período:
header.data.hora=Data/Hora\:
header.pagina=Página\:
header.filtro=Filtro\:
header.filtro.servico=Serviço\:
header.filtro.linha=Linha\:
header.filtro.grupo=Grupo de Linhas\:
header.empresa=Empresa\:
header.periodo.viagem=Período Viagem
header.periodo.venda=Período Venda
#Labels detail
detail.data=Data
detail.dataServico=Data Serviço
detail.origen=Origem
detail.destino=Destino
detail.km=Km
detail.linha=Linha
detail.servicio=Serviço
detail.hora=Horário do Serviço
detail.tipobilhete=Tipo Venda
detail.tipopassagem=Tipo Passagem
detail.pasajero=Nome Passageiro
detail.documento=Doc
detail.precio=Preço
detail.desconto=Valor do Desconto
detail.valorCobrado=Vlr.Cobrado
detail.tarifa=Tarifa
detail.bilheteiro=Bilheteiro
detail.agencia=Agência
detail.dataMD=Data
detail.empresa=Empresa
detail.tipo=Tipo de Passagem
detail.tipoDoc=Tipo Doc.
detail.tarifa=Tarifa
detail.seguro=Seguro
detail.utr=UTR
detail.tpp=TPP
detail.pedagio=Pedágio
detail.rg=RG
detail.status=Status
detail.codOrigem=Cod. Origem
detail.codDestino=Cod. Destino
detail.total=Total
detail.ccf=CCf
linhas=Linhas
detail.numfoliosistema=Bilhete
detail.numasiento=Poltrona

View File

@ -0,0 +1,286 @@
<?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="RelatorioEmpresaCorrida" pageWidth="1152" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="1132" leftMargin="10" rightMargin="10" topMargin="20" bottomMargin="20" resourceBundle="RelatorioEmpresaCorrida" whenResourceMissingType="Empty" uuid="94834362-0ecc-46da-b0a2-5cdee355da3e">
<property name="ireport.zoom" value="4.707642565081503"/>
<property name="ireport.x" value="37"/>
<property name="ireport.y" value="872"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageHeader"/>
<parameter name="fecInicioViagem" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="NOMBEMPRESA" class="java.lang.String"/>
<parameter name="fecFinalViagem" class="java.lang.String"/>
<parameter name="USUARIO_ID" class="java.lang.String"/>
<parameter name="LINHA_FILTRO" class="java.lang.String"/>
<parameter name="SERVICO_FILTRO" class="java.lang.String"/>
<parameter name="TITULO" class="java.lang.String"/>
<parameter name="fecInicioVenda" class="java.lang.String"/>
<parameter name="fecFinalVenda" class="java.lang.String"/>
<parameter name="nomb_empresa" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="feccreacion" class="java.util.Date"/>
<field name="origen" class="java.lang.String"/>
<field name="destino" class="java.lang.String"/>
<field name="km" class="java.lang.Integer"/>
<field name="linha" class="java.lang.String"/>
<field name="corridaId" class="java.lang.String"/>
<field name="fechorviaje" class="java.lang.String"/>
<field name="desctipoventa" class="java.lang.String"/>
<field name="nombpasajero" class="java.lang.String"/>
<field name="descnumdoc" class="java.lang.String"/>
<field name="preciooriginal" class="java.math.BigDecimal"/>
<field name="porccategoria" class="java.math.BigDecimal"/>
<field name="preciopagado" class="java.math.BigDecimal"/>
<field name="cveusuario" class="java.lang.String"/>
<field name="nombpuntoventa" class="java.lang.String"/>
<field name="nombempresa" class="java.lang.String"/>
<field name="cvecategoria" class="java.lang.String"/>
<field name="numasiento" class="java.lang.String"/>
<field name="descorigen" class="java.lang.String"/>
<field name="descdestino" class="java.lang.String"/>
<field name="numfoliosistema" class="java.lang.String"/>
<field name="tipo" class="java.lang.String"/>
<field name="tipoDoc" class="java.lang.String"/>
<field name="seguro" class="java.math.BigDecimal"/>
<field name="utr" class="java.math.BigDecimal"/>
<field name="pedagio" class="java.math.BigDecimal"/>
<field name="tpp" class="java.lang.String"/>
<field name="status" class="java.lang.String"/>
<field name="dataMd" class="java.lang.String"/>
<field name="codOrigem" class="java.lang.String"/>
<field name="codDestino" class="java.lang.String"/>
<field name="descorgao" class="java.lang.String"/>
<field name="ccf" class="java.lang.String"/>
<field name="tarifa" class="java.math.BigDecimal"/>
<field name="fecdatviaje" class="java.lang.String"/>
<variable name="qtde" class="java.lang.Integer" calculation="Count">
<variableExpression><![CDATA[$F{km}]]></variableExpression>
</variable>
<variable name="total_sem_desconto" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{preciooriginal}]]></variableExpression>
</variable>
<variable name="total_com_desconto" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{porccategoria}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="144">
<textField>
<reportElement x="0" y="0" width="318" height="37" uuid="652312bd-292a-424d-a234-5f157e3699c6"/>
<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="37" width="148" height="23" uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716"/>
<textFieldExpression><![CDATA[$R{header.periodo.viagem}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="739" y="37" width="72" height="23" uuid="66b2d0f6-2bf1-4bc7-9ec0-a34444e04d60"/>
<textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="1070" y="37" width="62" height="23" uuid="8ca68351-fc00-4f19-b94f-f2fd1f41964f"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="930" y="37" width="95" height="23" uuid="be1692e9-f130-4d08-9173-6ca3e4699030"/>
<textFieldExpression><![CDATA[$R{header.pagina}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="148" y="37" width="170" height="23" uuid="4914d9e7-6ce8-4512-b1f8-13f3b572ac50"/>
<textFieldExpression><![CDATA[( $P{fecInicioViagem} != null ? ($P{fecInicioViagem} + " à " + $P{fecFinalViagem}) : "" )]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="811" y="37" width="119" height="23" uuid="6f671365-868e-41a6-81ee-a308d1d91e1d"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="1025" y="37" width="45" height="23" uuid="7548d623-fb6c-48d4-b8b7-504f5437a79a"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="60" width="148" height="21" uuid="a79c03e0-bbe4-4b1c-8297-533a0d137b27"/>
<textFieldExpression><![CDATA[$R{header.periodo.venda}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="148" y="60" width="170" height="21" uuid="b31b00a3-1ced-4f9c-acb7-470646f7b335"/>
<textFieldExpression><![CDATA[( $P{fecInicioVenda} != null ? ($P{fecInicioVenda} + " à " + $P{fecFinalVenda}) : "" )]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="81" width="148" height="20" uuid="8fb67bb3-6ff2-40d1-b338-714f199ea7f0"/>
<textFieldExpression><![CDATA[$R{header.empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="1" y="114" width="147" height="26" uuid="2c09f3ff-c554-4ce2-886e-eaab93fa15eb"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.origen}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="148" y="114" width="170" height="26" uuid="e18edb89-17f4-417e-8041-664f11245cbd"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.destino}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="739" y="114" width="72" height="26" uuid="0948a2fc-fc39-4f2d-ab06-d7c97a66df39"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.numasiento}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="318" y="114" width="96" height="26" uuid="c4b5d11d-79a1-4850-8294-8ccaa0898bca"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.numfoliosistema}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="414" y="114" width="93" height="26" uuid="2af7bea7-e8bf-424a-9813-c9d2be7c0459"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.dataMD}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="930" y="114" width="95" height="27" uuid="7b62e459-04bc-4227-be76-24bf5938d552"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.tipo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="1025" y="114" width="107" height="26" uuid="17200d3a-6195-42d1-bc36-ff2baffb56ce"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.hora}]]></textFieldExpression>
</textField>
<line>
<reportElement x="1" y="140" width="1131" height="1" uuid="8e2d6686-e4d7-43d5-b3a9-46adc3e58350"/>
</line>
<textField>
<reportElement x="148" y="81" width="170" height="20" uuid="3541e1b0-8dfe-404e-9461-64d10d85531a"/>
<textFieldExpression><![CDATA[$P{nomb_empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="811" y="114" width="119" height="26" uuid="c79866b7-1c62-4d05-99ac-7149916a1a03"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.desconto}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="507" y="114" width="232" height="26" uuid="ba5886a6-f2fe-4bec-a845-96569ac6e9ee"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.pasajero}]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band splitType="Stretch"/>
</columnHeader>
<detail>
<band height="26" splitType="Prevent">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="148" y="2" width="170" height="23" uuid="3343aea7-212b-4bd5-a29c-8dcab3cb7568"/>
<textElement textAlignment="Left">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{descdestino}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00;-###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="739" y="2" width="72" height="23" uuid="8b89e606-e89c-4b3d-a5b5-4dfd339de5df"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{numasiento}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="930" y="2" width="95" height="23" uuid="d75d9725-26ac-47f5-94db-995e5b49f30a"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{tipo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00;-###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="318" y="2" width="96" height="23" uuid="4177f54f-ba97-4731-8c32-c8fc23ce483a"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{numfoliosistema}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="HH:mm:ss" isBlankWhenNull="true">
<reportElement x="1025" y="2" width="107" height="23" uuid="dfd8ec54-db1c-49c7-b293-cd387e04dbb9"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{fechorviaje}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00;-###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="811" y="2" width="119" height="23" uuid="097c36a4-362e-4e10-80c0-8a98adc099ef"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{porccategoria}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="507" y="2" width="232" height="23" uuid="6f7d8ea1-045a-49f7-a70b-05473e21ef02"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{nombpasajero}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement x="414" y="2" width="93" height="23" uuid="230fcb25-af91-4a54-b98e-a4477a3f5935"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{feccreacion}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="1" y="2" width="147" height="23" uuid="b36dbddb-2fa9-48a5-809e-0e15ad54c529"/>
<textElement textAlignment="Left">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{descorigen}]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band height="18">
<textField>
<reportElement x="0" y="0" width="148" height="18" uuid="5fdd8d50-c70b-4a5c-9621-5b91642257bf"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{detail.total}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="195" y="0" width="62" height="18" uuid="6005f63d-1abc-408d-9af2-adea341fadda"/>
<textFieldExpression><![CDATA[$V{qtde}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00;-###0.00" isBlankWhenNull="true">
<reportElement x="811" y="0" width="119" height="18" uuid="779b8652-d8e3-4b84-85f2-d37ef88488b9"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$V{total_com_desconto}]]></textFieldExpression>
</textField>
</band>
</summary>
<noData>
<band height="25">
<textField>
<reportElement x="0" y="0" width="1132" height="20" uuid="5a6c1b7b-2242-4cf1-b957-723b906ee620"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -26,6 +26,7 @@ import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioGratuidade;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioGratuidadeSimplificado;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.CategoriaService;
import com.rjconsultores.ventaboletos.service.EmpresaService;
@ -106,12 +107,15 @@ public class RelatorioGratuidadeController extends MyGenericForwardComposer {
public void setListSelectedTipoGratuidade(List<Categoria> listSelectedTipoGratuidade) {
this.listSelectedTipoGratuidade = listSelectedTipoGratuidade;
}
private void executarRelatorio() throws Exception {
private void executarRelatorio(boolean isAnalitico) throws Exception {
Map<String, Object> parametros = new HashMap<String, Object>();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
parametros.put("isAnalitico", true);
if (this.datInicialViagem.getValue() != null) {
parametros.put("fecInicioViagem", sdf.format(this.datInicialViagem.getValue()));
}
@ -208,8 +212,13 @@ public class RelatorioGratuidadeController extends MyGenericForwardComposer {
parametros.put("TITULO", Labels.getLabel("relatorioGratuidadeController.window.title"));
carregarParametroMotivoCancelamentoAlteracaoPoltrona(parametros);
Relatorio relatorio = new RelatorioGratuidade(parametros, dataSourceRead.getConnection());
Relatorio relatorio;
if(isAnalitico) {
relatorio = new RelatorioGratuidade(parametros, dataSourceRead.getConnection());
}else {
relatorio = new RelatorioGratuidadeSimplificado(parametros, dataSourceRead.getConnection());
}
Map<String, Object> args = new HashMap<String, Object>();
args.put("relatorio", relatorio);
@ -226,8 +235,11 @@ public class RelatorioGratuidadeController extends MyGenericForwardComposer {
}
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
public void onClick$btnExecutarRelatorioAnalitico(Event ev) throws Exception {
executarRelatorio(true);
}
public void onClick$btnExecutarRelatorioSimplificado(Event ev) throws Exception {
executarRelatorio(false);
}
@Override

View File

@ -6783,6 +6783,8 @@ relatorioGratuidadeController.lbTipoGratuidade.value = Tipo de Gratuidade
relatorioGratuidadeController.lbDataIni.value = Fecha Inicio
relatorioGratuidadeController.lbDataFin.value = Fecha Final
relatorioGratuidadeController.orgao = Orgão
relatorioGratuidadeController.btnExecutarRelatorio = Ejecutar Reporte Análitico
relatorioGratuidadeController.btnExecutarRelatorioSimplificado = Ejecutar Reporte Análitico Simplificado
# Reporte Gratuidade ANTT
relatorioGratuidadeANTTController.window.title = Reporte Gratuidade ANTT

View File

@ -7123,6 +7123,8 @@ relatorioGratuidadeController.lbDataIniVenda.value = Data Inicio
relatorioGratuidadeController.lbDataFinVenda.value = Data Final
relatorioGratuidadeController.lvVenda = Venda
relatorioGratuidadeController.orgao = Orgão
relatorioGratuidadeController.btnExecutarRelatorio = Executar Relatorio Analítico
relatorioGratuidadeController.btnExecutarRelatorioSimplificado = Executar Relatorio Analítico Simplificado
# Relatório Gratuidade ANTT
relatorioGratuidadeANTTController.window.title = Relatório Gratuidades ANTT

View File

@ -148,8 +148,12 @@
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
<button id="btnExecutarRelatorioAnalitico"
image="/gui/img/find.png"
label="${c:l('relatorioGratuidadeController.btnExecutarRelatorio')}" />
<button id="btnExecutarRelatorioSimplificado"
image="/gui/img/find.png"
label="${c:l('relatorioGratuidadeController.btnExecutarRelatorioSimplificado')}" />
</toolbar>
</window>
</zk>