diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java index f8e9a4693..fafdd094a 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java @@ -20,6 +20,7 @@ import java.util.Set; import com.rjconsultores.ventaboletos.entidad.Estado; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.enums.EnumTipoVenda; import com.rjconsultores.ventaboletos.relatorios.negocio.CalculoImposto; import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource; import com.rjconsultores.ventaboletos.relatorios.utilitarios.ExceptionConfiguracao; @@ -37,7 +38,12 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { //Mantis 16390 //As vendas com impressão posterior não estavam sendo exibidas como prévenda pois só estavam sendo validados os tipoVendaId 18 e 39. //Verifiquei a classe RelatorioImpressaoPosterior e adicionei os tipoVendaId faltantes de acordo com sua regra de negócio. - private List listaTipoVentaIdPreVenda = Arrays.asList(5, 12, 18, 41, 49, 39); + private List listaTipoVentaIdPreVenda = Arrays.asList(EnumTipoVenda.TPV_CENTRAL_TELEFONICA.getId(), + EnumTipoVenda.TPV_POR_INTERNET.getId(), + EnumTipoVenda.TPV_BOLETO_REMOTO.getId(), + EnumTipoVenda.TPV_CHECKIN_VIAGEM.getId(), + EnumTipoVenda.TPV_BOLETO_ABERTO_PREPAGADO.getId(), + EnumTipoVenda.TPV_VENDA_BOLETO_ABERTO_MANUAL.getId()); private Set pontoVendaConfiguracao; @@ -367,17 +373,19 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { LinkedHashMap row = this.getRow(puntoVentaId, empresaId, this.resultSet); this.mapDados.put(row.get("PUNTOVENTA_ID") + "-" + empresaId.toString(), (LinkedHashMap) row); + + boolean preVenda = isTipoVentaIdPreVenda(tipoVentaId); if ((Boolean) getParametros().get("TRANSFERENCIA_PASSAGENS")) { // Utiliza o -1 para retirar as transferências - row.put("TOTAL_BILHETES", ((BigDecimal) row.get("TOTAL_BILHETES")).add(motivoCancelacionId == 23 ? new BigDecimal(-1) : motivoCancelacionId == 0 && !tipoVentaId.equals(18) ? BigDecimal.ONE : BigDecimal.ZERO)); + row.put("TOTAL_BILHETES", ((BigDecimal) row.get("TOTAL_BILHETES")).add(motivoCancelacionId == 23 ? new BigDecimal(-1) : motivoCancelacionId == 0 && !preVenda ? BigDecimal.ONE : BigDecimal.ZERO)); } else { - row.put("TOTAL_BILHETES", ((BigDecimal) row.get("TOTAL_BILHETES")).add(motivoCancelacionId == 0 && !tipoVentaId.equals(18) ? BigDecimal.ONE : BigDecimal.ZERO)); + row.put("TOTAL_BILHETES", ((BigDecimal) row.get("TOTAL_BILHETES")).add(motivoCancelacionId == 0 && !preVenda ? BigDecimal.ONE : BigDecimal.ZERO)); } - row.put("TOTAL_BILHETES_GAP", ((BigDecimal) row.get("TOTAL_BILHETES_GAP")).add(motivoCancelacionId == 0 && tipoVentaId.equals(18) && this.resultSet.getInt("INDREIMPRESION") == 0 ? BigDecimal.ONE : BigDecimal.ZERO)); + row.put("TOTAL_BILHETES_GAP", ((BigDecimal) row.get("TOTAL_BILHETES_GAP")).add(motivoCancelacionId == 0 && preVenda && this.resultSet.getInt("INDREIMPRESION") == 0 ? BigDecimal.ONE : BigDecimal.ZERO)); row.put("TOTAL_BILHETES_CANC", ((BigDecimal) row.get("TOTAL_BILHETES_CANC")).add(motivoCancelacionId == 31 ? BigDecimal.ONE : BigDecimal.ZERO)); - boolean preVenda = isTipoVentaIdPreVenda(tipoVentaId); + // Aumenta receita // Não se trate de cancelamento e não seja uma impressão de pré venda diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper index 47af06e14..2aaaa6962 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 c95788e2d..30d48632d 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml @@ -1,8 +1,8 @@ - - + +