diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index ace621579..d181d77df 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,3 @@ -#Thu May 02 10:20:38 BRT 2013 eclipse.preferences.version=1 +encoding//src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoLinhas.jrxml=UTF-8 encoding//web/WEB-INF/i3-label_pt_BR.label=UTF-8 diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java index 9d4ce85d4..cef593499 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java @@ -142,10 +142,11 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { if ((Boolean) configComissao.get("PEDAGIORECEITA")) baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("IMPORTEPEDAGIO")); + System.out.println("configComissao "+configComissao); // Caso esteje setado na configuração de comissão que o calculo deve ser sobre o liquido, deduz o imposto. - if (((String) configComissao.get("RECEITA")).equals("RL") && + if (configComissao.get("RECEITA") != null && ((String) configComissao.get("RECEITA")).equals("RL") && (!tipoVentaId.equals(18) || (tipoVentaId.equals(18) && (Boolean) this.relatorio.getParametros().get("B_CONTEMPLAR_GAP")))) - baseCalculo = baseCalculo.subtract((BigDecimal) rowOrigem.get("IMPOSTO")); + baseCalculo = baseCalculo.subtract((BigDecimal) rowOrigem.get("IMPOSTOS")); } else { @@ -172,6 +173,8 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { percComissao = isAltaTemporada ? (BigDecimal) configComissao.get("PASSAGEMALTA") : (BigDecimal) configComissao.get("PASSAGEMBAIXA"); + if(percComissao==null) + return; // VALOR COMISSAO = BASE DE CALCULO * (PERCENTUAL COMISSAO / 100) valorComissao = baseCalculo.multiply(percComissao.divide(BigDecimal.valueOf(100))); @@ -199,7 +202,7 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { rowDestino.put("EMPRESAPUNTOVENTA_ID", rowOrigem.get("EMPRESAPUNTOVENTA_ID")); rowDestino.put("ESTADO_ID", configComissao.get("ESTADO_ID")); rowDestino.put("TIPO_AGENCIA", configComissao.get("TIPO_AGENCIA")); - + mapDados.put(puntoVentaId, (HashMap) rowDestino); } } @@ -273,7 +276,7 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { while (this.resultSet.next()) { Integer puntoVentaId = this.resultSet.getInt("PUNTOVENTA_ID"); - BigDecimal motivoCancelacionId = this.resultSet.getBigDecimal("MOTIVOCANCELACION_ID"); + Integer motivoCancelacionId = this.resultSet.getInt("MOTIVOCANCELACION_ID"); Integer tipoVentaId = this.resultSet.getInt("TIPOVENTA_ID"); // Inicializa a row atual @@ -284,7 +287,7 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { row.put("TOTAL_BILHETES_GAP", ((BigDecimal) row.get("TOTAL_BILHETES_GAP")).add(motivoCancelacionId == null && tipoVentaId.equals(18) ? BigDecimal.ONE : BigDecimal.ZERO)); row.put("TOTAL_BILHETES_CANC", ((BigDecimal) row.get("TOTAL_BILHETES_CANC")).add(motivoCancelacionId != null ? BigDecimal.ONE : BigDecimal.ZERO)); - if (motivoCancelacionId == null) { + if (motivoCancelacionId == 0) { row.put("RECEITA_TARIFA", ((BigDecimal) row.get("RECEITA_TARIFA")).add(!tipoVentaId.equals(18) && !tipoVentaId.equals(39) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); row.put("RECEITA_TARIFA_GAP", ((BigDecimal) row.get("RECEITA_TARIFA_GAP")).add((tipoVentaId.equals(18) || tipoVentaId.equals(39)) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); @@ -306,9 +309,10 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { } else { // Verificia se a devolução é pra ser contabilizada na agência de destino ou de origem da venda - if (((Integer) this.relatorio.getParametros().get("ISDEVOLUCAODESTINO")).equals(1) || (((Integer) this.relatorio.getParametros().get("ISDEVOLUCAODESTINO")).equals(0) && this.resultSet.getInt("POSSUI_CANC") == 1)) { + if (((Integer) this.relatorio.getParametros().get("ISDEVOLUCAODESTINO") == 1 )|| (((Integer) this.relatorio.getParametros().get("ISDEVOLUCAODESTINO")).equals(0) && this.resultSet.getInt("POSSUI_CANC") == 1)) { row.put("TOTAL_DEVOL", ((BigDecimal) row.get("TOTAL_DEVOL")).add((motivoCancelacionId.equals(31) || motivoCancelacionId.equals(32)) && !tipoVentaId.equals(18) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); row.put("TOTAL_DEVOL_GAP", ((BigDecimal) row.get("TOTAL_DEVOL_GAP")).add((motivoCancelacionId.equals(31) || motivoCancelacionId.equals(32)) && tipoVentaId.equals(18) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); + } } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper index 0a7e4d34a..719e7ade7 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml index ab459343d..3a9ebc68b 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml @@ -1,7 +1,7 @@ - +