fixes bug#22131

dev:valdir
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@106762 d1611594-4594-4d17-8e1d-87c2c4800839
master
wilian 2021-05-18 18:58:59 +00:00
parent 294a46cc6a
commit 2bd9e12925
8 changed files with 159 additions and 81 deletions

View File

@ -40,12 +40,16 @@ public class RelatorioAproveitamento extends Relatorio {
Connection conexao = this.relatorio.getConexao(); Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros(); Map<String, Object> parametros = this.relatorio.getParametros();
Integer monedaId = (Integer) parametros.get("MONEDA_ID");
List<AproveitamentoBean> aproveitamentoList = new ArrayList<AproveitamentoBean>(); List<AproveitamentoBean> aproveitamentoList = new ArrayList<AproveitamentoBean>();
NamedParameterStatement stmt = new NamedParameterStatement(conexao, getSql()); NamedParameterStatement stmt = new NamedParameterStatement(conexao, getSql(monedaId));
stmt.setInt("CORRIDA_ID", Integer.valueOf((String) parametros.get("CORRIDA_ID"))); stmt.setInt("CORRIDA_ID", Integer.valueOf((String) parametros.get("CORRIDA_ID")));
stmt.setDate("FECCORRIDA", (java.sql.Date) parametros.get("FECCORRIDA")); stmt.setString("FECCORRIDA", (String) parametros.get("FECCORRIDA"));
if(monedaId != null) {
stmt.setInt("MONEDA_ID", monedaId);
}
ResultSet rset = stmt.executeQuery(); ResultSet rset = stmt.executeQuery();
while (rset.next()) { while (rset.next()) {
@ -127,7 +131,7 @@ public class RelatorioAproveitamento extends Relatorio {
NamedParameterStatement nps = new NamedParameterStatement(conexao, getSqlDetail()); NamedParameterStatement nps = new NamedParameterStatement(conexao, getSqlDetail());
nps.setInt("CORRIDA_ID", Integer.valueOf((String) parametros.get("CORRIDA_ID"))); nps.setInt("CORRIDA_ID", Integer.valueOf((String) parametros.get("CORRIDA_ID")));
nps.setDate("FECCORRIDA", (java.sql.Date) parametros.get("FECCORRIDA")); nps.setString("FECCORRIDA", (String) parametros.get("FECCORRIDA"));
rset = nps.executeQuery(); rset = nps.executeQuery();
@ -234,21 +238,21 @@ public class RelatorioAproveitamento extends Relatorio {
sql.append(" CT.NUMSECUENCIA "); sql.append(" CT.NUMSECUENCIA ");
sql.append(" FROM CORRIDA_TRAMO CT "); sql.append(" FROM CORRIDA_TRAMO CT ");
sql.append(" WHERE CT.CORRIDA_ID = :CORRIDA_ID "); sql.append(" WHERE CT.CORRIDA_ID = :CORRIDA_ID ");
sql.append(" AND TRUNC(CT.FECCORRIDA) = :FECCORRIDA "); sql.append(" AND CT.FECCORRIDA = to_date(:FECCORRIDA,'dd/mm/yyyy') ");
sql.append(" AND CT.ACTIVO = 1 "); sql.append(" AND CT.ACTIVO = 1 ");
sql.append(" UNION "); sql.append(" UNION ");
sql.append(" SELECT CT.DESTINO_ID, "); sql.append(" SELECT CT.DESTINO_ID, ");
sql.append(" CT.NUMSECUENCIA + 1 "); sql.append(" CT.NUMSECUENCIA + 1 ");
sql.append(" FROM CORRIDA_TRAMO CT "); sql.append(" FROM CORRIDA_TRAMO CT ");
sql.append(" WHERE CT.CORRIDA_ID = :CORRIDA_ID "); sql.append(" WHERE CT.CORRIDA_ID = :CORRIDA_ID ");
sql.append(" AND TRUNC(CT.FECCORRIDA) = :FECCORRIDA "); sql.append(" AND CT.FECCORRIDA = to_date(:FECCORRIDA,'dd/mm/yyyy') ");
sql.append(" AND CT.ACTIVO = 1 "); sql.append(" AND CT.ACTIVO = 1 ");
sql.append(" ORDER BY 2) VT, "); sql.append(" ORDER BY 2) VT, ");
sql.append(" PARADA PR, "); sql.append(" PARADA PR, ");
sql.append(" ROL_OPERATIVO RO, "); sql.append(" ROL_OPERATIVO RO, ");
sql.append(" DET_DIAGRAMA_AUTOBUS DD "); sql.append(" DET_DIAGRAMA_AUTOBUS DD ");
sql.append("WHERE CR.CORRIDA_ID = :CORRIDA_ID "); sql.append("WHERE CR.CORRIDA_ID = :CORRIDA_ID ");
sql.append(" AND TRUNC(CR.FECCORRIDA) = :FECCORRIDA "); sql.append(" AND CR.FECCORRIDA = to_date(:FECCORRIDA,'dd/mm/yyyy') ");
sql.append(" AND VT.PARADA_ID = PR.PARADA_ID "); sql.append(" AND VT.PARADA_ID = PR.PARADA_ID ");
sql.append(" AND CR.ROLOPERATIVO_ID = RO.ROLOPERATIVO_ID "); sql.append(" AND CR.ROLOPERATIVO_ID = RO.ROLOPERATIVO_ID ");
sql.append(" AND RO.DIAGRAMAAUTOBUS_ID = DD.DIAGRAMAAUTOBUS_ID "); sql.append(" AND RO.DIAGRAMAAUTOBUS_ID = DD.DIAGRAMAAUTOBUS_ID ");
@ -259,7 +263,7 @@ public class RelatorioAproveitamento extends Relatorio {
return sql.toString(); return sql.toString();
} }
private String getSql() { private String getSql(Integer monedaId) {
ConstanteService constanteService = (ConstanteService) AppContext.getApplicationContext().getBean("constanteService"); ConstanteService constanteService = (ConstanteService) AppContext.getApplicationContext().getBean("constanteService");
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
@ -288,7 +292,7 @@ public class RelatorioAproveitamento extends Relatorio {
sql.append(" (SELECT SUM(CANTKMREAL) FROM CORRIDA_TRAMO BO "); sql.append(" (SELECT SUM(CANTKMREAL) FROM CORRIDA_TRAMO BO ");
sql.append(" INNER JOIN TRAMO T ON T.TRAMO_ID = BO.TRAMO_ID "); sql.append(" INNER JOIN TRAMO T ON T.TRAMO_ID = BO.TRAMO_ID ");
sql.append(" WHERE BO.CORRIDA_ID = :CORRIDA_ID "); sql.append(" WHERE BO.CORRIDA_ID = :CORRIDA_ID ");
sql.append(" AND BO.FECCORRIDA = :FECCORRIDA "); sql.append(" AND BO.FECCORRIDA = to_date(:FECCORRIDA,'dd/mm/yyyy') ");
sql.append(" AND BO.ACTIVO = 1) AS KM_CORRIDA, "); sql.append(" AND BO.ACTIVO = 1) AS KM_CORRIDA, ");
sql.append(" (SELECT TF.PRECIO FROM CORRIDA CR "); sql.append(" (SELECT TF.PRECIO FROM CORRIDA CR ");
sql.append(" JOIN RUTA_COMBINACION RC ON RC.RUTA_ID = CR.RUTA_ID AND RC.ACTIVO = 1 "); sql.append(" JOIN RUTA_COMBINACION RC ON RC.RUTA_ID = CR.RUTA_ID AND RC.ACTIVO = 1 ");
@ -299,9 +303,14 @@ public class RelatorioAproveitamento extends Relatorio {
sql.append(" AND TF.TRAMO_ID = TR.TRAMO_ID "); sql.append(" AND TF.TRAMO_ID = TR.TRAMO_ID ");
sql.append(" AND TF.ORIGEN_ID = CR.ORIGEN_ID "); sql.append(" AND TF.ORIGEN_ID = CR.ORIGEN_ID ");
sql.append(" AND TF.DESTINO_ID = CR.DESTINO_ID "); sql.append(" AND TF.DESTINO_ID = CR.DESTINO_ID ");
if(monedaId != null) {
sql.append(" AND TF.MONEDA_ID = :MONEDA_ID ");
}
sql.append(" INNER JOIN VIGENCIA_TARIFA VT ON TF.VIGENCIATARIFA_ID = VT.VIGENCIATARIFA_ID "); sql.append(" INNER JOIN VIGENCIA_TARIFA VT ON TF.VIGENCIATARIFA_ID = VT.VIGENCIATARIFA_ID ");
sql.append(" WHERE CR.CORRIDA_ID = :CORRIDA_ID "); sql.append(" WHERE CR.CORRIDA_ID = :CORRIDA_ID ");
sql.append(" AND CR.FECCORRIDA = :FECCORRIDA "); sql.append(" AND CR.FECCORRIDA = to_date(:FECCORRIDA,'dd/mm/yyyy') ");
sql.append(" AND TF.STATUSTARIFA = 'A' "); sql.append(" AND TF.STATUSTARIFA = 'A' ");
sql.append(" AND TF.ACTIVO = 1 "); sql.append(" AND TF.ACTIVO = 1 ");
sql.append(" AND VT.ACTIVO = 1 "); sql.append(" AND VT.ACTIVO = 1 ");
@ -313,7 +322,7 @@ public class RelatorioAproveitamento extends Relatorio {
sql.append(" INNER JOIN DIAGRAMA_AUTOBUS DA ON RO.DIAGRAMAAUTOBUS_ID = DA.DIAGRAMAAUTOBUS_ID "); sql.append(" INNER JOIN DIAGRAMA_AUTOBUS DA ON RO.DIAGRAMAAUTOBUS_ID = DA.DIAGRAMAAUTOBUS_ID ");
sql.append(" WHERE "); sql.append(" WHERE ");
sql.append(" BO.CORRIDA_ID = :CORRIDA_ID "); sql.append(" BO.CORRIDA_ID = :CORRIDA_ID ");
sql.append(" AND BO.FECCORRIDA = :FECCORRIDA "); sql.append(" AND BO.FECCORRIDA = to_date(:FECCORRIDA,'dd/mm/yyyy') ");
sql.append(" AND CR.ACTIVO = 1 "); sql.append(" AND CR.ACTIVO = 1 ");
sql.append(" AND BO.ACTIVO = 1 "); sql.append(" AND BO.ACTIVO = 1 ");
sql.append(" AND BO.INDSTATUSOPERACION = 'F' "); sql.append(" AND BO.INDSTATUSOPERACION = 'F' ");

View File

@ -0,0 +1,21 @@
#geral
msg.noData=No fue posible obtener datos con los parámetros informados.
#Labels cabeçalho
cabecalho.relatorio=Reporte:
cabecalho.servico=Corrida:
cabecalho.data=Fecha:
cabecalho.moneda=Moneda:
#Labels header
sumario.totalArrecadado=Total recaudado:
sumario.arrecadadoKm=Recaudado/KM:
sumario.nominalKm=Nominal/KM:
sumario.ocupacao=Ocupación:
sumario.ocupacaoComArrecadacao=Ocupação com Arrecadação:
sumario.ocupacaoSemArrecadacao=Ocupación sin cobranza:
sumario.totalNominal=Total Nominal:
legenda.ocupacaoArrecadacao=Ocupación de pasajeros
legenda.ocupacaoOperacional=Ocupación operativa
legenda.poltronaExclusiva=Asiento exclusivo

View File

@ -5,6 +5,7 @@ msg.noData=N
cabecalho.relatorio=Relatório: cabecalho.relatorio=Relatório:
cabecalho.servico=Serviço: cabecalho.servico=Serviço:
cabecalho.data=Data: cabecalho.data=Data:
cabecalho.moneda=Moeda:
#Labels header #Labels header
sumario.totalArrecadado=Total Arrecadado: sumario.totalArrecadado=Total Arrecadado:

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="RelatorioAproveitamento" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="3308e98f-a36a-4ee6-bb41-be017c32427e"> <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="RelatorioAproveitamento" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="3308e98f-a36a-4ee6-bb41-be017c32427e">
<property name="ireport.zoom" value="1.6105100000000019"/> <property name="ireport.zoom" value="1.6105100000000019"/>
<property name="ireport.x" value="0"/> <property name="ireport.x" value="309"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<style name="Crosstab Data Text" hAlign="Center"/> <style name="Crosstab Data Text" hAlign="Center"/>
<style name="table"> <style name="table">
@ -40,6 +40,7 @@
<parameter name="P_TOTAL_NOMINAL" class="java.lang.String"/> <parameter name="P_TOTAL_NOMINAL" class="java.lang.String"/>
<parameter name="CORRIDA_ID" class="java.lang.String"/> <parameter name="CORRIDA_ID" class="java.lang.String"/>
<parameter name="FECCORRIDA" class="java.util.Date"/> <parameter name="FECCORRIDA" class="java.util.Date"/>
<parameter name="DESCMONEDA" class="java.lang.String"/>
<queryString> <queryString>
<![CDATA[]]> <![CDATA[]]>
</queryString> </queryString>
@ -56,197 +57,211 @@
<title> <title>
<band height="106" splitType="Stretch"> <band height="106" splitType="Stretch">
<rectangle> <rectangle>
<reportElement x="0" y="0" width="802" height="30" uuid="8f226d21-ccdb-41b4-a01d-fb0712f0b4d3"/> <reportElement uuid="8f226d21-ccdb-41b4-a01d-fb0712f0b4d3" x="0" y="0" width="802" height="30"/>
<graphicElement> <graphicElement>
<pen lineWidth="0.75" lineStyle="Solid"/> <pen lineWidth="0.75" lineStyle="Solid"/>
</graphicElement> </graphicElement>
</rectangle> </rectangle>
<rectangle> <rectangle>
<reportElement x="0" y="40" width="802" height="39" uuid="b6aa9717-79c4-4f13-91df-9b0255003a16"/> <reportElement uuid="b6aa9717-79c4-4f13-91df-9b0255003a16" x="0" y="40" width="802" height="39"/>
<graphicElement> <graphicElement>
<pen lineWidth="0.75" lineStyle="Solid"/> <pen lineWidth="0.75" lineStyle="Solid"/>
</graphicElement> </graphicElement>
</rectangle> </rectangle>
<textField> <textField>
<reportElement x="77" y="0" width="478" height="15" uuid="eb300dc6-1610-409d-8589-72b1539f86d3"/> <reportElement uuid="eb300dc6-1610-409d-8589-72b1539f86d3" x="77" y="0" width="531" height="15"/>
<textElement> <textElement>
<font size="9"/> <font size="9"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="12" y="15" width="65" height="15" uuid="a125ac5c-e00c-4ac5-bc03-317c514f1ad8"/> <reportElement uuid="a125ac5c-e00c-4ac5-bc03-317c514f1ad8" x="12" y="15" width="65" height="15"/>
<textElement markup="none"> <textElement markup="none">
<font size="9" isBold="true"/> <font size="9" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{cabecalho.servico}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.servico}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="244" y="15" width="65" height="15" uuid="88bb80e0-40a4-490c-914a-01a41178168b"/> <reportElement uuid="88bb80e0-40a4-490c-914a-01a41178168b" x="244" y="15" width="65" height="15"/>
<textElement markup="none"> <textElement markup="none">
<font size="9" isBold="true"/> <font size="9" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{cabecalho.data}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.data}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="77" y="15" width="167" height="15" uuid="a3d3c093-a9f4-4b32-823f-b4f548e46c2f"/> <reportElement uuid="a3d3c093-a9f4-4b32-823f-b4f548e46c2f" x="77" y="15" width="167" height="15"/>
<textElement> <textElement>
<font size="9"/> <font size="9"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{CORRIDA_ID}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{CORRIDA_ID}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="12" y="40" width="78" height="11" uuid="995111bb-4726-421b-a538-db8b53b3f206"/> <reportElement uuid="995111bb-4726-421b-a538-db8b53b3f206" x="12" y="40" width="78" height="11"/>
<textElement markup="none"> <textElement markup="none">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{sumario.totalArrecadado}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{sumario.totalArrecadado}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="12" y="51" width="78" height="11" uuid="3a0c6793-e57f-44c7-8588-1692055bf62a"/> <reportElement uuid="3a0c6793-e57f-44c7-8588-1692055bf62a" x="12" y="51" width="78" height="11"/>
<textElement markup="none"> <textElement markup="none">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{sumario.arrecadadoKm}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{sumario.arrecadadoKm}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="255" y="40" width="130" height="11" uuid="a0ec9db5-a7be-4407-b257-e49dd7fe6811"/> <reportElement uuid="a0ec9db5-a7be-4407-b257-e49dd7fe6811" x="255" y="40" width="130" height="11"/>
<textElement markup="none"> <textElement markup="none">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{sumario.ocupacao}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{sumario.ocupacao}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="255" y="51" width="130" height="11" uuid="0325af45-b23b-45ba-a8c6-dea75a36bb75"/> <reportElement uuid="0325af45-b23b-45ba-a8c6-dea75a36bb75" x="255" y="51" width="130" height="11"/>
<textElement markup="none"> <textElement markup="none">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{sumario.ocupacaoComArrecadacao}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{sumario.ocupacaoComArrecadacao}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="12" y="63" width="78" height="11" uuid="bec7dafe-b775-495d-8233-301b351597ac"/> <reportElement uuid="bec7dafe-b775-495d-8233-301b351597ac" x="12" y="63" width="78" height="11"/>
<textElement markup="none"> <textElement markup="none">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{sumario.nominalKm}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{sumario.nominalKm}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="255" y="63" width="130" height="11" uuid="fcaa51c2-2057-4aa4-bb84-adae3ef5c34e"/> <reportElement uuid="fcaa51c2-2057-4aa4-bb84-adae3ef5c34e" x="255" y="63" width="130" height="11"/>
<textElement markup="none"> <textElement markup="none">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{sumario.ocupacaoSemArrecadacao}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{sumario.ocupacaoSemArrecadacao}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="542" y="40" width="78" height="11" uuid="5cc7b439-0a60-4581-a67c-83519a4fd977"/> <reportElement uuid="5cc7b439-0a60-4581-a67c-83519a4fd977" x="542" y="40" width="78" height="11"/>
<textElement markup="none"> <textElement markup="none">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{sumario.totalNominal}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{sumario.totalNominal}]]></textFieldExpression>
</textField> </textField>
<line> <line>
<reportElement x="243" y="40" width="1" height="39" forecolor="#CCCCCC" uuid="5b56b7a4-1abd-43cc-8071-e949d5575a45"/> <reportElement uuid="5b56b7a4-1abd-43cc-8071-e949d5575a45" x="243" y="40" width="1" height="39" forecolor="#CCCCCC"/>
</line> </line>
<line> <line>
<reportElement x="530" y="40" width="1" height="39" forecolor="#CCCCCC" uuid="98b93926-7900-4445-bbe6-024e456fd45e"/> <reportElement uuid="98b93926-7900-4445-bbe6-024e456fd45e" x="530" y="40" width="1" height="39" forecolor="#CCCCCC"/>
</line> </line>
<textField> <textField>
<reportElement x="90" y="63" width="85" height="11" uuid="bdfd7f9e-e50e-4a8b-bba4-2fc8a909f38b"/> <reportElement uuid="bdfd7f9e-e50e-4a8b-bba4-2fc8a909f38b" x="90" y="63" width="85" height="11"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{P_NOMINAL_KM}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{P_NOMINAL_KM}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="90" y="40" width="85" height="11" uuid="7eb2d8d3-4a3f-40cd-8117-8e53ab128f34"/> <reportElement uuid="7eb2d8d3-4a3f-40cd-8117-8e53ab128f34" x="90" y="40" width="85" height="11"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{P_TOTAL_ARRECADADO}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{P_TOTAL_ARRECADADO}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="90" y="51" width="85" height="11" uuid="64600377-6028-4c56-b0f1-3acf6ceeb708"/> <reportElement uuid="64600377-6028-4c56-b0f1-3acf6ceeb708" x="90" y="51" width="85" height="11"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{P_ARRECADO_KM}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{P_ARRECADO_KM}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="385" y="40" width="33" height="11" uuid="6b68d2b4-0fa0-41a4-bdf5-0eaccb7d1f59"/> <reportElement uuid="6b68d2b4-0fa0-41a4-bdf5-0eaccb7d1f59" x="385" y="40" width="33" height="11"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{P_OCUPACAO}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{P_OCUPACAO}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="385" y="51" width="33" height="11" uuid="66317ebd-e503-420c-8886-8385b782770d"/> <reportElement uuid="66317ebd-e503-420c-8886-8385b782770d" x="385" y="51" width="33" height="11"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{P_OCUPACAO_ARRECADACAO}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{P_OCUPACAO_ARRECADACAO}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="385" y="63" width="33" height="11" uuid="a6ff7221-60b5-4d08-b7e8-7b10db0b97a6"/> <reportElement uuid="a6ff7221-60b5-4d08-b7e8-7b10db0b97a6" x="385" y="63" width="33" height="11"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{P_OCUPACAO_S_ARRECADACAO}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{P_OCUPACAO_S_ARRECADACAO}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="628" y="40" width="74" height="11" uuid="9eebfdd7-504b-4e98-8893-63bdb8c02b54"/> <reportElement uuid="9eebfdd7-504b-4e98-8893-63bdb8c02b54" x="628" y="40" width="74" height="11"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font size="8"/> <font size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{P_TOTAL_NOMINAL}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{P_TOTAL_NOMINAL}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="309" y="15" width="100" height="15" uuid="0eccc14c-3288-43e8-8731-7c876e4d659e"/> <reportElement uuid="0eccc14c-3288-43e8-8731-7c876e4d659e" x="309" y="15" width="100" height="15"/>
<textElement> <textElement>
<font size="9"/> <font size="9"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{DATA}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{DATA}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="12" y="0" width="65" height="15" uuid="11a895de-bf79-45dc-8d47-ea6ef8bf562c"/> <reportElement uuid="11a895de-bf79-45dc-8d47-ea6ef8bf562c" x="12" y="0" width="65" height="15"/>
<textElement> <textElement>
<font size="9" isBold="true"/> <font size="9" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{cabecalho.relatorio}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.relatorio}]]></textFieldExpression>
</textField> </textField>
<staticText> <staticText>
<reportElement style="Crosstab Data Text" x="72" y="87" width="18" height="8" uuid="3a123294-f53f-40c2-b412-ff71cb7f2d98"/> <reportElement uuid="3a123294-f53f-40c2-b412-ff71cb7f2d98" style="Crosstab Data Text" x="72" y="87" width="18" height="8"/>
<textElement> <textElement>
<font size="6" isBold="true"/> <font size="6" isBold="true"/>
</textElement> </textElement>
<text><![CDATA[O]]></text> <text><![CDATA[O]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement style="Crosstab Data Text" x="200" y="87" width="18" height="8" backcolor="#FFFFFF" uuid="756fd1c7-16bc-4f9a-8e98-c31b46cc48b6"/> <reportElement uuid="756fd1c7-16bc-4f9a-8e98-c31b46cc48b6" style="Crosstab Data Text" x="200" y="87" width="18" height="8" backcolor="#FFFFFF"/>
<textElement> <textElement>
<font size="6" isBold="true"/> <font size="6" isBold="true"/>
</textElement> </textElement>
<text><![CDATA[E]]></text> <text><![CDATA[E]]></text>
</staticText> </staticText>
<textField> <textField>
<reportElement x="90" y="87" width="76" height="8" uuid="ed96b163-866d-4f9c-8955-38eee360f49e"/> <reportElement uuid="ed96b163-866d-4f9c-8955-38eee360f49e" x="90" y="87" width="76" height="8"/>
<textElement markup="none"> <textElement markup="none">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{legenda.ocupacaoOperacional}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{legenda.ocupacaoOperacional}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="218" y="87" width="76" height="8" uuid="1eb3ad3e-e20c-4852-892c-dff3ecf5da3f"/> <reportElement uuid="1eb3ad3e-e20c-4852-892c-dff3ecf5da3f" x="218" y="87" width="76" height="8"/>
<textElement markup="none"> <textElement markup="none">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{legenda.poltronaExclusiva}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{legenda.poltronaExclusiva}]]></textFieldExpression>
</textField> </textField>
<textField>
<reportElement uuid="30ce4f5d-d891-4be8-aeaa-694bcb2c3d6e" x="410" y="15" width="65" height="15"/>
<textElement markup="none">
<font size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.moneda}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="63080cb0-d5df-4465-aedc-8b4f5035cd07" x="475" y="15" width="133" height="15"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$P{DESCMONEDA}]]></textFieldExpression>
</textField>
</band> </band>
</title> </title>
<summary> <summary>
<band height="47"> <band height="47">
<crosstab> <crosstab>
<reportElement x="0" y="0" width="802" height="47" uuid="eff55ca1-3935-4726-82a1-4a15e4518714"/> <reportElement uuid="eff55ca1-3935-4726-82a1-4a15e4518714" x="0" y="0" width="802" height="47"/>
<rowGroup name="asiento" width="16"> <rowGroup name="asiento" width="16">
<bucket class="java.math.BigDecimal"> <bucket class="java.math.BigDecimal">
<bucketExpression><![CDATA[$F{asiento}]]></bucketExpression> <bucketExpression><![CDATA[$F{asiento}]]></bucketExpression>
@ -257,7 +272,7 @@
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box> </box>
<textField> <textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="15" height="8" uuid="1d4e483e-bf24-4da5-ab8c-62bf83e6c1bb"/> <reportElement uuid="1d4e483e-bf24-4da5-ab8c-62bf83e6c1bb" style="Crosstab Data Text" x="0" y="0" width="15" height="8"/>
<textElement> <textElement>
<font size="6"/> <font size="6"/>
</textElement> </textElement>
@ -294,7 +309,7 @@
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box> </box>
<textField> <textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="10" uuid="92b133ad-3903-4c0c-8aeb-593d907cac98"/> <reportElement uuid="92b133ad-3903-4c0c-8aeb-593d907cac98" style="Crosstab Data Text" x="0" y="0" width="20" height="10"/>
<textElement> <textElement>
<font size="7"/> <font size="7"/>
</textElement> </textElement>
@ -319,52 +334,48 @@
</box> </box>
<elementGroup> <elementGroup>
<rectangle radius="0"> <rectangle radius="0">
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#00FFFF" uuid="bc96586e-75d2-4c8a-9225-f63fe33165d0"> <reportElement uuid="bc96586e-75d2-4c8a-9225-f63fe33165d0" style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#00FFFF">
<printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 1]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 1]]></printWhenExpression>
</reportElement> </reportElement>
</rectangle> </rectangle>
<rectangle radius="0"> <rectangle radius="0">
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#FFAFAF" uuid="259b2b7f-cade-4df7-9c89-72a225c62776"> <reportElement uuid="259b2b7f-cade-4df7-9c89-72a225c62776" style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#FFAFAF">
<printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 2]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 2]]></printWhenExpression>
</reportElement> </reportElement>
</rectangle> </rectangle>
<rectangle radius="0"> <rectangle radius="0">
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#C0C0C0" uuid="8e43f640-9de0-457e-938d-ca2d7012d919"> <reportElement uuid="8e43f640-9de0-457e-938d-ca2d7012d919" style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#C0C0C0">
<printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 3]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 3]]></printWhenExpression>
</reportElement> </reportElement>
</rectangle> </rectangle>
<rectangle radius="0"> <rectangle radius="0">
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#00FF00" uuid="81e379b2-8a72-44d9-9561-e43b82e98e3c"> <reportElement uuid="81e379b2-8a72-44d9-9561-e43b82e98e3c" style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#00FF00">
<printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 4]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 4]]></printWhenExpression>
</reportElement> </reportElement>
</rectangle> </rectangle>
<rectangle radius="0"> <rectangle radius="0">
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#FF0000" uuid="14f27af8-ce53-48f5-ab9d-991aafbe15bb"> <reportElement uuid="14f27af8-ce53-48f5-ab9d-991aafbe15bb" style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#FF0000">
<printWhenExpression><![CDATA[$V{ocupadoMeasure} == null ? $V{ocupadoOperacaoMeasure} != null: $V{ocupadoMeasure}.intValue() == 5 <printWhenExpression><![CDATA[$V{ocupadoMeasure} == null ? $V{ocupadoOperacaoMeasure} != null: $V{ocupadoMeasure}.intValue() == 5]]></printWhenExpression>
]]></printWhenExpression>
</reportElement> </reportElement>
</rectangle> </rectangle>
<rectangle radius="0"> <rectangle radius="0">
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#FF00FF" uuid="b98ab63f-8b99-4e97-a439-e5b0d4afa627"> <reportElement uuid="b98ab63f-8b99-4e97-a439-e5b0d4afa627" style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#FF00FF">
<printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 6]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 6]]></printWhenExpression>
</reportElement> </reportElement>
</rectangle> </rectangle>
<rectangle radius="0"> <rectangle radius="0">
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#FFFF00" uuid="a7c3a624-f104-421e-afb0-01abc19644ec"> <reportElement uuid="a7c3a624-f104-421e-afb0-01abc19644ec" style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#000000" backcolor="#FFFF00">
<printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 7]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() == 7]]></printWhenExpression>
</reportElement> </reportElement>
</rectangle> </rectangle>
<rectangle radius="0"> <rectangle radius="0">
<reportElement style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#FFFFFF" backcolor="#000000" uuid="0f50449e-8901-4eec-bca1-c7343268a0ff"> <reportElement uuid="0f50449e-8901-4eec-bca1-c7343268a0ff" style="Crosstab Data Text" x="0" y="0" width="20" height="8" forecolor="#FFFFFF" backcolor="#000000">
<printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() > 7]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoMeasure}.intValue() > 7]]></printWhenExpression>
</reportElement> </reportElement>
</rectangle> </rectangle>
</elementGroup> </elementGroup>
<staticText> <staticText>
<reportElement style="Crosstab Data Text" x="0" y="2" width="20" height="2" uuid="8fcc35fd-62a3-4480-bc4e-467eb3668653"> <reportElement uuid="8fcc35fd-62a3-4480-bc4e-467eb3668653" style="Crosstab Data Text" x="0" y="2" width="20" height="2">
<printWhenExpression><![CDATA[$V{ocupadoOperacaoMeasure}.intValue() == 2]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoOperacaoMeasure}.intValue() == 2]]></printWhenExpression>
</reportElement> </reportElement>
<textElement> <textElement>
@ -373,7 +384,7 @@
<text><![CDATA[O]]></text> <text><![CDATA[O]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement style="Crosstab Data Text" x="0" y="4" width="20" height="2" uuid="55cf6871-62ff-4e1f-867f-8e22dbfdc305"> <reportElement uuid="55cf6871-62ff-4e1f-867f-8e22dbfdc305" style="Crosstab Data Text" x="0" y="4" width="20" height="2">
<printWhenExpression><![CDATA[$V{ocupadoOperacaoMeasure}.intValue() == 1]]></printWhenExpression> <printWhenExpression><![CDATA[$V{ocupadoOperacaoMeasure}.intValue() == 1]]></printWhenExpression>
</reportElement> </reportElement>
<textElement> <textElement>
@ -389,7 +400,8 @@
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box> </box>
<textField> <textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" uuid="10f494b4-33d7-49c7-ac38-32cb02d7c493"/> <reportElement uuid="10f494b4-33d7-49c7-ac38-32cb02d7c493" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression>
</textField> </textField>
</cellContents> </cellContents>
@ -400,7 +412,8 @@
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box> </box>
<textField> <textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF" uuid="294894a3-4154-42ab-a716-5b0b0baac4d1"/> <reportElement uuid="294894a3-4154-42ab-a716-5b0b0baac4d1" style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF"/>
<textElement/>
<textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression>
</textField> </textField>
</cellContents> </cellContents>
@ -411,7 +424,8 @@
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box> </box>
<textField> <textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF" uuid="39e993e0-05ef-447e-82db-d0ae1829485b"/> <reportElement uuid="39e993e0-05ef-447e-82db-d0ae1829485b" style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF"/>
<textElement/>
<textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression>
</textField> </textField>
</cellContents> </cellContents>
@ -422,7 +436,8 @@
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box> </box>
<textField> <textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" uuid="5b616be4-ef52-429c-8752-84f5873a23da"/> <reportElement uuid="5b616be4-ef52-429c-8752-84f5873a23da" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression>
</textField> </textField>
</cellContents> </cellContents>
@ -433,7 +448,8 @@
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box> </box>
<textField> <textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" uuid="4adf1aa7-2515-434f-98c7-26072ed402b5"/> <reportElement uuid="4adf1aa7-2515-434f-98c7-26072ed402b5" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{ocupadoMeasure}]]></textFieldExpression>
</textField> </textField>
</cellContents> </cellContents>
@ -444,7 +460,7 @@
<noData> <noData>
<band height="50"> <band height="50">
<textField> <textField>
<reportElement x="12" y="16" width="530" height="20" uuid="4a218426-e82c-4eed-9f30-eb9430eef10b"/> <reportElement uuid="4a218426-e82c-4eed-9f30-eb9430eef10b" x="12" y="16" width="530" height="20"/>
<textElement markup="none"> <textElement markup="none">
<font size="11" isBold="true"/> <font size="11" isBold="true"/>
</textElement> </textElement>

View File

@ -88,7 +88,7 @@ public class AproveitamentoBean {
} }
public BigDecimal getTarifa() { public BigDecimal getTarifa() {
return tarifa; return tarifa != null ? tarifa : BigDecimal.ZERO;
} }
public void setTarifa(BigDecimal tarifa) { public void setTarifa(BigDecimal tarifa) {

View File

@ -28,11 +28,14 @@ import org.zkoss.zul.ComboitemRenderer;
import org.zkoss.zul.Datebox; import org.zkoss.zul.Datebox;
import com.rjconsultores.ventaboletos.entidad.Corrida; import com.rjconsultores.ventaboletos.entidad.Corrida;
import com.rjconsultores.ventaboletos.entidad.Moneda;
import com.rjconsultores.ventaboletos.entidad.Parada; import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAproveitamento; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAproveitamento;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.CorridaService; import com.rjconsultores.ventaboletos.service.CorridaService;
import com.rjconsultores.ventaboletos.service.MonedaService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.utilerias.DateUtil;
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;
@ -54,6 +57,8 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer
@Autowired @Autowired
private CorridaService corridaService; private CorridaService corridaService;
@Autowired MonedaService monedaService;
private Datebox fecCorrida; private Datebox fecCorrida;
private MyTextbox txtCorridaId; private MyTextbox txtCorridaId;
@ -63,10 +68,12 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer
private MyComboboxParadaCve cmbParadaDestinoCve; private MyComboboxParadaCve cmbParadaDestinoCve;
private Button btnExecutarRelatorio; private Button btnExecutarRelatorio;
private MyListbox corridaList; private MyListbox corridaList;
private MyComboboxEstandar cmbMoneda;
@Autowired @Autowired
private DataSource dataSourceRead; private DataSource dataSourceRead;
private Moneda monedaDefault;
public Datebox getFecCorrida() { public Datebox getFecCorrida() {
return fecCorrida; return fecCorrida;
@ -116,6 +123,13 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer
} }
}); });
if(monedaDefault == null) {
monedaDefault = monedaService.obtenerID(1);
if(monedaDefault != null) {
cmbMoneda.setValue(monedaDefault.getDescmoneda());
}
}
} }
public void onClick$btnBuscarServico(Event ev) throws Exception { public void onClick$btnBuscarServico(Event ev) throws Exception {
@ -168,7 +182,6 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer
btnExecutarRelatorio.setDisabled(false); btnExecutarRelatorio.setDisabled(false);
} }
@SuppressWarnings("deprecation")
private void refreshLista() { private void refreshLista() {
Parada origem = null; Parada origem = null;
@ -185,10 +198,7 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer
Date data = null; Date data = null;
if (fecCorrida.getValue() != null) { if (fecCorrida.getValue() != null) {
data = fecCorrida.getValue(); data = DateUtil.normalizarToFecha(fecCorrida.getValue());
data.setHours(00);
data.setMinutes(00);
data.setSeconds(00);
} }
Integer corridaId = null; Integer corridaId = null;
if (txtCorridaId.getValue() != null && !txtCorridaId.getValue().isEmpty()) { if (txtCorridaId.getValue() != null && !txtCorridaId.getValue().isEmpty()) {
@ -255,9 +265,18 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer
return; return;
} }
if(cmbMoneda.getSelectedIndex() > -1) {
Moneda moneda = (Moneda) cmbMoneda.getSelectedItem().getValue();
parametros.put("MONEDA_ID", moneda.getMonedaId());
parametros.put("DESCMONEDA", moneda.getDescmoneda());
} else if(monedaDefault != null) {
parametros.put("MONEDA_ID", this.monedaDefault.getMonedaId());
parametros.put("DESCMONEDA", this.monedaDefault.getDescmoneda());
}
parametros.put("CORRIDA_ID", this.txtCorridaId.getValue()); parametros.put("CORRIDA_ID", this.txtCorridaId.getValue());
parametros.put("FECCORRIDA", new java.sql.Date(((java.util.Date) this.fecCorrida.getValue()).getTime())); parametros.put("FECCORRIDA", DateUtil.getStringDate(this.fecCorrida.getValue(), DateUtil.ddMMaa));
parametros.put("DATA", DateUtil.getStringDate((java.util.Date) this.fecCorrida.getValue())); // Utilizada para exibição no cabeçalho parametros.put("DATA", DateUtil.getStringDate(this.fecCorrida.getValue())); // Utilizada para exibição no cabeçalho
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioAproveitamentoController.window.title")); parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioAproveitamentoController.window.title"));
Relatorio relatorio = new RelatorioAproveitamento(parametros, dataSourceRead.getConnection()); Relatorio relatorio = new RelatorioAproveitamento(parametros, dataSourceRead.getConnection());
@ -269,4 +288,8 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer
} }
public List<Moneda> getListMoneda() {
return monedaService.obtenerTodosSortedByID();
}
} }

