diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTabelaPreco.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTabelaPreco.java index 17ff1ae91..8923353a6 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTabelaPreco.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTabelaPreco.java @@ -13,7 +13,7 @@ public class RelatorioTabelaPreco extends Relatorio { public RelatorioTabelaPreco(final Map parametros, Connection conexao) throws Exception { super(parametros, conexao); - + this.setCustomDataSource(new ArrayDataSource(this) { public void initDados() throws Exception { @@ -102,7 +102,7 @@ public class RelatorioTabelaPreco extends Relatorio { sql.append(" AND r.ORGAOCONCEDENTE_ID = " + parametros.get("ORGAO_CONCEDENTE_ID")); } - sql.append( "ORDER BY r.RUTA_ID, vt.FECINICIOVIGENCIA "); + sql.append( " ORDER BY r.RUTA_ID, vt.FECINICIOVIGENCIA "); return sql.toString(); } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jasper index e8189e695..e05888f69 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 bd7e6d72d..d5276ba0f 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTabelaPreco.jrxml @@ -1,8 +1,8 @@ - - - + + + @@ -37,111 +37,78 @@ - + + + + - + - - - - - + - + - - - - - + - + - - - - - + - + - - - - - + - + - - - - - + - + - - - - - + - + - - - - - + - + - - - - - + - + - - - - - + - + @@ -153,32 +120,32 @@ - <band height="130"> + <band height="69"> <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"/> + <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="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <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="615" y="0" width="100" height="25"/> + <reportElement uuid="a9d471fb-1e1d-4d9a-9783-bbf988931192" x="656" y="0" width="65" height="25"/> <textElement textAlignment="Right"> - <font size="9" isBold="true"/> + <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="715" y="0" width="86" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <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="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <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="668" y="26" width="112" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <reportElement uuid="bae9bec6-8c42-4bee-a070-34b0a7f1aee4" mode="Transparent" x="711" y="27" width="70" height="13" 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"/> @@ -186,7 +153,7 @@ <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"/> + <reportElement uuid="314e312c-8f24-42de-8354-3c1f7241a985" mode="Transparent" x="781" y="27" width="20" height="13" 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"/> @@ -194,270 +161,159 @@ <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"/> + <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="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <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="57" width="102" height="18" isPrintWhenDetailOverflows="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="Right" verticalAlignment="Top"> - <font size="10" isBold="true" pdfFontName="Helvetica-Bold"/> + <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="102" y="57" width="699" height="18"/> - <textElement/> + <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="112" width="102" height="18" isPrintWhenDetailOverflows="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 textAlignment="Right" verticalAlignment="Top"> - <font size="10" isBold="true" pdfFontName="Helvetica-Bold"/> + <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="102" y="112" width="586" height="18"/> - <textElement/> + <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="0" y="76" width="102" height="18" isPrintWhenDetailOverflows="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="10" isBold="true" pdfFontName="Helvetica-Bold"/> + <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="102" y="76" width="70" height="18"> + <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"/> + <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="190" y="76" width="70" height="18"> + <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/> + <textElement> + <font size="8"/> + </textElement> <textFieldExpression><![CDATA[$P{VIGENCIA_FINAL}]]></textFieldExpression> </textField> <staticText> - <reportElement uuid="bdfc1a2c-9e77-418f-8169-50c67ad7f116" x="172" y="76" width="18" height="18"> + <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"/> + <textElement textAlignment="Center"> + <font size="9"/> + </textElement> <text><![CDATA[à]]></text> </staticText> <staticText> - <reportElement uuid="1bba53bd-7d81-491b-b1de-11a0c570c5c7" x="102" y="76" width="158" height="18"> + <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/> + <textElement> + <font size="9"/> + </textElement> <text><![CDATA[Todas]]></text> </staticText> <textField> - <reportElement uuid="82e75550-fae7-4cea-acf9-f9f56f083400" x="688" y="93" width="93" height="18"> - <printWhenExpression><![CDATA[false]]></printWhenExpression> - </reportElement> - <box> - <topPen lineWidth="1.0"/> - <bottomPen lineWidth="0.0"/> - </box> - <textElement textAlignment="Center" verticalAlignment="Top"> - <font size="10"/> + <reportElement uuid="0241b100-99d6-4e53-abd1-0154defc75bc" x="537" y="27" width="174" height="13"/> + <textElement> + <font size="9"/> </textElement> - <textFieldExpression><![CDATA[$R{label.empresa}]]></textFieldExpression> - </textField> - <textField isStretchWithOverflow="true"> - <reportElement uuid="abf746f7-be60-48af-9882-6723c50f4ae1" x="688" y="75" width="93" height="20"> - <printWhenExpression><![CDATA[false]]></printWhenExpression> - </reportElement> - <textElement textAlignment="Center"/> - <textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression> - </textField> - <textField> - <reportElement uuid="0241b100-99d6-4e53-abd1-0154defc75bc" x="102" y="94" width="586" height="18"/> - <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="0" y="94" width="102" height="18" isPrintWhenDetailOverflows="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 textAlignment="Right" verticalAlignment="Top"> - <font size="10" isBold="true" pdfFontName="Helvetica-Bold"/> + <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 29e3a0274..cf7270789 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 @@ -5,7 +5,9 @@ import java.util.Arrays; 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; @@ -15,6 +17,7 @@ import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; import org.zkoss.zul.Comboitem; import org.zkoss.zul.Paging; + import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente; import com.rjconsultores.ventaboletos.entidad.Ruta; @@ -100,14 +103,19 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer { parametros.put("EMPRESA", empresa.getNombempresa()); } + if (cmbOrgaoConcedente.getSelectedItem() != null) { + OrgaoConcedente orgaoConcedente = (OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue(); + parametros.put("ORGAO_CONCEDENTE_ID", orgaoConcedente.getOrgaoConcedenteId()); + parametros.put("ORGAO_CONCEDENTE", orgaoConcedente.getDescOrgao()); + } + String rutaIds = ""; String rutas = ""; List lsLinhasSelecionadas = convertTypedList(linhaSelList.getData()); if (lsLinhasSelecionadas.isEmpty()) { rutas = "Todas"; - } - else { + } else { for (int i = 0; i < lsLinhasSelecionadas.size(); i++) { Ruta ruta = lsLinhasSelecionadas.get(i); rutas += ruta.getDescruta() + ", "; @@ -163,6 +171,11 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer { Empresa empresa = (Empresa) itemEmpresa.getValue(); rutaBusqueda.addFilterEqual("lsRutaEmpresa.empresa", empresa); } + + if (cmbOrgaoConcedente.getSelectedItem() != null) { + OrgaoConcedente orgaoConcedente = (OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue(); + rutaBusqueda.addFilterEqual("orgaoConcedente", orgaoConcedente); + } rutaBusqueda.addFilterILike("descruta", "%" + txtLinha.getValue() + "%"); rutaBusqueda.addFilterEqual("activo", Boolean.TRUE); @@ -173,8 +186,7 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer { Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), Labels.getLabel("relatorioTabelaPrecoController.window.title"), Messagebox.OK, Messagebox.INFORMATION); - } - catch (InterruptedException ex) { + } catch (InterruptedException ex) { ex.printStackTrace(); } }