RAE - Se dentro do período informado não houver nenhum dado, não é necessário

trazer a linha com o serviço

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@30180 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2013-08-27 15:48:49 +00:00
parent e37a72e7a7
commit ca39973bf4
1 changed files with 15 additions and 13 deletions

View File

@ -93,14 +93,6 @@ public class RelatorioAcompanhamentoEquivalentes extends Relatorio {
BigDecimal totalMes = BigDecimal.ZERO; BigDecimal totalMes = BigDecimal.ZERO;
Integer totalDias = 0; Integer totalDias = 0;
row.put("LINHA", this.resultSet.getString("SIGLA"));
row.put("LOTACAO", this.resultSet.getInt("ASSENTOS"));
row.put("SERVICO", this.resultSet.getString("TIPO_SERVICO"));
row.put("CODIGO", this.resultSet.getInt("CORRIDA_ID"));
row.put("HORARIO", this.resultSet.getString("HORARIO"));
row.put("INTERESTADUAL", this.resultSet.getString("INTERESTADUAL"));
row.put("GRUPO_LINHA", this.resultSet.getString("GRUPO_LINHA"));
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(dataInicial); cal.setTime(dataInicial);
cal.set(Calendar.DATE, 1); cal.set(Calendar.DATE, 1);
@ -115,18 +107,28 @@ public class RelatorioAcompanhamentoEquivalentes extends Relatorio {
totalDias++; totalDias++;
} }
row.put(String.valueOf(cal.get(Calendar.DATE)), valor); BigDecimal ZERO = new BigDecimal(0);
if (valor != null && !valor.equals(ZERO)) {
row.put("LINHA", this.resultSet.getString("SIGLA"));
row.put("LOTACAO", this.resultSet.getInt("ASSENTOS"));
row.put("SERVICO", this.resultSet.getString("TIPO_SERVICO"));
row.put("CODIGO", this.resultSet.getInt("CORRIDA_ID"));
row.put("HORARIO", this.resultSet.getString("HORARIO"));
row.put("INTERESTADUAL", this.resultSet.getString("INTERESTADUAL"));
row.put("GRUPO_LINHA", this.resultSet.getString("GRUPO_LINHA"));
row.put(String.valueOf(cal.get(Calendar.DATE)), valor);
}
if (cal.get(Calendar.DATE) < cal.getActualMaximum(Calendar.DATE)) if (cal.get(Calendar.DATE) < cal.getActualMaximum(Calendar.DATE))
cal.add(Calendar.DATE, 1); cal.add(Calendar.DATE, 1);
} }
if (totalMes != null && !totalMes.equals(BigDecimal.ZERO) && totalDias > 0) if (totalMes != null && !totalMes.equals(BigDecimal.ZERO) && totalDias > 0) {
row.put("MEDIA", totalMes.divide(BigDecimal.valueOf(totalDias), 2, RoundingMode.HALF_UP)); row.put("MEDIA", totalMes.divide(BigDecimal.valueOf(totalDias), 2, RoundingMode.HALF_UP));
this.dados.add(row); this.dados.add(row);
}
} }
} }