diff --git a/pom.xml b/pom.xml index af05899c1..d920c3cb5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores ventaboletosadm - 1.2.2 + 1.3.0 war diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTabelaPreco.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTabelaPreco.java index 87ce73ec7..92b491d60 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTabelaPreco.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTabelaPreco.java @@ -29,7 +29,7 @@ public class RelatorioTabelaPreco extends Relatorio { this.setCustomDataSource(new ArrayDataSource(this) { - @Override + @Override public void initDados() throws Exception { Connection conexao = this.relatorio.getConexao(); NamedParameterStatement stmt = new NamedParameterStatement(conexao, getSql()); @@ -47,24 +47,28 @@ public class RelatorioTabelaPreco extends Relatorio { series, (Integer) parametros.get(ORGAO_CONCEDENTE))); } + dataResult.put("cveorigem", rset.getString("cveorigem")); + dataResult.put("cvedestino", rset.getString("cvedestino")); dataResult.put("origem", rset.getString("origem")); dataResult.put("destino", rset.getString("destino")); + dataResult.put("aliasorigem", rset.getString("aliasorigem")); + dataResult.put("aliasdestino", rset.getString("aliasdestino")); dataResult.put("tarifa", rset.getBigDecimal("tarifa")); dataResult.put("pedagio", rset.getBigDecimal("pedagio")); dataResult.put("taxaEmbarque", rset.getBigDecimal("taxaEmbarque")); - dataResult.put("outros", rset.getBigDecimal("outros")); dataResult.put("tipoClasse", rset.getString("tipoClasse")); dataResult.put("empresa", rset.getString("empresa")); - - if (!isLayoutArtesp) { - dataResult.put("seguro", rset.getBigDecimal("seguro")); - dataResult.put("linha", rset.getString("linha")); - dataResult.put("dataVigenciaInicial", rset.getDate("dataVigenciaInicial")); - dataResult.put("dataVigenciaFinal", rset.getDate("dataVigenciaFinal")); - dataResult.put("idLinha", rset.getInt("idLinha")); - dataResult.put("idVigencia", rset.getInt("idVigencia")); - } + + dataResult.put("seguro", rset.getBigDecimal("seguro")); + dataResult.put("linha", rset.getString("linha")); + dataResult.put("prefixo", rset.getString("prefixo")); + dataResult.put("dataVigenciaInicial", rset.getDate("dataVigenciaInicial")); + dataResult.put("dataVigenciaFinal", rset.getDate("dataVigenciaFinal")); + dataResult.put("idLinha", rset.getInt("idLinha")); + dataResult.put("idVigencia", rset.getInt("idVigencia")); + dataResult.put("orgao", rset.getString("orgao")); + this.dados.add(dataResult); } @@ -96,33 +100,48 @@ public class RelatorioTabelaPreco extends Relatorio { if (isLayoutArtesp) { sql.append("SELECT DISTINCT origem,destino,tarifa,pedagio,taxaEmbarque,outros,tipoClasse,empresa,kmReal FROM ("); } - 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 as dataVigenciaInicial, "); - sql.append(" vt.FECFINVIGENCIA as dataVigenciaFinal, "); - sql.append(" vt.VIGENCIATARIFA_ID as idVigencia, "); - sql.append(" vt.FECINICIOVIGENCIA as dataVigenciaInicial, "); - sql.append(" r.RUTA_ID as idLinha, "); - sql.append(" tr.CANTKMREAL as kmReal "); - 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("INNER JOIN RUTA_COMBINACION rc ON rc.RUTA_ID = r.RUTA_ID "); - sql.append("INNER JOIN TRAMO tr ON tr.TRAMO_ID = rc.TRAMO_ID "); - sql.append("INNER JOIN ORGAO_CONCEDENTE o ON o.ORGAOCONCEDENTE_ID = r.ORGAOCONCEDENTE_ID "); + sql.append(" SELECT "); + sql.append(" po.cveparada as cveorigem, "); + sql.append(" pd.cveparada as cvedestino, "); + sql.append(" po.DESCPARADA as origem, "); + sql.append(" pd.DESCPARADA as destino, "); + sql.append(" pos.DESCPARADA as aliasorigem, "); + sql.append(" pds.DESCPARADA as aliasdestino, "); + 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(" r.prefixo as prefixo, "); + sql.append(" e.NOMBEMPRESA as empresa, "); + sql.append(" vt.FECINICIOVIGENCIA as dataVigenciaInicial, "); + sql.append(" vt.FECFINVIGENCIA as dataVigenciaFinal, "); + sql.append(" vt.VIGENCIATARIFA_ID as idVigencia, "); + sql.append(" vt.FECINICIOVIGENCIA as dataVigenciaInicial, "); + sql.append(" r.RUTA_ID as idLinha, "); + sql.append(" tr.CANTKMREAL as kmReal, "); + sql.append(" o.descorgao as orgao "); + sql.append(" FROM TARIFA t "); + sql.append(" INNER JOIN PARADA po ON t.ORIGEN_ID = po.PARADA_ID "); + sql.append(" INNER JOIN PARADA pd ON t.DESTINO_ID = pd.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(" INNER JOIN RUTA_COMBINACION rc ON rc.RUTA_ID = r.RUTA_ID "); + sql.append(" INNER JOIN TRAMO tr ON tr.TRAMO_ID = rc.TRAMO_ID "); + sql.append(" INNER JOIN ORGAO_CONCEDENTE o ON o.ORGAOCONCEDENTE_ID = r.ORGAOCONCEDENTE_ID "); + + sql.append(" LEFT JOIN alias_servico s ON s.ORIGEN_ID = t.ORIGEN_ID "); + sql.append(" AND s.DESTINO_ID = t.DESTINO_ID "); + sql.append(" AND s.RUTA_ID = r.RUTA_ID "); + sql.append(" AND s.activo = 1 "); + sql.append(" LEFT JOIN parada pos ON POS.PARADA_ID = S.ALIASORIGEN_ID "); + sql.append(" LEFT JOIN parada pds ON PDS.PARADA_ID = S.ALIASDESTINO_ID "); + sql.append("WHERE rc.INDVENTA = 1 "); sql.append("AND rc.ACTIVO = 1 "); sql.append("AND tr.ACTIVO = 1 "); @@ -131,8 +150,8 @@ public class RelatorioTabelaPreco extends Relatorio { sql.append(" AND rc.indexibetabela = 1 "); } - sql.append("AND tr.ORIGEN_ID = t.ORIGEN_ID "); - sql.append("AND tr.DESTINO_ID = t.DESTINO_ID "); + sql.append(" AND tr.ORIGEN_ID = t.ORIGEN_ID "); + sql.append(" AND tr.DESTINO_ID = t.DESTINO_ID "); sql.append(" AND vt.VIGENCIATARIFA_ID = " + parametros.get("VIGENCIA_ID")); sql.append(" AND e.empresa_id = " + parametros.get("EMPRESA_ID")); @@ -153,7 +172,7 @@ public class RelatorioTabelaPreco extends Relatorio { sql.append(" AND tr.DESTINO_ID= " + parametros.get("destinoId")); } - sql.append(" ORDER BY r.RUTA_ID, vt.FECINICIOVIGENCIA"); + sql.append(" ORDER BY r.DESCRUTA, vt.FECINICIOVIGENCIA"); if (isLayoutArtesp) { sql.append(") ORDER BY origem,destino"); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioTabelaPreco_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioTabelaPreco_es.properties index b6c693ebd..37510b651 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioTabelaPreco_es.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioTabelaPreco_es.properties @@ -15,14 +15,20 @@ cabecalho.filtros=Filtros: #Labels header label.origem=Origem label.destino=Destino +label.origemalias=Origem Alias +label.destinoalias=Destino Alias label.tarifa=Tarifa label.pedagio=Pedágio label.taxaEmbarque=Taxa label.seguro=Seguro label.outros=Outros label.tipoClasse=Classe -label.linha=Linha(s) -label.empresa=Empresa -label.dataVigencia=Vigência +label.linha=Linha: +label.linhas=Linhas: +label.empresa=Empresa: +label.dataVigencia=Vigência: label.total=Total -label.orgacaoConcedente=Orgão Concedente \ No newline at end of file +label.totalSeg=Total c/ Seg +label.cve=CVE +label.prefixo=Prefixo: +label.orgacaoConcedente=Orgão Concedente: \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioTabelaPreco_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioTabelaPreco_pt_BR.properties index b6c693ebd..37510b651 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioTabelaPreco_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioTabelaPreco_pt_BR.properties @@ -15,14 +15,20 @@ cabecalho.filtros=Filtros: #Labels header label.origem=Origem label.destino=Destino +label.origemalias=Origem Alias +label.destinoalias=Destino Alias label.tarifa=Tarifa label.pedagio=Pedágio label.taxaEmbarque=Taxa label.seguro=Seguro label.outros=Outros label.tipoClasse=Classe -label.linha=Linha(s) -label.empresa=Empresa -label.dataVigencia=Vigência +label.linha=Linha: +label.linhas=Linhas: +label.empresa=Empresa: +label.dataVigencia=Vigência: label.total=Total -label.orgacaoConcedente=Orgão Concedente \ No newline at end of file +label.totalSeg=Total c/ Seg +label.cve=CVE +label.prefixo=Prefixo: +label.orgacaoConcedente=Orgão Concedente: \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jasper index 6a58a3370..44e7cb8db 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jrxml index d5276ba0f..28f281dad 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jrxml @@ -1,10 +1,13 @@ - - + + - - - + + + + + + @@ -17,102 +20,210 @@ + + + + + + + - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + - + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -120,215 +231,176 @@ - <band height="69"> + <band height="67"> <textField pattern="" isBlankWhenNull="false"> - <reportElement uuid="136a5066-d141-4362-af36-0780f0d16542" mode="Transparent" x="0" y="0" width="563" height="25" forecolor="#000000" backcolor="#FFFFFF"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> - <font fontName="SansSerif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> - <paragraph lineSpacing="Single"/> - </textElement> - <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> - </textField> - <textField> - <reportElement uuid="a9d471fb-1e1d-4d9a-9783-bbf988931192" x="656" y="0" width="65" height="25"/> - <textElement textAlignment="Right"> - <font size="8" 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="721" y="0" width="80" height="25" forecolor="#000000" backcolor="#FFFFFF"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> - <font fontName="SansSerif" size="8" 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="711" y="27" width="70" height="13" forecolor="#000000" backcolor="#FFFFFF"/> + <reportElement uuid="0f6ea959-18ce-45fc-be6c-a814a0476c4e" mode="Transparent" x="963" y="15" width="270" height="16" 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="27" width="20" height="13" forecolor="#000000" backcolor="#FFFFFF"/> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="038efca4-bebf-4d0e-9486-3bfb9680faf7" mode="Transparent" x="0" y="0" width="963" height="46" forecolor="#000000" backcolor="#FFFFFF"/> <textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="16" 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="ad4046fb-5ef4-410f-85a5-17cca2f7cf4c" stretchType="RelativeToBandHeight" mode="Transparent" x="963" y="31" width="296" 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.impressorPor}+" "+$P{USUARIO_NOME}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="1e11c007-fe9f-4ae1-b7dd-5b3574ef9cee" x="963" y="0" width="214" height="15"/> + <textElement textAlignment="Right"> + <font size="9" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="9eee37bf-9dc9-441c-96f7-01562efffce8" x="0" y="46" width="1259" height="21"/> + <box leftPadding="2"> + <topPen lineWidth="0.75"/> + <bottomPen lineWidth="0.75"/> + </box> + <textElement verticalAlignment="Middle"> + <font size="12" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false"> + <reportElement uuid="d925825f-4cfd-4dd0-8088-20a6810f1a48" mode="Transparent" x="1179" y="0" width="80" 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[new java.util.Date()]]></textFieldExpression> + </textField> + <textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> + <reportElement uuid="27212e2f-7312-4bd4-b218-d9aef0e24a14" mode="Transparent" x="1233" y="15" width="26" height="16" 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[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> - <textField pattern="" isBlankWhenNull="false"> - <reportElement uuid="4e030613-9cee-443e-9eaa-b19fa3090976" mode="Transparent" x="563" y="0" width="93" height="25" forecolor="#000000" backcolor="#FFFFFF"/> - <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> - <font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> - <paragraph lineSpacing="Single"/> - </textElement> - <textFieldExpression><![CDATA[$R{cabecalho.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression> - </textField> - <textField isStretchWithOverflow="true"> - <reportElement uuid="64027797-62dc-4e02-8e40-958ac1511e0a" x="0" y="27" width="62" height="13" isPrintWhenDetailOverflows="true"/> - <box> - <bottomPen lineWidth="0.0"/> - </box> - <textElement textAlignment="Justified" verticalAlignment="Top"> - <font size="9" isBold="true" pdfFontName="Helvetica-Bold"/> - </textElement> - <textFieldExpression><![CDATA[$R{label.empresa} + ":"]]></textFieldExpression> - </textField> - <textField> - <reportElement uuid="bcd47f18-94dc-4d33-96db-6d89795188d3" x="62" y="27" width="148" height="13"/> - <textElement> - <font size="9"/> - </textElement> - <textFieldExpression><![CDATA[$P{EMPRESA_ID} == null ? -"Todas" : -($P{EMPRESA_ID}.toString() + " - " + $P{EMPRESA})]]></textFieldExpression> - </textField> - <textField isStretchWithOverflow="true"> - <reportElement uuid="049832ef-f634-42f9-95b1-ac2e1fe23b10" x="0" y="40" width="62" height="13" isPrintWhenDetailOverflows="true"/> - <box> - <bottomPen lineWidth="0.0"/> - </box> - <textElement verticalAlignment="Top"> - <font size="9" isBold="true" pdfFontName="Helvetica-Bold"/> - </textElement> - <textFieldExpression><![CDATA[$R{label.linha} + ":"]]></textFieldExpression> - </textField> - <textField isStretchWithOverflow="true"> - <reportElement uuid="df6b8946-988c-479c-8eeb-c8d40c94734b" x="62" y="40" width="739" height="13"/> - <textElement> - <font size="9"/> - </textElement> - <textFieldExpression><![CDATA[$P{LINHAS}]]></textFieldExpression> - </textField> - <textField isStretchWithOverflow="true"> - <reportElement uuid="2d048310-1ec5-4711-b402-75ef3d3500d4" x="210" y="27" width="75" height="13" isPrintWhenDetailOverflows="true"/> - <box> - <bottomPen lineWidth="0.0"/> - </box> - <textElement textAlignment="Right" verticalAlignment="Top"> - <font size="9" isBold="true" pdfFontName="Helvetica-Bold"/> - </textElement> - <textFieldExpression><![CDATA[$R{label.dataVigencia} + ":"]]></textFieldExpression> - </textField> - <textField pattern="dd/MM/yyyy"> - <reportElement uuid="40c47b73-ef86-4b76-a4bb-ec284d4e6f59" x="285" y="27" width="70" height="13"> - <printWhenExpression><![CDATA[new Boolean($P{VIGENCIA_ID} != null)]]></printWhenExpression> - </reportElement> - <textElement textAlignment="Right"> - <font size="9"/> - </textElement> - <textFieldExpression><![CDATA[$P{VIGENCIA_INICIAL}]]></textFieldExpression> - </textField> - <textField pattern="dd/MM/yyyy"> - <reportElement uuid="12564f32-d986-46a6-a184-23b23ba50bcb" x="373" y="27" width="70" height="13"> - <printWhenExpression><![CDATA[new Boolean($P{VIGENCIA_ID} != null)]]></printWhenExpression> - </reportElement> - <textElement> - <font size="8"/> - </textElement> - <textFieldExpression><![CDATA[$P{VIGENCIA_FINAL}]]></textFieldExpression> - </textField> - <staticText> - <reportElement uuid="bdfc1a2c-9e77-418f-8169-50c67ad7f116" x="355" y="27" width="18" height="12"> - <printWhenExpression><![CDATA[new Boolean($P{VIGENCIA_ID} != null)]]></printWhenExpression> - </reportElement> - <textElement textAlignment="Center"> - <font size="9"/> - </textElement> - <text><![CDATA[à]]></text> - </staticText> - <staticText> - <reportElement uuid="1bba53bd-7d81-491b-b1de-11a0c570c5c7" x="285" y="27" width="158" height="13"> - <printWhenExpression><![CDATA[new Boolean($P{VIGENCIA_ID} == null)]]></printWhenExpression> - </reportElement> - <textElement> - <font size="9"/> - </textElement> - <text><![CDATA[Todas]]></text> - </staticText> - <textField> - <reportElement uuid="0241b100-99d6-4e53-abd1-0154defc75bc" x="537" y="27" width="174" height="13"/> - <textElement> - <font size="9"/> - </textElement> - <textFieldExpression><![CDATA[$P{ORGAO_CONCEDENTE_ID} == null ? -"Todas" : $P{ORGAO_CONCEDENTE}]]></textFieldExpression> - </textField> - <textField isStretchWithOverflow="true"> - <reportElement uuid="afabe5dc-df90-4120-a42a-af1d3e6df583" x="444" y="27" width="93" height="13" isPrintWhenDetailOverflows="true"/> - <box> - <bottomPen lineWidth="0.0"/> - </box> - <textElement verticalAlignment="Top"> - <font size="9" isBold="true" pdfFontName="Helvetica-Bold"/> - </textElement> - <textFieldExpression><![CDATA[$R{label.orgacaoConcedente} + ":"]]></textFieldExpression> - </textField> </band> - - - - + + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioTabelaPrecoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioTabelaPrecoController.java index 228b7db4f..1f58a1f80 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioTabelaPrecoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioTabelaPrecoController.java @@ -1,5 +1,6 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -102,39 +103,67 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer { private void executarRelatorio() throws Exception { Map parametros = new HashMap(); + StringBuilder filtro = new StringBuilder(); parametros.put("NOME_RELATORIO", Labels.getLabel(TITULO)); parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString()); parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario()); Comboitem itemVigencia = cmbVigencia.getSelectedItem(); + filtro.append("Vigencia: "); if (itemVigencia != null) { + VigenciaTarifa vigencia = (VigenciaTarifa) itemVigencia.getValue(); parametros.put("VIGENCIA_ID", vigencia.getVigenciatarifaId()); parametros.put("VIGENCIA_INICIAL", vigencia.getFeciniciovigencia()); parametros.put("VIGENCIA_FINAL", vigencia.getFecfinvigencia()); + + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + filtro.append( sdf.format(vigencia.getFeciniciovigencia()) ); + filtro.append( " à " ); + filtro.append( sdf.format(vigencia.getFecfinvigencia()) ); + }else { + filtro.append(" Todas;"); } Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + filtro.append(" Empresa: "); if (itemEmpresa != null) { Empresa empresa = (Empresa) itemEmpresa.getValue(); parametros.put("EMPRESA_ID", empresa.getEmpresaId()); parametros.put("EMPRESA", empresa.getNombempresa()); parametros.put("MARCA",marcaService.buscarMarcaPorEmpresa(Arrays.asList(empresa)).get(0)); + + filtro.append(empresa.getNombempresa() + ";"); + }else { + filtro.append(" Todas;"); } + filtro.append(" Orgão Concedente: "); if (cmbOrgaoConcedente.getSelectedItem() != null) { OrgaoConcedente orgaoConcedente = (OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue(); parametros.put("ORGAO_CONCEDENTE_ID", orgaoConcedente.getOrgaoConcedenteId()); parametros.put("ORGAO_CONCEDENTE", orgaoConcedente.getDescOrgao()); + + filtro.append(orgaoConcedente.getDescOrgao() + ";"); + }else { + filtro.append(" Todos;"); } + filtro.append(" Origem: "); if (cmbOrigem.getSelectedItem() != null) { parametros.put("origemId", cmbOrigem.getSelectedObject().getParadaId()); + filtro.append(cmbOrigem.getSelectedObject().getDescparada()); + }else { + filtro.append(" Todas;"); } + filtro.append(" Destino: "); if (cmbDestino.getSelectedItem() != null) { parametros.put("destinoId", cmbDestino.getSelecteObject(Parada.class).getParadaId()); + filtro.append(cmbDestino.getSelecteObject(Parada.class).getDescparada()); + }else { + filtro.append(" Todos;"); } parametros.put("isLayoutArtesp", chkLayoutArtesp.isChecked()); @@ -143,8 +172,9 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer { String rutas = ""; List lsLinhasSelecionadas = convertTypedList(linhaSelList.getData()); + filtro.append(" Linhas: "); if (lsLinhasSelecionadas.isEmpty()) { - rutas = "Todas"; + rutas = " Todas;"; } else { for (int i = 0; i < lsLinhasSelecionadas.size(); i++) { Ruta ruta = lsLinhasSelecionadas.get(i); @@ -155,10 +185,14 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer { rutaIds = rutaIds.substring(0, rutaIds.length() - 1); rutas = rutas.substring(0, rutas.length() - 2); parametros.put("LINHAS_ID", rutaIds); + } + filtro.append( rutas); parametros.put("LINHAS", rutas); - Relatorio relatorio = new RelatorioTabelaPreco(parametros, dataSourceRead.getConnection(), segVKMService); + parametros.put("FILTROS", filtro.toString()); + + Relatorio relatorio = new RelatorioTabelaPreco(parametros, dataSourceRead.getConnection(), segVKMService); Map args = new HashMap(); args.put("relatorio", relatorio);