View File

@ -8,12 +8,12 @@
<window id="winFiltroRelatorioAproveitamento" <window id="winFiltroRelatorioAproveitamento"
apply="${relatorioAproveitamentoController}" apply="${relatorioAproveitamentoController}"
contentStyle="overflow:auto" height="340px" width="750px" contentStyle="overflow:auto" height="340px" width="750px"
border="normal"> border="normal" sizable="true">
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="15%" /> <column width="15%" />
<column width="15%" /> <column width="20%" />
<column width="70%" /> <column width="65%" />
</columns> </columns>
<rows> <rows>
@ -23,26 +23,26 @@
value="${c:l('editarTramosController.labelOrigen.value')}" /> value="${c:l('editarTramosController.labelOrigen.value')}" />
<combobox id="cmbParadaOrigemCve" <combobox id="cmbParadaOrigemCve"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve"
mold="rounded" buttonVisible="true" width="100%" /> mold="rounded" buttonVisible="true" width="95%" />
<combobox id="cmbParadaOrigem" <combobox id="cmbParadaOrigem"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada"
mold="rounded" buttonVisible="true" width="60%" /> mold="rounded" buttonVisible="true" width="80%" />
</row> </row>
<row> <row>
<label <label
value="${c:l('editarTramosController.labelDestino.value')}" /> value="${c:l('editarTramosController.labelDestino.value')}" />
<combobox id="cmbParadaDestinoCve" autodrop="false" <combobox id="cmbParadaDestinoCve" autodrop="false"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve"
mold="rounded" buttonVisible="true" width="100%" /> mold="rounded" buttonVisible="true" width="95%" />
<combobox id="cmbParadaDestino" autodrop="false" <combobox id="cmbParadaDestino" autodrop="false"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada"
mold="rounded" buttonVisible="true" width="60%" /> mold="rounded" buttonVisible="true" width="80%" />
</row> </row>
<row> <row>
<label <label
value="${c:l('relatorioAproveitamentoController.lbFecCorrida.value')}" /> value="${c:l('relatorioAproveitamentoController.lbFecCorrida.value')}" />
<datebox id="fecCorrida" width="100%" <datebox id="fecCorrida" width="95%"
format="dd/MM/yyyy" constraint="no empty" format="dd/MM/yyyy" constraint="no empty"
maxlength="10" /> maxlength="10" />
</row> </row>
@ -53,6 +53,14 @@
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
maxlength="7" /> maxlength="7" />
</row> </row>
<row>
<label
value="${c:l('busquedaMonedaController.window.title')}" />
<combobox id="cmbMoneda"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioAproveitamento$composer.listMoneda}"
width="95%"/>
</row>
</rows> </rows>
</grid> </grid>