Acertos no RLH (bug #6629)

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@48017 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2015-09-19 03:07:38 +00:00
parent 1036846c93
commit 61fbf66e15
1 changed files with 17 additions and 17 deletions

View File

@ -121,18 +121,17 @@ public class RelatorioLinhasHorario extends Relatorio {
RelatorioLinhasHorarioBean horarioBean = new RelatorioLinhasHorarioBean(); RelatorioLinhasHorarioBean horarioBean = new RelatorioLinhasHorarioBean();
group = ((String) rset.getObject("GRUPO_RUTA")); group = ((String) rset.getObject("GRUPO_RUTA"));
horarioBean.setGrupoRuta(group); horarioBean.setGrupoRuta(group);
horarioBean.setTipoLinha((String) rset.getObject("TIPO_LINHA")); horarioBean.setTipoLinha((String) rset.getObject("TIPO_LINHA"));
horarioBean.setHora((String) rset.getObject("HORA")); horarioBean.setHora((String) rset.getObject("HORA"));
horarioBean.setServico((BigDecimal) rset.getObject("SERVICO")); horarioBean.setServico((BigDecimal) rset.getObject("SERVICO"));
if (rset.getObject("SENTIDO") != null) if (rset.getObject("SENTIDO") != null) {
horarioBean.convetSentido((BigDecimal) rset.getObject("SENTIDO")); horarioBean.convetSentido((BigDecimal) rset.getObject("SENTIDO"));
else } else {
horarioBean.convetSentido(null); horarioBean.convetSentido(null);
}
horarioBean.setLot((BigDecimal) rset.getObject("LOT")); horarioBean.setLot((BigDecimal) rset.getObject("LOT"));
horarioBean.setCla((String) rset.getObject("CLA")); horarioBean.setCla((String) rset.getObject("CLA"));
horarioBean.setExtensao((BigDecimal) rset.getObject("EXTENSAO")); horarioBean.setExtensao((BigDecimal) rset.getObject("EXTENSAO"));
@ -253,16 +252,17 @@ public class RelatorioLinhasHorario extends Relatorio {
} }
private RelatorioLinhasHorarioBean calcTotal(RelatorioLinhasHorarioBean horarioBean) { private RelatorioLinhasHorarioBean calcTotal(RelatorioLinhasHorarioBean horarioBean) {
BigDecimal total = horarioBean.getPassagens().add(horarioBean.getSeguro()); BigDecimal total = horarioBean.getPassagens();
total = total.add(horarioBean.getBagagens()); total = total.add(horarioBean.getBagagens());
total = total.add(horarioBean.getSeguro());
total = total.add(horarioBean.getPedagio());
total = total.add(horarioBean.getTxEmbarque());
horarioBean.setTotal(total); horarioBean.setTotal(total);
return horarioBean; return horarioBean;
} }
private RelatorioLinhasHorarioBean calcMediaReceitaTotal(RelatorioLinhasHorarioBean horarioBean) { private RelatorioLinhasHorarioBean calcMediaReceitaTotal(RelatorioLinhasHorarioBean horarioBean) {
BigDecimal mediaTotal = horarioBean.getPassagens().add(horarioBean.getSeguro()); BigDecimal mediaTotal = horarioBean.getPassagens();
mediaTotal = mediaTotal.add(horarioBean.getBagagens());
mediaTotal = mediaTotal.divide(new BigDecimal(3), 2, RoundingMode.HALF_EVEN);
horarioBean.setMediaReceitaViagem(mediaTotal); horarioBean.setMediaReceitaViagem(mediaTotal);
return horarioBean; return horarioBean;
} }
@ -282,7 +282,7 @@ public class RelatorioLinhasHorario extends Relatorio {
private RelatorioLinhasHorarioBean calcEquivalente(RelatorioLinhasHorarioBean horarioBean) { private RelatorioLinhasHorarioBean calcEquivalente(RelatorioLinhasHorarioBean horarioBean) {
BigDecimal equivalente = new BigDecimal(0); BigDecimal equivalente = new BigDecimal(0);
try { try {
equivalente = horarioBean.getSomaExtensaoTrecho().divide(horarioBean.getExtensao(), 2, RoundingMode.HALF_EVEN); equivalente = horarioBean.getSomaExtensaoTrecho().divide(horarioBean.getExtensao(), 5, RoundingMode.HALF_EVEN);
} catch (ArithmeticException e) { } catch (ArithmeticException e) {
equivalente = BigDecimal.ZERO; equivalente = BigDecimal.ZERO;
} catch (NullPointerException nex) { } catch (NullPointerException nex) {
@ -298,7 +298,7 @@ public class RelatorioLinhasHorario extends Relatorio {
private RelatorioLinhasHorarioBean calcMpa(RelatorioLinhasHorarioBean horarioBean) { private RelatorioLinhasHorarioBean calcMpa(RelatorioLinhasHorarioBean horarioBean) {
BigDecimal mpa = new BigDecimal(0); BigDecimal mpa = new BigDecimal(0);
try { try {
mpa = horarioBean.getAbsol().divide(horarioBean.getTotalViagem(), 2, RoundingMode.HALF_EVEN); mpa = horarioBean.getAbsol().divide(horarioBean.getTotalViagem(), 5, RoundingMode.HALF_EVEN);
} catch (ArithmeticException e) { } catch (ArithmeticException e) {
mpa = BigDecimal.ZERO; mpa = BigDecimal.ZERO;
} catch (NullPointerException nex) { } catch (NullPointerException nex) {
@ -311,13 +311,13 @@ public class RelatorioLinhasHorario extends Relatorio {
} }
private RelatorioLinhasHorarioBean calcMpe(RelatorioLinhasHorarioBean horarioBean) { private RelatorioLinhasHorarioBean calcMpe(RelatorioLinhasHorarioBean horarioBean) {
BigDecimal mpe = horarioBean.getEquivalente().divide(horarioBean.getTotalViagem(), 2, RoundingMode.HALF_EVEN); BigDecimal mpe = horarioBean.getEquivalente().divide(horarioBean.getTotalViagem(), 5, RoundingMode.HALF_EVEN);
horarioBean.setMpe(mpe); horarioBean.setMpe(mpe);
return horarioBean; return horarioBean;
} }
private RelatorioLinhasHorarioBean calcRsKm(RelatorioLinhasHorarioBean horarioBean) { private RelatorioLinhasHorarioBean calcRsKm(RelatorioLinhasHorarioBean horarioBean) {
BigDecimal rsKm = horarioBean.getTotal().divide(horarioBean.getKmRodado(), 2, RoundingMode.HALF_EVEN); BigDecimal rsKm = horarioBean.getPassagens().divide(horarioBean.getKmRodado(), 5, RoundingMode.HALF_EVEN);
horarioBean.setRsKm(rsKm); horarioBean.setRsKm(rsKm);
return horarioBean; return horarioBean;
} }
@ -325,7 +325,7 @@ public class RelatorioLinhasHorario extends Relatorio {
private RelatorioLinhasHorarioBean calcEq(RelatorioLinhasHorarioBean horarioBean) { private RelatorioLinhasHorarioBean calcEq(RelatorioLinhasHorarioBean horarioBean) {
BigDecimal eq = null; BigDecimal eq = null;
try { try {
eq = horarioBean.getMediaReceitaViagem().divide(horarioBean.getTarifa(), 2, RoundingMode.HALF_EVEN); eq = horarioBean.getMediaReceitaViagem().divide(horarioBean.getTarifa(), 5, RoundingMode.HALF_EVEN);
} catch (ArithmeticException e) { } catch (ArithmeticException e) {
eq = BigDecimal.ZERO; eq = BigDecimal.ZERO;
} catch (NullPointerException nex) { } catch (NullPointerException nex) {
@ -338,7 +338,7 @@ public class RelatorioLinhasHorario extends Relatorio {
} }
private RelatorioLinhasHorarioBean calcRsViagem(RelatorioLinhasHorarioBean horarioBean) { private RelatorioLinhasHorarioBean calcRsViagem(RelatorioLinhasHorarioBean horarioBean) {
BigDecimal RSViagem = horarioBean.getTotal().divide(horarioBean.getTotalViagem(), 2, RoundingMode.HALF_EVEN); BigDecimal RSViagem = horarioBean.getPassagens().divide(horarioBean.getTotalViagem(), 5, RoundingMode.HALF_EVEN);
horarioBean.setRsViagem(RSViagem); horarioBean.setRsViagem(RSViagem);
return horarioBean; return horarioBean;
} }
@ -354,7 +354,7 @@ public class RelatorioLinhasHorario extends Relatorio {
BigDecimal iap = null; BigDecimal iap = null;
BigDecimal CENTO = BigDecimal.TEN.multiply(BigDecimal.TEN); BigDecimal CENTO = BigDecimal.TEN.multiply(BigDecimal.TEN);
try { try {
iap = (horarioBean.getPaxKmTransportado().multiply(CENTO)).divide(horarioBean.getPaxKmOfertado(), 2, RoundingMode.HALF_EVEN); iap = (horarioBean.getPaxKmTransportado().multiply(CENTO)).divide(horarioBean.getPaxKmOfertado(), 5, RoundingMode.HALF_EVEN);
} catch (ArithmeticException e) { } catch (ArithmeticException e) {
iap = BigDecimal.ZERO; iap = BigDecimal.ZERO;
} catch (NullPointerException nex) { } catch (NullPointerException nex) {
@ -451,7 +451,7 @@ public class RelatorioLinhasHorario extends Relatorio {
sql.append(" CO.EMPRESACORRIDA_ID, "); sql.append(" CO.EMPRESACORRIDA_ID, ");
sql.append(" BO.NUMKMVIAJE * COUNT(1) AS KM_REAL, "); sql.append(" BO.NUMKMVIAJE * COUNT(1) AS KM_REAL, ");
sql.append(" ROUND((BO.NUMKMVIAJE * COUNT(1) / "); sql.append(" ROUND((BO.NUMKMVIAJE * COUNT(1) / ");
sql.append(" (SELECT SUM(TR.CANTKMREAL) FROM RUTA_SECUENCIA RS, TRAMO TR WHERE RS.RUTA_ID = CO.RUTA_ID AND RS.TRAMO_ID = TR.TRAMO_ID)), 2) EQUIVALENTE, "); sql.append(" (SELECT SUM(TR.CANTKMREAL) FROM RUTA_SECUENCIA RS, TRAMO TR WHERE RS.RUTA_ID = CO.RUTA_ID AND RS.TRAMO_ID = TR.TRAMO_ID)), 5) EQUIVALENTE, ");
sql.append(" SUM(NVL(BO.IMPORTESEGURO, 0)) AS IMPORTESEGURO, "); sql.append(" SUM(NVL(BO.IMPORTESEGURO, 0)) AS IMPORTESEGURO, ");
sql.append(" SUM(NVL(BO.IMPORTETAXAEMBARQUE, 0)) AS IMPORTETAXAEMBARQUE, "); sql.append(" SUM(NVL(BO.IMPORTETAXAEMBARQUE, 0)) AS IMPORTETAXAEMBARQUE, ");
sql.append(" SUM(NVL(BO.IMPORTEPEDAGIO, 0)) AS IMPORTEPEDAGIO, "); sql.append(" SUM(NVL(BO.IMPORTEPEDAGIO, 0)) AS IMPORTEPEDAGIO, ");