From 8ab4ca15069a8a9f9533ef72b0ad282138aae3e4 Mon Sep 17 00:00:00 2001 From: "fabricio.oliveira" Date: Mon, 11 Feb 2019 17:17:59 +0000 Subject: [PATCH] =?UTF-8?q?0013168:=20Motta=20-=20Inconsist=C3=AAncia=20de?= =?UTF-8?q?=20valores.=20fixes=20bug#13168=20dev:Wallace=20qua:Renato?= 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@89731 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../impl/RelatorioReceitaDiariaAgencia.java | 13 +++++++++---- .../RelatorioReceitaDiariaAgenciaController.java | 11 +++++++++++ web/WEB-INF/i3-label_pt_BR.label | 2 ++ .../filtroRelatorioReceitaDiariaAgencia.zul | 8 +++++++- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java index b3755667f..90282424f 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java @@ -297,6 +297,7 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { this.prepareQuery(); this.mapDados = new HashMap>(); + this.resultSet.setFetchSize(1000); while (this.resultSet.next()) { Integer puntoVentaId = this.resultSet.getInt("PUNTOVENTA_ID"); @@ -310,8 +311,12 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { this.mapDados.put(row.get("PUNTOVENTA_ID") + "-" + empresaId.toString(), (HashMap) row); - // 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)); + 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)); + } else { + row.put("TOTAL_BILHETES", ((BigDecimal) row.get("TOTAL_BILHETES")).add(motivoCancelacionId == 0 && !tipoVentaId.equals(18) ? 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_CANC", ((BigDecimal) row.get("TOTAL_BILHETES_CANC")).add(motivoCancelacionId == 31 ? BigDecimal.ONE : BigDecimal.ZERO)); @@ -345,9 +350,9 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { row.put("IMPOSTOS", ((BigDecimal) row.get("IMPOSTOS")).subtract(getValorImposto(idEstado, empresaId, this.resultSet.getString("INTERESTADUAL"), this.resultSet.getBigDecimal("PRECIOPAGADO"), this.resultSet.getBigDecimal("IMPORTESEGURO"), this.resultSet.getBigDecimal("IMPORTETAXAEMBARQUE"), this.resultSet.getBigDecimal("IMPORTEPEDAGIO"), BigDecimal.ZERO))); } - + // Deduz os cancelamentos e trocas e transferencias - if (motivoCancelacionId == 31 || motivoCancelacionId == 10 || motivoCancelacionId == 23) { + if (motivoCancelacionId == 31 || motivoCancelacionId == 10 || (motivoCancelacionId == 23 && (Boolean) getParametros().get("TRANSFERENCIA_PASSAGENS"))) { row.put("RECEITA_TARIFA", ((BigDecimal) row.get("RECEITA_TARIFA")).subtract(!tipoVentaId.equals(18) && !tipoVentaId.equals(39) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); row.put("RECEITA_TARIFA_GAP", ((BigDecimal) row.get("RECEITA_TARIFA_GAP")).subtract((tipoVentaId.equals(18) || tipoVentaId.equals(39)) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java index 0ca1ccaec..76163e046 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java @@ -76,6 +76,7 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom private List lsNumPuntoVenta; private Checkbox somenteCancelados; + private Checkbox consideraTransferenciaPassagem; @Autowired private transient PagedListWrapper plwPuntoVenta; @@ -109,6 +110,15 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom public void setSomenteCancelados(Checkbox somenteCancelados) { this.somenteCancelados = somenteCancelados; } + + + public Checkbox getConsideraTransferenciaPassagem() { + return consideraTransferenciaPassagem; + } + + public void setConsideraTransferenciaPassagem(Checkbox consideraTransferenciaPassagem) { + this.consideraTransferenciaPassagem = consideraTransferenciaPassagem; + } public Datebox getDatInicial() { return datInicial; @@ -312,6 +322,7 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom parametros.put("ISDEVOLUCAODESTINO", rd1.isChecked() ? 0 : 1); parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString()); parametros.put("SOMENTE_CANCELADOS", somenteCancelados.isChecked()); + parametros.put("TRANSFERENCIA_PASSAGENS", consideraTransferenciaPassagem.isChecked()); parametros.put("BASE_CALCULO_IMPOSTO", Integer.valueOf(cmbReceitaImposto.getSelectedItem().getValue().toString())); diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index e6f5497bd..1b85bd30e 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -429,6 +429,8 @@ financeiroGrupoLinhasController.lbDataFin.value = Data Fim financeiroGrupoLinhasController.lbEmpresa.value = Empresa financeiroGrupoLinhasController.label.somenteCancelados = Somente Cancelados financeiroGrupoLinhasController.label.grupo.linhas = Grupo de Linhas +financeiroGrupoLinhasController.label.consideraTransferenciaPassagem = Retirar bilhetes transferência de passagens + # Muestra a Pesquisa Tipo Classe busquedaClaseServicioController.window.title = Tipo de Classe diff --git a/web/gui/relatorios/filtroRelatorioReceitaDiariaAgencia.zul b/web/gui/relatorios/filtroRelatorioReceitaDiariaAgencia.zul index 623000175..d7c6be2a3 100644 --- a/web/gui/relatorios/filtroRelatorioReceitaDiariaAgencia.zul +++ b/web/gui/relatorios/filtroRelatorioReceitaDiariaAgencia.zul @@ -7,7 +7,7 @@ @@ -164,8 +164,14 @@ + + +