From ca39973bf46f9086d26423b33ceb3b269f1e1a7d Mon Sep 17 00:00:00 2001 From: julio Date: Tue, 27 Aug 2013 15:48:49 +0000 Subject: [PATCH] =?UTF-8?q?=20RAE=20-=20Se=20dentro=20do=20per=C3=ADodo=20?= =?UTF-8?q?informado=20n=C3=A3o=20houver=20nenhum=20dado,=20n=C3=A3o=20?= =?UTF-8?q?=C3=A9=20necess=C3=A1rio=20trazer=20a=20linha=20com=20o=20servi?= =?UTF-8?q?=C3=A7o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@30180 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../RelatorioAcompanhamentoEquivalentes.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) 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); + } } }