fixes bug#21093
qua: dev:Valdir git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@105004 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
136365f087
commit
fcf76d8739
|
@ -116,6 +116,7 @@ public class RelatorioLinhasHorario extends Relatorio {
|
|||
BigDecimal totalPedagio = BigDecimal.ZERO;
|
||||
|
||||
String group = null;
|
||||
List<Long> listaCorridas = new ArrayList<Long>();
|
||||
while (rset.next()) {
|
||||
RelatorioLinhasHorarioBean horarioBean = new RelatorioLinhasHorarioBean();
|
||||
|
||||
|
@ -124,13 +125,15 @@ public class RelatorioLinhasHorario extends Relatorio {
|
|||
horarioBean.setTipoLinha((String) rset.getObject("TIPO_LINHA"));
|
||||
horarioBean.setHora((String) rset.getObject("HORA"));
|
||||
horarioBean.setServico((BigDecimal) rset.getObject("SERVICO"));
|
||||
horarioBean.setServico2((BigDecimal) rset.getObject("SERVICO2"));
|
||||
|
||||
if (rset.getObject("SENTIDO") != null) {
|
||||
horarioBean.convetSentido((BigDecimal) rset.getObject("SENTIDO"));
|
||||
} else {
|
||||
horarioBean.convetSentido(null);
|
||||
}
|
||||
Boolean isDoubleDeck = BigDecimal.ZERO.equals((BigDecimal) rset.getObject("ISDOUBLEDECK")) ? Boolean.FALSE : Boolean.TRUE;
|
||||
horarioBean.setIsDoubleDeck(BigDecimal.ZERO.equals((BigDecimal) rset.getObject("ISDOUBLEDECK")) ? Boolean.FALSE : Boolean.TRUE);
|
||||
|
||||
horarioBean.setLot((BigDecimal) rset.getObject("LOT"));
|
||||
horarioBean.setCla((String) rset.getObject("CLA"));
|
||||
horarioBean.setExtensao((BigDecimal) rset.getObject("EXTENSAO"));
|
||||
|
@ -179,9 +182,18 @@ public class RelatorioLinhasHorario extends Relatorio {
|
|||
totalOrdinario = totalOrdinario.add(horarioBean.getOrd() != null ? horarioBean.getOrd() : BigDecimal.ZERO);
|
||||
totalExtra = totalExtra.add(horarioBean.getExtra() != null ? horarioBean.getExtra() : BigDecimal.ZERO);
|
||||
totalViagem = totalViagem.add(horarioBean.getTotalViagem() != null ? horarioBean.getTotalViagem() : BigDecimal.ZERO);
|
||||
if(isDoubleDeck) {
|
||||
totalKmRodado = totalKmRodado.add(horarioBean.getKmRodado() != null ? horarioBean.getKmRodado() : BigDecimal.ZERO);
|
||||
//No double deck corrida2_id estrá preenchido para os dois pisos (nas duas corridas).
|
||||
//Implementado esta lógica para não somar os dois KMs. Deverá somar somente um dos pisos
|
||||
if(Boolean.TRUE.equals(horarioBean.getIsDoubleDeck())) {
|
||||
if(horarioBean.getServico2()!=null && !listaCorridas.contains(horarioBean.getServico2().longValue())) {
|
||||
//Um dos pisos não será marcadado como double deck para não realizar o agrupamento dentro do relatório.
|
||||
horarioBean.setIsDoubleDeck(Boolean.FALSE);
|
||||
totalKmRodado = totalKmRodado.add(horarioBean.getKmRodado() != null ? horarioBean.getKmRodado() : BigDecimal.ZERO);
|
||||
}
|
||||
}else {
|
||||
totalKmRodado = totalKmRodado.add(horarioBean.getKmRodado() != null ? horarioBean.getKmRodado() : BigDecimal.ZERO);
|
||||
}
|
||||
listaCorridas.add(horarioBean.getServico().longValue());
|
||||
totalAbsoluto = totalAbsoluto.add(horarioBean.getAbsol() != null ? horarioBean.getAbsol() : BigDecimal.ZERO);
|
||||
totalEquivalente = totalEquivalente.add(horarioBean.getEquivalente() != null ? horarioBean.getEquivalente() : BigDecimal.ZERO);
|
||||
|
||||
|
@ -393,6 +405,7 @@ public class RelatorioLinhasHorario extends Relatorio {
|
|||
sql.append(" GRUPO_RUTA, ");
|
||||
sql.append(" HORA, ");
|
||||
sql.append(" SERVICO, ");
|
||||
sql.append(" SERVICO2, ");
|
||||
sql.append(" SENTIDO , ");
|
||||
sql.append(" LOT, ");
|
||||
sql.append(" CLA, ");
|
||||
|
@ -418,6 +431,7 @@ public class RelatorioLinhasHorario extends Relatorio {
|
|||
sql.append(" NVL(GR.DESCGRUPO, 'Não Definido') AS GRUPO_RUTA, ");
|
||||
sql.append(" TO_CHAR(C.FECHORSALIDA, 'HH24:MI') AS HORA, ");
|
||||
sql.append(" C.CORRIDA_ID AS SERVICO, ");
|
||||
sql.append(" C.CORRIDA2_ID AS SERVICO2, ");
|
||||
sql.append(" R.INDSENTIDOIDA AS SENTIDO, ");
|
||||
sql.append(" DA.CANTASIENTOS AS LOT, ");
|
||||
sql.append(" NVL(CS.DESCCLASE, '') AS CLA, ");
|
||||
|
@ -604,9 +618,9 @@ public class RelatorioLinhasHorario extends Relatorio {
|
|||
sql.append(" CO.ESTADO_ID, CD.ESTADO_ID, ORIGEM.CVEPARADA, DESTINO.CVEPARADA, CJ.PRECIOPAGADO, ");
|
||||
sql.append(" CJ.IMPORTESEGURO, CJ.IMPORTETAXAEMBARQUE, CJ.IMPORTEPEDAGIO, ");
|
||||
sql.append(" CJ.EQUIVALENTE, CJ.KM_REAL , CJ.BOLETO_ID, C.CORRIDA2_ID ) ");
|
||||
sql.append("GROUP BY GRUPO_RUTA, HORA, SERVICO, SENTIDO, LOT, CLA, TARIFA, ORIGEM, DESTINO, ");
|
||||
sql.append("GROUP BY GRUPO_RUTA, HORA, SERVICO, SERVICO2, SENTIDO, LOT, CLA, TARIFA, ORIGEM, DESTINO, ");
|
||||
sql.append(" EXTENSAO, BAGAGENS, ORD, EXTRA, TIPO_LINHA, ISDOUBLEDECK, ABSOL ");
|
||||
sql.append("ORDER BY TIPO_LINHA, GRUPO_RUTA, SERVICO, ORIGEM, DESTINO ");
|
||||
sql.append("ORDER BY TIPO_LINHA, GRUPO_RUTA, SERVICO, SERVICO2, ORIGEM, DESTINO ");
|
||||
|
||||
return sql.toString();
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -1,8 +1,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="RelatorioLinhasHorario" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ae2cbb01-bc79-4d18-8206-3b59273fe793">
|
||||
<property name="ireport.zoom" value="2.0"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.y" value="131"/>
|
||||
<property name="ireport.x" value="516"/>
|
||||
<property name="ireport.y" value="83"/>
|
||||
<parameter name="NOMBEMPRESA" class="java.lang.String"/>
|
||||
<parameter name="DATA_INICIO" class="java.sql.Timestamp">
|
||||
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
|
||||
|
@ -67,6 +67,7 @@
|
|||
<field name="iap" class="java.math.BigDecimal"/>
|
||||
<field name="tipoLinha" class="java.lang.String"/>
|
||||
<field name="pedagio" class="java.math.BigDecimal"/>
|
||||
<field name="isDoubleDeck" class="java.lang.Boolean"/>
|
||||
<variable name="passagens_group" class="java.math.BigDecimal" resetType="Group" resetGroup="groupRuta" calculation="Sum">
|
||||
<variableExpression><![CDATA[$F{passagens}]]></variableExpression>
|
||||
</variable>
|
||||
|
@ -92,7 +93,7 @@
|
|||
<variableExpression><![CDATA[$F{totalViagem}]]></variableExpression>
|
||||
</variable>
|
||||
<variable name="kmRodado_group" class="java.math.BigDecimal" resetType="Group" resetGroup="groupRuta" calculation="Sum">
|
||||
<variableExpression><![CDATA[$F{kmRodado}]]></variableExpression>
|
||||
<variableExpression><![CDATA[!Boolean.TRUE.equals($F{isDoubleDeck}) ? $F{kmRodado} : BigDecimal.ZERO]]></variableExpression>
|
||||
</variable>
|
||||
<variable name="absol_group" class="java.math.BigDecimal" resetType="Group" resetGroup="groupRuta" calculation="Sum">
|
||||
<variableExpression><![CDATA[$F{absol}]]></variableExpression>
|
||||
|
|
|
@ -10,6 +10,7 @@ public class RelatorioLinhasHorarioBean {
|
|||
private String destino;
|
||||
private String hora;
|
||||
private BigDecimal servico;
|
||||
private BigDecimal servico2;
|
||||
private String trecho;
|
||||
private String sentido;
|
||||
private BigDecimal lot;
|
||||
|
@ -42,11 +43,20 @@ public class RelatorioLinhasHorarioBean {
|
|||
private BigDecimal extraLinha;
|
||||
private BigDecimal somaExtensaoTrecho;
|
||||
private String descRuta;
|
||||
private Boolean isDoubleDeck;
|
||||
|
||||
|
||||
public RelatorioLinhasHorarioBean() {
|
||||
}
|
||||
|
||||
public BigDecimal getServico2() {
|
||||
return servico2;
|
||||
}
|
||||
|
||||
public void setServico2(BigDecimal servico2) {
|
||||
this.servico2 = servico2;
|
||||
}
|
||||
|
||||
public String getSentido() {
|
||||
return sentido;
|
||||
}
|
||||
|
@ -363,4 +373,12 @@ public class RelatorioLinhasHorarioBean {
|
|||
public void setDescRuta(String descRuta) {
|
||||
this.descRuta = descRuta;
|
||||
}
|
||||
|
||||
public Boolean getIsDoubleDeck() {
|
||||
return isDoubleDeck;
|
||||
}
|
||||
|
||||
public void setIsDoubleDeck(Boolean isDoubleDeck) {
|
||||
this.isDoubleDeck = isDoubleDeck;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue