diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioEmpresaCorrida.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioEmpresaCorrida.java index 4224f3b9a..8c9747b1d 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioEmpresaCorrida.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioEmpresaCorrida.java @@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.relatorios.impl; import java.sql.Connection; import java.sql.ResultSet; +import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; @@ -57,15 +58,9 @@ public class RelatorioEmpresaCorrida extends Relatorio { log.info("Preenchendo bean:" + System.currentTimeMillis()); while (rset.next()) { - RelatorioEmpresaCorridaBean rec = new RelatorioEmpresaCorridaBean(); - rec.setRutaId(rset.getInt("ruta_id")); - rec.setAbonos(rset.getBigDecimal("abonos")); - rec.setBoletos(rset.getBigDecimal("boletos")); - rec.setEmpresa(rset.getString("nombempresa")); - rec.setLinea(rset.getString("linea")); - rec.setPasajerosTransportados(rset.getInt("passageirosTransp")); - - lsDadosRelatorio.add(rec); + RelatorioEmpresaCorridaBean bean = new RelatorioEmpresaCorridaBean(); + setDadosBean(rset, bean); + lsDadosRelatorio.add(bean); } log.info("Fim bean:" + System.currentTimeMillis()); @@ -105,8 +100,18 @@ public class RelatorioEmpresaCorrida extends Relatorio { setLsDadosRelatorio(lsAux); } } + }); } + + protected void setDadosBean(ResultSet rset, RelatorioEmpresaCorridaBean bean) throws SQLException { + bean.setRutaId(rset.getInt("ruta_id")); + bean.setAbonos(rset.getBigDecimal("abonos")); + bean.setBoletos(rset.getBigDecimal("boletos")); + bean.setEmpresa(rset.getString("nombempresa")); + bean.setLinea(rset.getString("linea")); + bean.setPasajerosTransportados(rset.getInt("passageirosTransp")); + } public void setLsDadosRelatorio(List lsDadosRelatorio) { this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); @@ -125,7 +130,7 @@ public class RelatorioEmpresaCorrida extends Relatorio { return null; } - private String getSql(String empresa) { + protected String getSql(String empresa) { StringBuilder sql = new StringBuilder(); sql.append("SELECT "); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioEmpresaCorridaNovoLayout.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioEmpresaCorridaNovoLayout.java new file mode 100644 index 000000000..303fa241a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioEmpresaCorridaNovoLayout.java @@ -0,0 +1,68 @@ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioEmpresaCorridaBean; + +public class RelatorioEmpresaCorridaNovoLayout extends RelatorioEmpresaCorrida { + + public RelatorioEmpresaCorridaNovoLayout(Map parametros, Connection conexao) throws Exception { + super(parametros, conexao); + } + + @Override + protected void setDadosBean(ResultSet rset, RelatorioEmpresaCorridaBean bean) throws SQLException { + super.setDadosBean(rset, bean); + bean.setDataCorrida(StringUtils.defaultString(rset.getString("dataCorrida"))); + bean.setTurnoOrigem(StringUtils.defaultString(rset.getString("turnoOrigem"))); + bean.setOrigem(StringUtils.defaultString(rset.getString("origem"))); + bean.setDestino(StringUtils.defaultString(rset.getString("destino"))); + } + + @Override + protected String getSql(String empresa) { + StringBuilder sql = new StringBuilder(); + sql.append("SELECT "); + sql.append(" e.empresa_id, "); + sql.append(" e.nombempresa, "); + sql.append(" r.ruta_id, "); + sql.append(" r.descruta AS linea, "); + sql.append(" COALESCE(SUM(CASE WHEN (cat.grupocategoria_id IS NULL OR cat.grupocategoria_id <> 4) THEN b.preciopagado ELSE 0 END), 0) boletos, "); + sql.append(" COALESCE(SUM(CASE WHEN cat.grupocategoria_id = 4 THEN b.preciopagado ELSE 0 END), 0) abonos, "); + sql.append(" COUNT(b.boleto_id) passageirosTransp, "); + sql.append(" TO_CHAR(c.feccorrida, 'dd/mm/yyyy') dataCorrida, "); + sql.append(" TO_CHAR(b.fechorviaje, 'hh24:mi') turnoOrigem, "); + sql.append(" po.descparada origem, "); + sql.append(" pd.descparada destino "); + sql.append("FROM ruta r "); + sql.append("LEFT JOIN corrida c ON c.ruta_id = r.ruta_id "); + sql.append("INNER JOIN marca m ON m.marca_id = c.marca_id "); + sql.append("INNER JOIN empresa e ON e.empresa_id = m.empresa_id "); + sql.append("LEFT JOIN boleto b ON b.corrida_id = c.corrida_id AND b.feccorrida = c.feccorrida AND b.motivocancelacion_id IS NULL "); + sql.append("LEFT JOIN categoria cat ON cat.categoria_id = b.categoria_id "); + sql.append("LEFT JOIN parada po ON po.parada_id = b.origen_id "); + sql.append("LEFT JOIN parada pd ON pd.parada_id = b.destino_id "); + sql.append("WHERE c.activo <> 0 "); + sql.append("AND r.activo = 1 "); + sql.append(StringUtils.isBlank(empresa) ? "" : "AND e.empresa_id = :empresa_id "); + sql.append("AND c.FECCORRIDA BETWEEN to_date(:fecInicio, 'DD/MM/YYYY HH24:Mi:SS') AND to_date(:fecFinal, 'DD/MM/YYYY HH24:Mi:SS') "); + sql.append("GROUP BY "); + sql.append(" e.empresa_id, "); + sql.append(" e.nombempresa, "); + sql.append(" r.ruta_id, "); + sql.append(" r.descruta, "); + sql.append(" c.feccorrida, "); + sql.append(" po.descparada, "); + sql.append(" pd.descparada, "); + sql.append(" b.fechorviaje "); + sql.append("ORDER BY r.ruta_id "); + + return sql.toString(); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorridaNovoLayout_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorridaNovoLayout_es.properties new file mode 100644 index 000000000..b4a9c23de --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorridaNovoLayout_es.properties @@ -0,0 +1,29 @@ +#geral +msg.noData=No se pudo obtener datos con los parámetros reportados. +msg.a=a + +#Labels header +header.periodo=Período: +header.data.hora=Fecha/Hora\: +header.pagina=Página\: +header.filtro=Filtro\: +header.filtro.servico=Servicio\: +header.filtro.linha=Línea\: +header.filtro.grupo=Grupo de líneas\: +header.km.grupo=Total recorrido en Km +#Labels detail + +detail.linea=Línea origen - destino +detail.boletos=Recaudaciones Boletos ($) +detail.abonos=Recaudaciones abonos ($) +detail.pasajerosTransportados=Pasajeros transportados +detail.kmOnibusProprio=Ómnibus propios +detail.kmOnibusArrendados=Ómnibus arrendados +detail.kmTotal=Distancia total +detail.dataCorrida=Fecha de la corrida +detail.turnoOrigem=Turno de salida de origen +detail.origem=Origen +detail.destino=Destino + +linhas=Líneas + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorridaNovoLayout_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorridaNovoLayout_pt_BR.properties new file mode 100644 index 000000000..105942597 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorridaNovoLayout_pt_BR.properties @@ -0,0 +1,30 @@ +#geral +msg.noData=No se pudo obtener datos con los parámetros reportados. +msg.a=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=Linhas\: +header.filtro.grupo=Grupo de linhas\: +header.km.grupo=Total percorrido em Km +#Labels detail + +detail.linea=Linha origem - destino +detail.boletos=Boletos ($) +detail.abonos=Abonos ($) +detail.pasajerosTransportados=Passageiros transportados +detail.kmOnibusProprio=Ônibus próprio +detail.kmOnibusArrendados=Ônibus arrendados +detail.kmTotal=Distância total +detail.dataCorrida=Data da corrida +detail.turnoOrigem=Turno de origem +detail.origem=Origem +detail.destino=Destino + + +linhas=Linhas + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorrida_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorrida_pt_BR.properties index b77ac1def..a1f003471 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorrida_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioEmpresaCorrida_pt_BR.properties @@ -22,5 +22,6 @@ detail.kmOnibusArrendados= detail.kmTotal=Distância total + linhas=Linhas diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorrida.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorrida.jasper index cf770a8b8..9ce8a3738 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorrida.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorrida.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorrida.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorrida.jrxml index f96be7054..9b8619463 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorrida.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorrida.jrxml @@ -7,9 +7,9 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -70,14 +70,14 @@ - + - + @@ -85,7 +85,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -170,7 +170,7 @@ - <band height="40"> + <band height="39"> <textField> <reportElement uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716" x="0" y="19" width="49" height="20"/> <textElement/> @@ -215,7 +215,7 @@ <columnHeader> <band height="22" splitType="Stretch"> <textField> - <reportElement uuid="f5729d81-df6a-4612-b01d-d43ce1008f3f" x="487" y="0" width="68" height="22"/> + <reportElement uuid="f5729d81-df6a-4612-b01d-d43ce1008f3f" stretchType="RelativeToTallestObject" x="487" y="0" width="68" height="22"/> <textElement markup="none"> <font size="9"/> <paragraph firstLineIndent="2"/> @@ -223,7 +223,7 @@ <textFieldExpression><![CDATA[$R{detail.kmTotal}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="e0126182-4184-40df-898c-71babec8c9ac" x="251" y="0" width="75" height="22"/> + <reportElement uuid="e0126182-4184-40df-898c-71babec8c9ac" stretchType="RelativeToTallestObject" x="251" y="0" width="75" height="22"/> <textElement markup="none"> <font size="9"/> <paragraph firstLineIndent="2"/> @@ -231,7 +231,7 @@ <textFieldExpression><![CDATA[$R{detail.pasajerosTransportados}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="1ab856e3-3db6-43af-9241-f52d67972d8f" x="192" y="0" width="59" height="22"/> + <reportElement uuid="1ab856e3-3db6-43af-9241-f52d67972d8f" stretchType="RelativeToTallestObject" x="192" y="0" width="59" height="22"/> <textElement markup="none"> <font size="9"/> <paragraph firstLineIndent="2"/> @@ -239,14 +239,14 @@ <textFieldExpression><![CDATA[$R{detail.abonos}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="192f95fb-fc2c-4872-b0a4-00d0675a9882" x="132" y="0" width="60" height="22"/> + <reportElement uuid="192f95fb-fc2c-4872-b0a4-00d0675a9882" stretchType="RelativeToTallestObject" x="132" y="0" width="60" height="22"/> <textElement markup="none"> <font size="9"/> </textElement> <textFieldExpression><![CDATA[$R{detail.boletos}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="76ea0944-2fed-4c0f-a436-77489c8bb755" x="326" y="0" width="73" height="22"/> + <reportElement uuid="76ea0944-2fed-4c0f-a436-77489c8bb755" stretchType="RelativeToTallestObject" x="326" y="0" width="73" height="22"/> <textElement markup="none"> <font size="9"/> <paragraph leftIndent="2"/> @@ -254,7 +254,7 @@ <textFieldExpression><![CDATA[$R{detail.kmOnibusProprio}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="bc11eaed-fff3-4d98-b397-25e43e398699" x="399" y="0" width="88" height="22"/> + <reportElement uuid="bc11eaed-fff3-4d98-b397-25e43e398699" stretchType="RelativeToTallestObject" x="399" y="0" width="88" height="22"/> <textElement markup="none"> <font size="9"/> <paragraph firstLineIndent="2"/> @@ -262,7 +262,7 @@ <textFieldExpression><![CDATA[$R{detail.kmOnibusArrendados}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="140d9378-b983-4eef-bb17-9dbdc80d324a" x="59" y="0" width="73" height="22"/> + <reportElement uuid="140d9378-b983-4eef-bb17-9dbdc80d324a" stretchType="RelativeToTallestObject" x="59" y="0" width="73" height="22"/> <textElement markup="none"> <font size="9"/> <paragraph leftIndent="2"/> @@ -270,7 +270,7 @@ <textFieldExpression><![CDATA[$R{detail.linea}]]></textFieldExpression> </textField> <staticText> - <reportElement uuid="1e959efc-f066-48df-94d1-5ab4ba7fb79e" x="0" y="0" width="59" height="22"/> + <reportElement uuid="1e959efc-f066-48df-94d1-5ab4ba7fb79e" stretchType="RelativeToTallestObject" x="0" y="0" width="59" height="22"/> <textElement markup="none"> <font size="9"/> </textElement> @@ -279,9 +279,9 @@ </band> </columnHeader> <detail> - <band height="19" splitType="Stretch"> + <band height="17" splitType="Stretch"> <textField isBlankWhenNull="true"> - <reportElement uuid="3111776a-f727-4313-841c-55dabd804df4" x="487" y="0" width="68" height="17"/> + <reportElement uuid="3111776a-f727-4313-841c-55dabd804df4" stretchType="RelativeToTallestObject" x="487" y="0" width="68" height="17"/> <textElement textAlignment="Center"> <font size="8"/> <paragraph leftIndent="2"/> @@ -289,7 +289,7 @@ <textFieldExpression><![CDATA[$F{kmTotal}]]></textFieldExpression> </textField> <textField pattern="#,##0.00"> - <reportElement uuid="3343aea7-212b-4bd5-a29c-8dcab3cb7568" x="192" y="0" width="59" height="17"/> + <reportElement uuid="3343aea7-212b-4bd5-a29c-8dcab3cb7568" stretchType="RelativeToTallestObject" x="192" y="0" width="59" height="17"/> <textElement textAlignment="Center"> <font size="8"/> <paragraph leftIndent="2"/> @@ -297,7 +297,7 @@ <textFieldExpression><![CDATA[$F{abonos}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> - <reportElement uuid="cee727cd-cbc7-41d0-8020-d70aa33d8c9f" x="399" y="0" width="88" height="17"/> + <reportElement uuid="cee727cd-cbc7-41d0-8020-d70aa33d8c9f" stretchType="RelativeToTallestObject" x="399" y="0" width="88" height="17"/> <textElement textAlignment="Center"> <font size="8"/> <paragraph leftIndent="2"/> @@ -305,7 +305,7 @@ <textFieldExpression><![CDATA[$F{kmOnibusArrendados}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> - <reportElement uuid="9f731da4-307a-4409-a8d5-28b2c4c40fce" x="59" y="0" width="73" height="17"/> + <reportElement uuid="9f731da4-307a-4409-a8d5-28b2c4c40fce" stretchType="RelativeToTallestObject" x="59" y="0" width="73" height="17"/> <textElement textAlignment="Left"> <font size="8"/> <paragraph leftIndent="2"/> @@ -313,7 +313,7 @@ <textFieldExpression><![CDATA[$F{linea}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="c29b2244-5b3e-48a2-9adf-8e10ee2a3856" x="326" y="0" width="73" height="17"/> + <reportElement uuid="c29b2244-5b3e-48a2-9adf-8e10ee2a3856" stretchType="RelativeToTallestObject" x="326" y="0" width="73" height="17"/> <textElement textAlignment="Center"> <font size="8"/> <paragraph leftIndent="2"/> @@ -321,7 +321,7 @@ <textFieldExpression><![CDATA[$F{kmOnibusProprio}]]></textFieldExpression> </textField> <textField pattern="#,##0.00" isBlankWhenNull="false"> - <reportElement uuid="b36dbddb-2fa9-48a5-809e-0e15ad54c529" x="132" y="0" width="60" height="17"/> + <reportElement uuid="b36dbddb-2fa9-48a5-809e-0e15ad54c529" stretchType="RelativeToTallestObject" x="132" y="0" width="60" height="17"/> <textElement textAlignment="Center"> <font size="8"/> <paragraph leftIndent="2"/> @@ -329,7 +329,7 @@ <textFieldExpression><![CDATA[$F{boletos}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> - <reportElement uuid="4a68f71a-7be1-467a-b3eb-641a0c1f9a48" x="251" y="0" width="75" height="17"/> + <reportElement uuid="4a68f71a-7be1-467a-b3eb-641a0c1f9a48" stretchType="RelativeToTallestObject" x="251" y="0" width="75" height="17"/> <textElement textAlignment="Center"> <font size="8"/> <paragraph leftIndent="2"/> @@ -337,7 +337,7 @@ <textFieldExpression><![CDATA[$F{pasajerosTransportados}]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="true"> - <reportElement uuid="b933abbd-d3f7-4164-a61d-0ffb2c3e4d73" x="0" y="0" width="59" height="17"/> + <reportElement uuid="b933abbd-d3f7-4164-a61d-0ffb2c3e4d73" stretchType="RelativeToTallestObject" x="0" y="0" width="59" height="17"/> <textElement textAlignment="Left"> <font size="7"/> <paragraph leftIndent="2"/> diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorridaNovoLayout.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorridaNovoLayout.jasper new file mode 100644 index 000000000..af0bd6abe Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorridaNovoLayout.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorridaNovoLayout.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorridaNovoLayout.jrxml new file mode 100644 index 000000000..7a153352d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioEmpresaCorridaNovoLayout.jrxml @@ -0,0 +1,458 @@ +<?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="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="RelatorioEmpresaCorrida" whenResourceMissingType="Empty" uuid="94834362-0ecc-46da-b0a2-5cdee355da3e"> + <property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="title"/> + <property name="net.sf.jasperreports.export.pdf.exclude.origin.band.2" value="columnHeader"/> + <property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/> + <property name="net.sf.jasperreports.export.xls.exclude.origin.band.3" value="groupHeader"/> + <property name="net.sf.jasperreports.export.xls.exclude.origin.group.3" value="empresa"/> + <property name="net.sf.jasperreports.export.xls.exclude.origin.band.4" value="groupFooter"/> + <property name="net.sf.jasperreports.export.xls.exclude.origin.group.4" value="empresa"/> + <property name="ireport.zoom" value="1.8150000000000004"/> + <property name="ireport.x" value="85"/> + <property name="ireport.y" value="0"/> + <property name="net.sf.jasperreports.export.xls.remove.emtpy.space.between.columns" value="true"/> + <property name="net.sf.jasperreports.export.xls.remove.emtpy.space.between.rows" value="true"/> + <parameter name="fecInicio" class="java.lang.String"> + <defaultValueExpression><![CDATA[]]></defaultValueExpression> + </parameter> + <parameter name="NOMBEMPRESA" class="java.lang.String"/> + <parameter name="fecFinal" 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"/> + <queryString> + <![CDATA[]]> + </queryString> + <field name="linea" class="java.lang.String"/> + <field name="boletos" class="java.math.BigDecimal"/> + <field name="abonos" class="java.math.BigDecimal"/> + <field name="kmOnibusProprio" class="java.lang.Integer"/> + <field name="kmOnibusArrendados" class="java.lang.Integer"/> + <field name="kmTotal" class="java.lang.Integer"/> + <field name="pasajerosTransportados" class="java.lang.Integer"/> + <field name="empresa" class="java.lang.String"/> + <field name="origem" class="java.lang.String"/> + <field name="destino" class="java.lang.String"/> + <field name="dataCorrida" class="java.lang.String"/> + <field name="turnoOrigem" class="java.lang.String"/> + <variable name="sum.boletos" class="java.math.BigDecimal" resetType="Group" resetGroup="empresa" calculation="Sum"> + <variableExpression><![CDATA[$F{boletos}]]></variableExpression> + </variable> + <variable name="sum.abonos" class="java.math.BigDecimal" resetType="Group" resetGroup="empresa" calculation="Sum"> + <variableExpression><![CDATA[$F{abonos}]]></variableExpression> + </variable> + <variable name="sum.kmOnibusProprio" class="java.lang.Integer" resetType="Group" resetGroup="empresa" calculation="Sum"> + <variableExpression><![CDATA[$F{kmOnibusProprio}]]></variableExpression> + </variable> + <variable name="sum.kmOnibusArrendados" class="java.lang.Integer" resetType="Group" resetGroup="empresa" calculation="Sum"> + <variableExpression><![CDATA[$F{kmOnibusArrendados}]]></variableExpression> + </variable> + <variable name="sum.kmTotal" class="java.lang.Integer" resetType="Group" resetGroup="empresa" calculation="Sum"> + <variableExpression><![CDATA[$F{kmTotal}]]></variableExpression> + </variable> + <variable name="sum.pasajerosTransportados" class="java.lang.Integer" resetType="Group" resetGroup="empresa" calculation="Sum"> + <variableExpression><![CDATA[$F{pasajerosTransportados}]]></variableExpression> + </variable> + <group name="empresa"> + <groupExpression><![CDATA[$F{empresa}]]></groupExpression> + <groupHeader> + <band height="42"> + <textField> + <reportElement uuid="09306494-79f1-44dd-9eed-c39684384bbf" x="0" y="0" width="326" height="20"/> + <textElement> + <font size="12" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="e8355048-a037-4837-866b-e6cf7a3e90ed" stretchType="RelativeToTallestObject" x="319" y="20" width="46" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph firstLineIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.abonos}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="d88253ec-b6d4-4e99-b677-3c1a0b273a81" stretchType="RelativeToTallestObject" x="273" y="20" width="46" height="22"/> + <textElement markup="none"> + <font size="9"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.boletos}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="569add1e-cb73-4278-b800-fa44631527f6" stretchType="RelativeToTallestObject" x="463" y="20" width="45" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph firstLineIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.kmOnibusArrendados}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="31387dbf-1cdc-4c27-992f-2e439abea576" stretchType="RelativeToTallestObject" x="423" y="20" width="40" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.kmOnibusProprio}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="12ef050d-3938-4dd6-8e82-bfeca7adaa2a" stretchType="RelativeToTallestObject" x="49" y="20" width="51" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.linea}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="fb4fcf1b-de90-426b-bfaa-732a08711977" x="326" y="0" width="229" height="20"/> + <textElement verticalAlignment="Bottom"> + <font isBold="true"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{header.km.grupo}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="73c02335-4bbe-44ba-9c73-1201ed6b3967" stretchType="RelativeToTallestObject" x="365" y="20" width="58" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph firstLineIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.pasajerosTransportados}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="edd89ef1-92d6-4b5f-b249-851532fad9df" stretchType="RelativeToTallestObject" x="508" y="20" width="47" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph firstLineIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.kmTotal}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="edc6a77e-c068-4251-bb3e-1f08004eb5bf" stretchType="RelativeToTallestObject" x="100" y="20" width="51" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.dataCorrida}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="15a278aa-451b-4c74-8b9c-15262c6f88f6" stretchType="RelativeToTallestObject" x="151" y="20" width="41" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.turnoOrigem}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="1f69061d-585c-4aee-aeba-17c3cf06734e" stretchType="RelativeToTallestObject" x="192" y="20" width="40" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.origem}]]></textFieldExpression> + </textField> + <textField isStretchWithOverflow="true"> + <reportElement uuid="ff19c95a-f2a3-4e55-b02e-07cc660acc14" stretchType="RelativeToTallestObject" x="232" y="20" width="41" height="22"/> + <textElement markup="none"> + <font size="9"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{detail.destino}]]></textFieldExpression> + </textField> + </band> + </groupHeader> + <groupFooter> + <band height="23"> + <textField pattern="#,##0.00" isBlankWhenNull="true"> + <reportElement uuid="96095298-1c13-4089-8a8b-fd324b377e45" x="273" y="3" width="46" height="16"/> + <textElement textAlignment="Center"> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA[$V{sum.boletos}]]></textFieldExpression> + </textField> + <line> + <reportElement uuid="6cef9de7-7dee-488b-aea7-3d02a8e3634a" x="0" y="0" width="555" height="1"/> + </line> + <textField pattern="#,##0.00"> + <reportElement uuid="354a3daa-dbb6-45c0-93c3-b9c4f485cbb5" x="319" y="3" width="46" height="16"/> + <textElement textAlignment="Center"/> + <textFieldExpression><![CDATA[$V{sum.abonos}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="2f518abc-f4b9-411b-bb4f-5e58c0a2b301" x="423" y="3" width="40" height="16"/> + <textElement textAlignment="Center"/> + <textFieldExpression><![CDATA[$V{sum.kmOnibusProprio}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="6ce0a6db-3435-4ef2-be61-273af168410f" x="463" y="3" width="45" height="16"/> + <textElement textAlignment="Center"/> + <textFieldExpression><![CDATA[$V{sum.kmOnibusArrendados}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="3abc13c1-b7df-49e7-977a-c49638f639c2" x="508" y="3" width="47" height="16"/> + <textElement textAlignment="Center"/> + <textFieldExpression><![CDATA[$V{sum.kmTotal}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="9a3560b6-4371-4d7c-9336-f7578ccadda8" x="365" y="3" width="58" height="16"/> + <textElement textAlignment="Center"/> + <textFieldExpression><![CDATA[$V{sum.pasajerosTransportados}]]></textFieldExpression> + </textField> + </band> + </groupFooter> + </group> + <background> + <band splitType="Stretch"/> + </background> + <title> + <band height="39"> + <textField> + <reportElement uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716" x="0" y="19" width="49" height="20"/> + <textElement/> + <textFieldExpression><![CDATA[$R{header.periodo}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="66b2d0f6-2bf1-4bc7-9ec0-a34444e04d60" x="399" y="0" width="58" height="19"/> + <textElement/> + <textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="be1692e9-f130-4d08-9173-6ca3e4699030" x="444" y="19" width="82" height="20"/> + <textElement textAlignment="Right"> + <paragraph rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$R{header.pagina}+" "+$V{PAGE_NUMBER}+" de"]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="4914d9e7-6ce8-4512-b1f8-13f3b572ac50" x="49" y="19" width="395" height="20"/> + <textElement/> + <textFieldExpression><![CDATA[$P{fecInicio} + " à " + $P{fecFinal}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="652312bd-292a-424d-a234-5f157e3699c6" x="0" y="0" width="399" height="19"/> + <textElement> + <font size="12" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy HH:mm"> + <reportElement uuid="6f671365-868e-41a6-81ee-a308d1d91e1d" x="457" y="0" width="98" height="19"/> + <textElement textAlignment="Left"/> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + <textField evaluationTime="Report"> + <reportElement uuid="0228244f-d8b1-47c5-9020-513456ec745c" x="526" y="19" width="29" height="20"/> + <textElement/> + <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> + </textField> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioEmpresaCorridaBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioEmpresaCorridaBean.java index 483d5f11e..0d99503f0 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioEmpresaCorridaBean.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioEmpresaCorridaBean.java @@ -13,6 +13,34 @@ public class RelatorioEmpresaCorridaBean { private Integer kmOnibusArrendados; private Integer kmTotal; private Integer pasajerosTransportados; + private String origem; + private String destino; + private String dataCorrida; + private String turnoOrigem; + + public String getOrigem() { + return origem; + } + + public void setOrigem(String origem) { + this.origem = origem; + } + + public String getDestino() { + return destino; + } + + public void setDestino(String destino) { + this.destino = destino; + } + + public String getDataCorrida() { + return dataCorrida; + } + + public void setDataCorrida(String dataCorrida) { + this.dataCorrida = dataCorrida; + } public Integer getRutaId() { return rutaId; @@ -111,4 +139,12 @@ public class RelatorioEmpresaCorridaBean { return true; } + public String getTurnoOrigem() { + return turnoOrigem; + } + + public void setTurnoOrigem(String turnoOrigem) { + this.turnoOrigem = turnoOrigem; + } + } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioEmpresaCorridaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioEmpresaCorridaController.java index c1342201a..ccf780179 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioEmpresaCorridaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioEmpresaCorridaController.java @@ -7,7 +7,6 @@ import java.util.Map; import javax.sql.DataSource; -import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; @@ -15,9 +14,11 @@ import org.zkoss.util.resource.Labels; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; import org.zkoss.zul.Datebox; +import org.zkoss.zul.api.Radio; import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioEmpresaCorrida; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioEmpresaCorridaNovoLayout; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; @@ -27,7 +28,6 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @Scope("prototype") public class RelatorioEmpresaCorridaController extends MyGenericForwardComposer { private static final long serialVersionUID = 1L; - private static Logger log = Logger.getLogger(RelatorioEmpresaCorridaController.class); @Autowired private DataSource dataSourceRead; @@ -37,11 +37,25 @@ public class RelatorioEmpresaCorridaController extends MyGenericForwardComposer private Datebox datInicial; private Datebox datFinal; private MyComboboxEstandar cmbEmpresa; + private Radio radioAntigoLayout; private List lsEmpresas; private void executarRelatorio() throws Exception { + Map parametros = obtemParametros(); + + Relatorio relatorio = getRelatorio(parametros); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("relatorioEmpresaCorridaController.window.title"), args, MODAL); + + } + + private Map obtemParametros() { Map parametros = new HashMap(); Empresa empresa = cmbEmpresa.getSelectedItem() != null ? (Empresa)cmbEmpresa.getSelectedItem().getValue() : null; @@ -53,15 +67,14 @@ public class RelatorioEmpresaCorridaController extends MyGenericForwardComposer parametros.put("empresa", empresa.getEmpresaId()); } parametros.put("TITULO", Labels.getLabel("relatorioEmpresaCorridaController.window.title")); - - Relatorio relatorio = new RelatorioEmpresaCorrida(parametros, dataSourceRead.getConnection()); - - Map args = new HashMap(); - args.put("relatorio", relatorio); - - openWindow("/component/reportView.zul", - Labels.getLabel("relatorioEmpresaCorridaController.window.title"), args, MODAL); + return parametros; + } + private Relatorio getRelatorio(Map parametros) throws Exception { + if (radioAntigoLayout.isChecked()) { + return new RelatorioEmpresaCorrida(parametros, dataSourceRead.getConnection()); + } + return new RelatorioEmpresaCorridaNovoLayout(parametros, dataSourceRead.getConnection()); } public void onClick$btnExecutarRelatorio(Event ev) throws Exception { diff --git a/web/gui/relatorios/filtroRelatorioEmpresaCorrida.zul b/web/gui/relatorios/filtroRelatorioEmpresaCorrida.zul index c7060e450..1b9faf066 100644 --- a/web/gui/relatorios/filtroRelatorioEmpresaCorrida.zul +++ b/web/gui/relatorios/filtroRelatorioEmpresaCorrida.zul @@ -29,7 +29,7 @@ format="dd/MM/yyyy" constraint="no empty" maxlength="10" /> - + + +