diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAcompanhamentoEquivalentes.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAcompanhamentoEquivalentes.java index a4476ac9e..e438a0e6a 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAcompanhamentoEquivalentes.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAcompanhamentoEquivalentes.java @@ -93,14 +93,6 @@ public class RelatorioAcompanhamentoEquivalentes extends Relatorio { BigDecimal totalMes = BigDecimal.ZERO; 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(); cal.setTime(dataInicial); cal.set(Calendar.DATE, 1); @@ -115,18 +107,28 @@ public class RelatorioAcompanhamentoEquivalentes extends Relatorio { 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)) 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)); - this.dados.add(row); - + this.dados.add(row); + } } }