daniel.zauli 2015-06-17 18:06:57 +00:00
parent 5c22acc2d2
commit be59404e19
7 changed files with 290 additions and 108 deletions

View File

@ -30,7 +30,8 @@ public class RelatorioReceitaServico extends Relatorio {
String sql = getSql( String sql = getSql(
(parametros.get("ORIGEN_ID") != null && parametros.get("ORIGEN_ID") != "" ) , (parametros.get("ORIGEN_ID") != null && parametros.get("ORIGEN_ID") != "" ) ,
(parametros.get("DESTINO_ID") != null && parametros.get("DESTINO_ID") != "" ) (parametros.get("DESTINO_ID") != null && parametros.get("DESTINO_ID") != "" ) ,
(parametros.get("CORRIDA_ID") != null && parametros.get("CORRIDA_ID") != "" )
); );
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql); NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
@ -41,6 +42,10 @@ public class RelatorioReceitaServico extends Relatorio {
stmt.setTimestamp("DATA_INICIAL", new Timestamp(((Date) parametros.get("DATA_INICIAL")).getTime())); stmt.setTimestamp("DATA_INICIAL", new Timestamp(((Date) parametros.get("DATA_INICIAL")).getTime()));
stmt.setTimestamp("DATA_FINAL", new Timestamp(((Date) parametros.get("DATA_FINAL")).getTime())); stmt.setTimestamp("DATA_FINAL", new Timestamp(((Date) parametros.get("DATA_FINAL")).getTime()));
if (parametros.get("CORRIDA_ID") != null)
stmt.setString("CORRIDA_ID", (String)parametros.get("CORRIDA_ID"));
else{}
if (parametros.get("ORIGEN_ID") != null) if (parametros.get("ORIGEN_ID") != null)
stmt.setInt("ORIGEN_ID", (Integer) parametros.get("ORIGEN_ID")); stmt.setInt("ORIGEN_ID", (Integer) parametros.get("ORIGEN_ID"));
else{} else{}
@ -73,61 +78,62 @@ public class RelatorioReceitaServico extends Relatorio {
dataResult.put("origem", rset.getString("origem")); dataResult.put("origem", rset.getString("origem"));
dataResult.put("destino", rset.getString("destino")); dataResult.put("destino", rset.getString("destino"));
dataResult.put("classe", rset.getString("classe")); dataResult.put("classe", rset.getString("classe"));
dataResult.put("tarifa", rset.getString("tarifa")); dataResult.put("tarifa", rset.getBigDecimal("tarifa"));
dataResult.put("tut", rset.getBigDecimal("tut")); dataResult.put("tut", rset.getBigDecimal("tut"));
dataResult.put("pedagio", rset.getBigDecimal("pedagio")); dataResult.put("pedagio", rset.getBigDecimal("pedagio"));
dataResult.put("total", rset.getBigDecimal("total")); dataResult.put("total", rset.getBigDecimal("total"));
dataResult.put("tipo", rset.getString("tipo")); dataResult.put("tipo", rset.getString("tipo"));
dataResult.put("agencia", rset.getString("agencia")); dataResult.put("agencia", rset.getString("agencia"));
dataResult.put("dataHoraCompra", rset.getDate("dataHoraCompra")); dataResult.put("dataHoraCompra", rset.getTimestamp("dataHoraCompra"));
dataResult.put("passageiro", rset.getString("passageiro")); dataResult.put("passageiro", !(rset.getString("passageiro") == null) ? rset.getString("passageiro") : "");
dataResult.put("nrBilhete", rset.getString("nrBilhete")); dataResult.put("nrBilhete", !(rset.getString("nrBilhete") == null) ? rset.getString("nrBilhete") : "");
this.dados.add(dataResult); this.dados.add(dataResult);
} }
this.resultSet = rset; this.resultSet = rset;
} }
}); });
} }
@Override @Override
protected void processaParametros() throws Exception { protected void processaParametros() throws Exception {
} }
private String getSql(boolean origemSelected , boolean destinoSelected) { private String getSql(boolean origemSelected , boolean destinoSelected, boolean servicoSelected) {
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append(" select c.feccorrida as data, ");
sql.append(" c.CORRIDA_ID as servico , ");
sql.append(" e.nombempresa as empresa, "); sql.append(" select cj.feccorrida as data, ");
sql.append(" pOrig.cveparada as origem, "); sql.append(" cj.corrida_id as servico, ");
sql.append(" pDest.cveparada as destino, "); sql.append(" mar.descmarca as empresa , ");
sql.append(" cs.descclase as classe, "); sql.append(" pOrig.cveparada as Origem, ");
sql.append(" pDest.cveparada as Destino, ");
sql.append(" cl_ser.descclase as Classe, ");
sql.append(" cj.preciopagado as tarifa, "); sql.append(" cj.preciopagado as tarifa, ");
sql.append(" cj.importetaxaembarque as tut, "); sql.append(" cj.importetaxaembarque as tut, ");
sql.append(" cj.importepedagio as pedagio, "); sql.append(" cj.importepedagio as pedagio, ");
sql.append(" (cj.preciopagado + cj.importetaxaembarque + cj.importepedagio ) as total, "); sql.append(" (cj.preciopagado + cj.importetaxaembarque + cj.importepedagio ) as total, ");
sql.append(" CAT.desccategoria as tipo, "); sql.append(" cat.desccategoria as tipo, ");
sql.append(" pv.nombpuntoventa as agencia, "); sql.append(" pv.nombpuntoventa as agencia, ");
sql.append(" cj.fechorventa as dataHoraCompra, "); sql.append(" cj.fechorventa as dataHoraCompra, ");
sql.append(" cj.nombpasajero as passageiro, "); sql.append(" cj.nombpasajero as passageiro, ");
sql.append(" cj.NUMFOLIOPREIMPRESO as nrBilhete "); sql.append(" cj.NUMFOLIOSISTEMA as nrBilhete ");
sql.append(" from corrida c ");
sql.append(" inner join marca m on c.marca_id = m.marca_id "); sql.append(" from caja cj ");
sql.append(" inner join empresa e on m.empresa_id = e.empresa_id "); sql.append(" inner join marca mar on mar.marca_id = cj.marca_id ");
sql.append(" inner join caja cj on cj.corrida_id = c.corrida_id ");
sql.append(" inner join parada pOrig on pOrig.parada_id = cj.origen_id "); sql.append(" inner join parada pOrig on pOrig.parada_id = cj.origen_id ");
sql.append(" inner join parada pDest on pDest.parada_id = cj.destino_id "); sql.append(" inner join parada pDest on pDest.parada_id = cj.destino_id ");
sql.append(" inner join CLASE_SERVICIO cs on cs.CLASESERVICIO_ID = cj.CLASESERVICIO_ID "); sql.append(" inner join clase_servicio cl_ser on cl_ser.claseservicio_id = cj.claseservicio_id ");
sql.append(" inner join CATEGORIA CAT on cj.usuario_id = CAT.usuario_id "); sql.append(" inner join categoria cat on cj.categoria_id = cat.categoria_id ");
sql.append(" inner join punto_venta pv on cj.puntoventa_id = pv.puntoventa_id "); sql.append(" inner join punto_venta pv on cj.puntoventa_id = pv.puntoventa_id ");
sql.append(" where c.feccorrida >= :DATA_INICIAL "); sql.append(" where cj.feccorrida >= :DATA_INICIAL ");
sql.append(" and c.feccorrida <= :DATA_FINAL "); sql.append(" and cj.feccorrida <= :DATA_FINAL ");
if(servicoSelected){ sql.append(" and cj.corrida_id IN (:CORRIDA_ID) "); }
//else{ sql.append(" and cj.corrida_id IN ( select p.PARADA_ID from parada p ) "); }
if(origemSelected){ sql.append(" and pOrig.PARADA_ID IN (:ORIGEN_ID) "); } if(origemSelected){ sql.append(" and pOrig.PARADA_ID IN (:ORIGEN_ID) "); }
else{ sql.append(" and pOrig.PARADA_ID IN ( select p.PARADA_ID from parada p ) "); } else{ sql.append(" and pOrig.PARADA_ID IN ( select p.PARADA_ID from parada p ) "); }
@ -135,10 +141,15 @@ public class RelatorioReceitaServico extends Relatorio {
if(destinoSelected){ sql.append(" and pDest.PARADA_ID IN (:DESTINO_ID) "); } if(destinoSelected){ sql.append(" and pDest.PARADA_ID IN (:DESTINO_ID) "); }
else{ sql.append(" and pDest.PARADA_ID IN ( select p.PARADA_ID from parada p) "); } else{ sql.append(" and pDest.PARADA_ID IN ( select p.PARADA_ID from parada p) "); }
sql.append(" and e.EMPRESA_ID = :EMPRESA_ID "); sql.append(" and mar.EMPRESA_ID = :EMPRESA_ID ");
sql.append(" and CLASESERVICIO_ID = :CLASESERVICIO_ID "); sql.append(" and cj.CLASESERVICIO_ID = :CLASESERVICIO_ID ");
sql.append(" order by cj.corrida_id ");
return sql.toString(); return sql.toString();
} }
} }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?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="RelatorioReceitaServico" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c092ef85-9334-4225-93d7-1acb7cf4d021"> <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="RelatorioReceitaServico" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c092ef85-9334-4225-93d7-1acb7cf4d021">
<property name="ireport.zoom" value="1.0"/> <property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/> <property name="ireport.x" value="127"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<parameter name="NOME_RELATORIO" class="java.lang.String"/> <parameter name="NOME_RELATORIO" class="java.lang.String"/>
<parameter name="DATA_INICIAL" class="java.util.Date"/> <parameter name="DATA_INICIAL" class="java.util.Date"/>
@ -17,7 +17,7 @@
<field name="origem" class="java.lang.String"/> <field name="origem" class="java.lang.String"/>
<field name="destino" class="java.lang.String"/> <field name="destino" class="java.lang.String"/>
<field name="classe" class="java.lang.String"/> <field name="classe" class="java.lang.String"/>
<field name="tarifa" class="java.lang.String"/> <field name="tarifa" class="java.math.BigDecimal"/>
<field name="tut" class="java.math.BigDecimal"/> <field name="tut" class="java.math.BigDecimal"/>
<field name="pedagio" class="java.math.BigDecimal"/> <field name="pedagio" class="java.math.BigDecimal"/>
<field name="total" class="java.math.BigDecimal"/> <field name="total" class="java.math.BigDecimal"/>
@ -26,6 +26,18 @@
<field name="dataHoraCompra" class="java.util.Date"/> <field name="dataHoraCompra" class="java.util.Date"/>
<field name="passageiro" class="java.lang.String"/> <field name="passageiro" class="java.lang.String"/>
<field name="nrBilhete" class="java.lang.String"/> <field name="nrBilhete" class="java.lang.String"/>
<variable name="totalizador" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{total}]]></variableExpression>
</variable>
<variable name="TOTAL_TARIFA" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{tarifa}]]></variableExpression>
</variable>
<variable name="TOTAL_TUT" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{tut}]]></variableExpression>
</variable>
<variable name="TOTAL_PEDAGIO" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{pedagio}]]></variableExpression>
</variable>
<background> <background>
<band splitType="Stretch"/> <band splitType="Stretch"/>
</background> </background>
@ -79,8 +91,8 @@
<textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression>
</textField> </textField>
<textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false"> <textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false">
<reportElement mode="Transparent" x="676" y="0" width="89" height="25" forecolor="#000000" backcolor="#FFFFFF" uuid="0d200750-aabf-4c7e-b27b-c0e7af4802a9"/> <reportElement mode="Transparent" x="691" y="0" width="89" height="25" forecolor="#000000" backcolor="#FFFFFF" uuid="0d200750-aabf-4c7e-b27b-c0e7af4802a9"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <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="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
@ -90,7 +102,7 @@
<reportElement x="0" y="54" width="802" height="5" uuid="bbf33a72-515f-42fc-8c79-e859aebca31d"/> <reportElement x="0" y="54" width="802" height="5" uuid="bbf33a72-515f-42fc-8c79-e859aebca31d"/>
</line> </line>
<textField pattern="" isBlankWhenNull="false"> <textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="645" y="27" width="105" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="bae9bec6-8c42-4bee-a070-34b0a7f1aee4"/> <reportElement mode="Transparent" x="571" y="27" width="105" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="bae9bec6-8c42-4bee-a070-34b0a7f1aee4"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <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"/> <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
@ -98,15 +110,15 @@
<textFieldExpression><![CDATA[$R{cabecalho.pagina}+" "+$V{PAGE_NUMBER}+" "+$R{cabecalho.de}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.pagina}+" "+$V{PAGE_NUMBER}+" "+$R{cabecalho.de}]]></textFieldExpression>
</textField> </textField>
<textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> <textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="750" y="27" width="15" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="314e312c-8f24-42de-8354-3c1f7241a985"/> <reportElement mode="Transparent" x="691" y="27" width="35" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="314e312c-8f24-42de-8354-3c1f7241a985"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none"> <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="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField> </textField>
<textField pattern="" isBlankWhenNull="false"> <textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="544" y="42" width="221" height="12" forecolor="#000000" backcolor="#FFFFFF" uuid="4e030613-9cee-443e-9eaa-b19fa3090976"/> <reportElement mode="Transparent" x="468" y="42" width="208" height="12" forecolor="#000000" backcolor="#FFFFFF" uuid="4e030613-9cee-443e-9eaa-b19fa3090976"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <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="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
@ -128,68 +140,115 @@
<columnHeader> <columnHeader>
<band height="61" splitType="Stretch"> <band height="61" splitType="Stretch">
<staticText> <staticText>
<reportElement x="0" y="33" width="62" height="28" uuid="5f9a0ea4-15d3-4bad-953a-0dc6f3f6ef51"/> <reportElement x="0" y="33" width="46" height="28" uuid="5f9a0ea4-15d3-4bad-953a-0dc6f3f6ef51"/>
<textElement textAlignment="Center"/> <textElement textAlignment="Left">
<font size="8"/>
</textElement>
<text><![CDATA[Data]]></text> <text><![CDATA[Data]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="62" y="33" width="49" height="28" uuid="fa0a31b5-6a94-4b0c-b730-4b6ef8f2304c"/> <reportElement x="46" y="33" width="37" height="28" uuid="fa0a31b5-6a94-4b0c-b730-4b6ef8f2304c"/>
<textElement textAlignment="Left">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Serviço]]></text> <text><![CDATA[Serviço]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="111" y="33" width="58" height="28" uuid="a797bc17-1810-47b7-a3e1-510cc6403454"/> <reportElement x="83" y="33" width="83" height="28" uuid="a797bc17-1810-47b7-a3e1-510cc6403454"/>
<textElement textAlignment="Left">
<font size="8" isBold="false"/>
</textElement>
<text><![CDATA[Empresa]]></text> <text><![CDATA[Empresa]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="169" y="33" width="47" height="28" uuid="765ebd99-b6de-4c8e-910d-b3e5bf9db573"/> <reportElement x="169" y="33" width="30" height="28" uuid="765ebd99-b6de-4c8e-910d-b3e5bf9db573"/>
<textElement textAlignment="Left">
<font size="8"/>
</textElement>
<text><![CDATA[Origem]]></text> <text><![CDATA[Origem]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="216" y="33" width="52" height="28" uuid="2f3b9ac0-165c-4718-96c8-a37f005b5b82"/> <reportElement x="199" y="33" width="30" height="28" uuid="2f3b9ac0-165c-4718-96c8-a37f005b5b82"/>
<textElement textAlignment="Left">
<font size="8"/>
</textElement>
<text><![CDATA[Destino]]></text> <text><![CDATA[Destino]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="268" y="33" width="56" height="28" uuid="9eb87b55-da02-478a-b21d-c7b727dbaafe"/> <reportElement x="229" y="33" width="68" height="28" uuid="9eb87b55-da02-478a-b21d-c7b727dbaafe"/>
<textElement textAlignment="Left">
<font size="8"/>
</textElement>
<text><![CDATA[Classe]]></text> <text><![CDATA[Classe]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="324" y="33" width="37" height="28" uuid="fe1e6ace-6d95-4089-8f28-d926554bf65d"/> <reportElement x="297" y="33" width="33" height="28" uuid="fe1e6ace-6d95-4089-8f28-d926554bf65d"/>
<textElement textAlignment="Left">
<font size="8"/>
</textElement>
<text><![CDATA[Tarifa]]></text> <text><![CDATA[Tarifa]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="361" y="33" width="37" height="28" uuid="52d26417-4766-44b3-aaa7-b468c124feda"/> <reportElement x="330" y="33" width="33" height="28" uuid="52d26417-4766-44b3-aaa7-b468c124feda"/>
<textElement textAlignment="Left">
<font size="8"/>
</textElement>
<text><![CDATA[TUT]]></text> <text><![CDATA[TUT]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="398" y="33" width="46" height="28" uuid="3f6afcbf-9dfe-4f1b-b937-45dbc9ace8a2"/> <reportElement x="363" y="33" width="33" height="28" uuid="3f6afcbf-9dfe-4f1b-b937-45dbc9ace8a2"/>
<textElement textAlignment="Left">
<font size="8" isStrikeThrough="false"/>
</textElement>
<text><![CDATA[Pedágio]]></text> <text><![CDATA[Pedágio]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="444" y="33" width="37" height="28" uuid="182474d6-668a-4847-9db6-ba65c41119aa"/> <reportElement x="396" y="33" width="33" height="28" uuid="182474d6-668a-4847-9db6-ba65c41119aa"/>
<textElement textAlignment="Left">
<font size="8"/>
</textElement>
<text><![CDATA[Total]]></text> <text><![CDATA[Total]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="481" y="33" width="46" height="28" uuid="a7b14fa8-3b89-4f4d-b265-63eb3d930b04"/> <reportElement x="429" y="33" width="55" height="28" uuid="a7b14fa8-3b89-4f4d-b265-63eb3d930b04"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Tipo]]></text> <text><![CDATA[Tipo]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="527" y="33" width="48" height="28" uuid="10f27b7d-5cc9-423c-a196-330c78cdb69e"/> <reportElement x="484" y="33" width="70" height="28" uuid="10f27b7d-5cc9-423c-a196-330c78cdb69e"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Agência]]></text> <text><![CDATA[Agência]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="575" y="33" width="86" height="28" uuid="f2097833-6bd3-4523-b457-44ed6cc4abd6"/> <reportElement x="554" y="33" width="85" height="28" uuid="f2097833-6bd3-4523-b457-44ed6cc4abd6"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[DataHoraCompra ]]></text> <text><![CDATA[DataHoraCompra ]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="661" y="33" width="53" height="28" uuid="44b2bf55-871a-4eaa-97d4-74bee2a89769"/> <reportElement x="639" y="33" width="87" height="28" uuid="44b2bf55-871a-4eaa-97d4-74bee2a89769"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Passageiro]]></text> <text><![CDATA[Passageiro]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="714" y="33" width="51" height="28" uuid="2abbc372-a813-4da6-8ce1-e5901a15b430"/> <reportElement x="726" y="33" width="39" height="28" uuid="2abbc372-a813-4da6-8ce1-e5901a15b430"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Nr bilhete ]]></text> <text><![CDATA[Nr bilhete ]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="765" y="33" width="37" height="28" uuid="2bd47a58-e591-4b32-bdd4-fa43ece0c581"/> <reportElement x="765" y="33" width="37" height="28" uuid="2bd47a58-e591-4b32-bdd4-fa43ece0c581"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Status]]></text> <text><![CDATA[Status]]></text>
</staticText> </staticText>
<line> <line>
@ -200,75 +259,160 @@
<detail> <detail>
<band height="23" splitType="Stretch"> <band height="23" splitType="Stretch">
<textField> <textField>
<reportElement x="62" y="0" width="49" height="20" uuid="b15ada19-a1c0-4feb-9734-3a6c624bbfe6"/> <reportElement x="46" y="0" width="37" height="20" uuid="b15ada19-a1c0-4feb-9734-3a6c624bbfe6"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{servico}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{servico}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="62" y="0" width="49" height="20" uuid="c6117592-2455-494b-bfde-de6a35504d7e"/> <reportElement x="83" y="0" width="83" height="20" uuid="c35afacb-b160-4ace-b7be-c2e2f54ac1c0"/>
<textFieldExpression><![CDATA[$F{servico}]]></textFieldExpression> <textElement>
</textField> <font size="8"/>
<textField> </textElement>
<reportElement x="111" y="0" width="58" height="20" uuid="c35afacb-b160-4ace-b7be-c2e2f54ac1c0"/>
<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="169" y="0" width="47" height="20" uuid="fd8ae360-3ae2-4adc-8c3a-fcfb19551d22"/> <reportElement x="169" y="0" width="30" height="20" uuid="fd8ae360-3ae2-4adc-8c3a-fcfb19551d22"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="216" y="0" width="52" height="20" uuid="29ae3fa8-9db1-46c8-bcf7-cb9aa7bc6eb3"/> <reportElement x="199" y="0" width="30" height="20" uuid="29ae3fa8-9db1-46c8-bcf7-cb9aa7bc6eb3"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="268" y="0" width="56" height="20" uuid="7265d085-4188-44a0-8e04-e5efdb0d5ccf"/> <reportElement x="229" y="0" width="68" height="20" uuid="7265d085-4188-44a0-8e04-e5efdb0d5ccf"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{classe}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{classe}]]></textFieldExpression>
</textField> </textField>
<textField> <textField pattern="¤ #,##0.00">
<reportElement x="324" y="0" width="37" height="20" uuid="6430daa4-d318-4f4a-87ff-2ea4de9d492e"/> <reportElement x="297" y="0" width="33" height="20" uuid="6430daa4-d318-4f4a-87ff-2ea4de9d492e"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression>
</textField> </textField>
<textField> <textField pattern="¤ #,##0.00">
<reportElement x="361" y="0" width="37" height="20" uuid="49faea3b-2ce4-469a-b07c-3b4869aaa9e5"/> <reportElement x="330" y="0" width="33" height="20" uuid="49faea3b-2ce4-469a-b07c-3b4869aaa9e5"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{tut}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{tut}]]></textFieldExpression>
</textField> </textField>
<textField> <textField pattern="¤ #,##0.00">
<reportElement x="398" y="0" width="46" height="20" uuid="16461919-04ea-48df-af5c-7f0d7dcb7fab"/> <reportElement x="363" y="0" width="33" height="20" uuid="16461919-04ea-48df-af5c-7f0d7dcb7fab"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression>
</textField> </textField>
<textField> <textField pattern="¤ #,##0.00">
<reportElement x="444" y="0" width="37" height="20" uuid="97be07ba-bdb1-4bf2-91af-554b580ee3fa"/> <reportElement x="396" y="0" width="33" height="20" uuid="97be07ba-bdb1-4bf2-91af-554b580ee3fa"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{total}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{total}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="481" y="0" width="46" height="20" uuid="8cf0c102-4e42-4f6d-8922-8edc808fdc0f"/> <reportElement x="429" y="0" width="55" height="20" uuid="8cf0c102-4e42-4f6d-8922-8edc808fdc0f"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{tipo}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{tipo}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="527" y="0" width="48" height="20" uuid="0ecedfc0-febb-40e0-b5ca-168b5a296646"/> <reportElement x="484" y="0" width="70" height="20" uuid="0ecedfc0-febb-40e0-b5ca-168b5a296646"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{agencia}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{agencia}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="575" y="0" width="86" height="20" uuid="8229beec-daa6-4357-a4c9-f475d7a873aa"/> <reportElement x="554" y="0" width="85" height="20" uuid="8229beec-daa6-4357-a4c9-f475d7a873aa"/>
<textFieldExpression><![CDATA[$F{dataHoraCompra}]]></textFieldExpression> <textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format($F{dataHoraCompra})]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="661" y="0" width="53" height="20" uuid="8e67c346-5c72-4a92-beee-9dd9ad647bb1"/> <reportElement x="639" y="0" width="87" height="20" uuid="8e67c346-5c72-4a92-beee-9dd9ad647bb1"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{passageiro}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{passageiro}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="712" y="0" width="53" height="20" uuid="9a639996-146c-42c9-a8fd-f947a59310f4"/> <reportElement x="726" y="0" width="39" height="20" uuid="9a639996-146c-42c9-a8fd-f947a59310f4"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{nrBilhete}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{nrBilhete}]]></textFieldExpression>
</textField> </textField>
<textField> <textField pattern="dd/MM/yyyy">
<reportElement x="0" y="0" width="62" height="20" uuid="bfb9d635-bbc1-4e92-890a-df8299bc8daa"/> <reportElement x="0" y="0" width="46" height="20" uuid="bfb9d635-bbc1-4e92-890a-df8299bc8daa"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{data}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{data}]]></textFieldExpression>
</textField> </textField>
</band> </band>
</detail> </detail>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary> <summary>
<band height="42" splitType="Stretch"/> <band height="84" splitType="Stretch">
<textField pattern="¤ #,##0.00">
<reportElement x="175" y="60" width="178" height="20" uuid="4bbf9db6-cc01-4cc0-98fa-7522eb890d4c"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalizador}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="175" y="0" width="178" height="20" uuid="381ba8fc-878f-4419-8c93-758a607e9ba3"/>
<textFieldExpression><![CDATA[$V{TOTAL_TARIFA}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="175" y="20" width="178" height="20" uuid="a36d2d34-3721-4796-93ec-3cf838aebf85"/>
<textFieldExpression><![CDATA[$V{TOTAL_TUT}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="175" y="40" width="178" height="20" uuid="219227d5-1615-4876-a810-c6393957ccd0"/>
<textFieldExpression><![CDATA[$V{TOTAL_PEDAGIO}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="46" y="0" width="100" height="20" uuid="d4600e8d-457a-47cf-aa81-84b1231728fe"/>
<text><![CDATA[Total Tarifa]]></text>
</staticText>
<staticText>
<reportElement x="46" y="20" width="100" height="20" uuid="5b0f4977-d53a-4fcb-a16f-88c1edd8493b"/>
<text><![CDATA[Total Tut]]></text>
</staticText>
<staticText>
<reportElement x="46" y="40" width="100" height="20" uuid="f6849b27-f317-458b-b4f3-8d96a150962e"/>
<text><![CDATA[Total Pedágio]]></text>
</staticText>
<staticText>
<reportElement x="46" y="61" width="100" height="20" uuid="9f5fda19-bdf2-4600-ba05-aa2ded9c6a89"/>
<text><![CDATA[Total Receita]]></text>
</staticText>
</band>
</summary> </summary>
<noData>
<band height="50">
<textField>
<reportElement x="46" y="24" width="530" height="26" uuid="6f13c961-dd50-4e44-ba73-65e0752b8b83"/>
<textElement markup="none">
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport> </jasperReport>

View File

@ -37,6 +37,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
@Controller("relatorioReceitaServicoController") @Controller("relatorioReceitaServicoController")
@Scope("prototype") @Scope("prototype")
@ -53,6 +54,7 @@ public class RelatorioReceitaServicoController extends MyGenericForwardComposer
private MyComboboxParadaCve cmbParadaDestinoCve; private MyComboboxParadaCve cmbParadaDestinoCve;
private List<Empresa> lsEmpresa; private List<Empresa> lsEmpresa;
private List<ClaseServicio> lsClase; private List<ClaseServicio> lsClase;
private MyTextbox txtCorridaId;
private MyComboboxEstandar cmbEmpresa; private MyComboboxEstandar cmbEmpresa;
private MyComboboxEstandar cmbClase; private MyComboboxEstandar cmbClase;
@ -140,6 +142,18 @@ public class RelatorioReceitaServicoController extends MyGenericForwardComposer
StringBuilder filtro = new StringBuilder(); StringBuilder filtro = new StringBuilder();
if(null != txtCorridaId.getValue() && !("".equals(txtCorridaId.getValue())))
{
filtro.append("Serviço: ");
filtro.append(txtCorridaId.getValue()+"; ");
parametros.put("CORRIDA_ID", txtCorridaId.getValue());
}else{
filtro.append("Serviço: TODOS; ");
parametros.put("CORRIDA_ID", null);
}
filtro.append("Início período: "); filtro.append("Início período: ");
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(datInicial.getValue()); cal.setTime(datInicial.getValue());
@ -148,15 +162,11 @@ public class RelatorioReceitaServicoController extends MyGenericForwardComposer
filtro.append(cal.get(Calendar.YEAR)+"; "); filtro.append(cal.get(Calendar.YEAR)+"; ");
filtro.append("Fim período: "); filtro.append("Fim período: ");
cal.setTime(datFinal.getValue()); cal.setTime(datFinal.getValue());
filtro.append(cal.get(Calendar.DATE)+"/"); filtro.append(cal.get(Calendar.DATE)+"/");
filtro.append((cal.get(Calendar.MONTH)+1)+"/"); filtro.append((cal.get(Calendar.MONTH)+1)+"/");
filtro.append(cal.get(Calendar.YEAR)+"; "); filtro.append(cal.get(Calendar.YEAR)+"; ");
parametros.put("DATA_INICIAL", (java.util.Date) datInicial.getValue()); parametros.put("DATA_INICIAL", (java.util.Date) datInicial.getValue());
parametros.put("DATA_FINAL", (java.util.Date) datFinal.getValue()); parametros.put("DATA_FINAL", (java.util.Date) datFinal.getValue());
@ -209,23 +219,23 @@ public class RelatorioReceitaServicoController extends MyGenericForwardComposer
relatorio = new RelatorioReceitaServico(parametros, dataSourceRead.getConnection()); relatorio = new RelatorioReceitaServico(parametros, dataSourceRead.getConnection());
if(relatorio.getCustomDataSource().next()) // if(relatorio.getCustomDataSource().next())
{ // {
Map args = new HashMap(); Map args = new HashMap();
args.put("relatorio", relatorio); args.put("relatorio", relatorio);
openWindow("/component/reportView.zul", openWindow("/component/reportView.zul",
Labels.getLabel("relatorioReceitaServicoController.window.title"), args, MODAL); Labels.getLabel("relatorioReceitaServicoController.window.title"), args, MODAL);
}else // }else
{ // {
try { // try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), // Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("relatorioReceitaServicoController.window.title"), // Labels.getLabel("relatorioReceitaServicoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION); // Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) { // } catch (InterruptedException ex) {
ex.printStackTrace(); // ex.printStackTrace();
} // }
} // }
@ -332,4 +342,13 @@ public class RelatorioReceitaServicoController extends MyGenericForwardComposer
this.cmbParadaDestinoCve = cmbParadaDestinoCve; this.cmbParadaDestinoCve = cmbParadaDestinoCve;
} }
public MyTextbox getTxtCorridaId() {
return txtCorridaId;
}
public void setTxtCorridaId(MyTextbox txtCorridaId) {
this.txtCorridaId = txtCorridaId;
}
} }

View File

@ -443,6 +443,7 @@ relatorioReceitaServicoController.lbCidadeOrigem.value = Localidade Origem
relatorioReceitaServicoController.lbCidadeDestino.value = Localidade Destino relatorioReceitaServicoController.lbCidadeDestino.value = Localidade Destino
relatorioReceitaServicoController.lbEmpresa.value = Empresa relatorioReceitaServicoController.lbEmpresa.value = Empresa
relatorioReceitaServicoController.lbClase.value = Clase relatorioReceitaServicoController.lbClase.value = Clase
relatorioReceitaServicoController.lbServico.value = N. Serviço
# Relatorio Sisdap # Relatorio Sisdap
relatorioSisdapController.window.title=Reporte SISDAP relatorioSisdapController.window.title=Reporte SISDAP

View File

@ -478,6 +478,7 @@ relatorioReceitaServicoController.lbCidadeOrigem.value = Localidade Origem
relatorioReceitaServicoController.lbCidadeDestino.value = Localidade Destino relatorioReceitaServicoController.lbCidadeDestino.value = Localidade Destino
relatorioReceitaServicoController.lbEmpresa.value = Empresa relatorioReceitaServicoController.lbEmpresa.value = Empresa
relatorioReceitaServicoController.lbClase.value = Classe relatorioReceitaServicoController.lbClase.value = Classe
relatorioReceitaServicoController.lbServico.value = N. Serviço
# Relatorio Sisdap # Relatorio Sisdap
relatorioSisdapController.window.title=Relatório SISDAP relatorioSisdapController.window.title=Relatório SISDAP

View File

@ -73,7 +73,13 @@
model="@{winFiltroRelatorioReceitaServico$composer.lsClase}" model="@{winFiltroRelatorioReceitaServico$composer.lsClase}"
constraint="no empty" /> constraint="no empty" />
</row> </row>
<row>
<label
value="${c:l('relatorioReceitaServicoController.lbServico.value')}" />
<textbox id="txtCorridaId" width="95%"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
maxlength="7" />
</row>
</rows> </rows>