From cc70e02b2af1e6a58b73515576e8c946a181b9df Mon Sep 17 00:00:00 2001 From: walace Date: Fri, 8 Sep 2017 20:56:07 +0000 Subject: [PATCH] fixes bug #9066 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@73634 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../comissao/ConferenciaController.java | 313 +++++++++--------- web/gui/comissao/conferencia.zul | 34 +- 2 files changed, 173 insertions(+), 174 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/ConferenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/ConferenciaController.java index ea9819b64..73e1a9d11 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/ConferenciaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/ConferenciaController.java @@ -182,7 +182,7 @@ public class ConferenciaController extends MyGenericForwardComposer { private Combobox cmbTipoInformativo; private Combobox cmbConferenciaDia; - + private List lsTipoInformativo; private MyComboboxEstandar cmbConferenciaPendencia; @@ -197,31 +197,31 @@ public class ConferenciaController extends MyGenericForwardComposer { private Tab tabGapDevolvido; private Tab tabEventosFinanceiros; private Tab tabOcd; - + private Date dataInicial; private Date dataFinal; private List conferencias; Boolean isPeriodo; private Row rowDataMovimento; - + @Override public void doAfterCompose(Component comp) throws Exception { - - isPeriodo = (Boolean) Executions.getCurrent().getArg().get("isPeriodo"); - - if(isPeriodo){ + + isPeriodo = (Boolean) Executions.getCurrent().getArg().get("isPeriodo"); + + if (isPeriodo) { dataInicial = (Date) Executions.getCurrent().getArg().get("dataInicial"); dataFinal = (Date) Executions.getCurrent().getArg().get("dataFinal"); - + SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy"); - datamovimento = formato.format(dataInicial) + " - " + formato.format(dataFinal); - }else{ + datamovimento = formato.format(dataInicial) + " - " + formato.format(dataFinal); + } else { datamovimento = (String) Executions.getCurrent().getArg().get("datamovimento"); } - + conferenciaComissao = (ConferenciaComissaoVO) Executions.getCurrent().getArg().get("conferenciaComissao"); lsTipoInformativo = tipoInformativoComissaoService.obtenerTodos(); - conferenciaList = (MyListbox) Executions.getCurrent().getArg().get("conferenciaList"); + conferenciaList = (MyListbox) Executions.getCurrent().getArg().get("conferenciaList"); empresa = (Empresa) Executions.getCurrent().getArg().get("empresa"); puntoventaId = (Integer) Executions.getCurrent().getArg().get("puntoventaId"); puntoventaFiltro = Executions.getCurrent().getArg().get("puntovendaFiltro") != null && !Executions.getCurrent().getArg().get("puntovendaFiltro").toString().equals("null") ? (PuntoVenta) Executions.getCurrent().getArg().get("puntovendaFiltro") : null; @@ -232,19 +232,19 @@ public class ConferenciaController extends MyGenericForwardComposer { lsConferenciaPendencia = new ArrayList(); lsConferenciaPendencia.add(new ConferenciaPendencia(-1, " ")); lsConferenciaPendencia.addAll(conferenciaPendenciaService.obtenerTodos()); - - if(isPeriodo){ + + if (isPeriodo) { dataInicial = (Date) Executions.getCurrent().getArg().get("dataInicial"); dataFinal = (Date) Executions.getCurrent().getArg().get("dataFinal"); recuperarConferencias(conferenciaComissao); - }else{ + } else { Long conferenciaId = (Long) Executions.getCurrent().getArg().get("conferenciaId"); recuperarConferencia(conferenciaId); } super.doAfterCompose(comp); rowDataMovimento.setVisible(isPeriodo); - + logsConferenciaList.setItemRenderer(new RenderLogConferencia()); ocdsList.setItemRenderer(new RenderOcd() { @@ -357,10 +357,29 @@ public class ConferenciaController extends MyGenericForwardComposer { carregarDados(); ecfListBox.setItemRenderer(new RenderEcfPontoVenda()); + + ecfListBox.addEventListener("onDoubleClick", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + + List listNumSerie = ecfListBox.getSelectedModelItems(); + + if (listNumSerie.isEmpty()) { + Messagebox.show(Labels.getLabel("conferenciaController.MSG.nenhumaNumeroSerieEcfSelecionado"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + Map args = new HashMap(); + args.put("puntoVentaId", puntoventaId); + args.put("listNumSerie", listNumSerie); + openWindow("/gui/comissao/informeIrregularidadeComissao.zul", + Labels.getLabel("informeIrregularidadeController.window.title"), args); + } + }); } - - private void ajustarListsBilhetes() { bilhetesManualList.setItemRenderer(new RenderBoletoComissao() { @Override @@ -646,7 +665,7 @@ public class ConferenciaController extends MyGenericForwardComposer { } else { boletosComissaos = conferenciaComissaoService.carregarBilhetesComissao(null, getConferencia(), null, false); } - + carregarBilhetesManual(boletosComissaos); carregarBilhetesVendidos(boletosComissaos, false); carregarBilhetesCancelados(boletosComissaos, false); @@ -723,20 +742,20 @@ public class ConferenciaController extends MyGenericForwardComposer { private void carregarResumo(List boletosComissaos) throws BusinessException { if (isPeriodo) { - //método apenas usa empresa e punto venda da conferencia, então pode ser passado o primeiro da lista + // método apenas usa empresa e punto venda da conferencia, então pode ser passado o primeiro da lista resumo = conferenciaComissaoService.gerarResumo(conferencias.isEmpty() ? null : conferencias.get(0), boletosComissaos, lsEventosFinanceiros, totalBilhetesManual, totalBilhetesVendidos, totalBilhetesCancelados, totalBilhetesDevolvidos, totalBilhetesGap, totalBilhetesGapCancelados, totalBilhetesGapDevolvidos, totalCreditosEventoFinanceiros, totalDebitosEventoFinanceiros, ocdTotal, totalBilhetesDevolvidosTroca, totalBilhetesGapDevolvidosTroca); } else { resumo = conferenciaComissaoService.gerarResumo(conferencia, boletosComissaos, lsEventosFinanceiros, totalBilhetesManual, totalBilhetesVendidos, totalBilhetesCancelados, totalBilhetesDevolvidos, totalBilhetesGap, totalBilhetesGapCancelados, totalBilhetesGapDevolvidos, totalCreditosEventoFinanceiros, totalDebitosEventoFinanceiros, ocdTotal, totalBilhetesDevolvidosTroca, totalBilhetesGapDevolvidosTroca); } - + formapagosList.setData(resumo.getTotalFormapago()); ecfListBox.setData(resumo.getListNumSerieECF()); } private void carregarBilhetesManual(List boletosComissaos) throws BusinessException { - if(isPeriodo){ + if (isPeriodo) { lsBilhetesManual = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.BOLETO_MANUAL, false); - }else{ + } else { lsBilhetesManual = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_MANUAL, false); } totalBilhetesManual = conferenciaComissaoService.totalizarBoletoComissao(lsBilhetesManual); @@ -748,10 +767,10 @@ public class ConferenciaController extends MyGenericForwardComposer { } private void carregarBilhetesVendidos(List boletosComissaos, boolean carregarDadosFaltantes) throws BusinessException { - if(isPeriodo){ - lsBilhetes = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.BOLETOS_VENDIDOS, carregarDadosFaltantes); - }else{ - lsBilhetes = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETOS_VENDIDOS, carregarDadosFaltantes); + if (isPeriodo) { + lsBilhetes = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.BOLETOS_VENDIDOS, carregarDadosFaltantes); + } else { + lsBilhetes = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETOS_VENDIDOS, carregarDadosFaltantes); } totalBilhetesVendidos = conferenciaComissaoService.totalizarBoletoComissao(lsBilhetes); txtTotalBilhetes.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesVendidos, LocaleUtil.getLocale())); @@ -762,9 +781,9 @@ public class ConferenciaController extends MyGenericForwardComposer { } private void carregarBilhetesCancelados(List boletosComissaos, boolean carregarDadosFaltantes) throws BusinessException { - if(isPeriodo){ + if (isPeriodo) { lsBilhetesCancelados = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.BOLETO_CANCELADO, carregarDadosFaltantes); - }else{ + } else { lsBilhetesCancelados = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_CANCELADO, carregarDadosFaltantes); } totalBilhetesCancelados = conferenciaComissaoService.totalizarBoletoComissao(lsBilhetesCancelados); @@ -777,13 +796,13 @@ public class ConferenciaController extends MyGenericForwardComposer { private void carregarBilhetesDevolvidos(List boletosComissaos, boolean carregarDadosFaltantes) throws BusinessException { totalBilhetesDevolvidos = BigDecimal.ZERO; - - if(isPeriodo){ - lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.BOLETO_DEVOLVIDO, carregarDadosFaltantes); - }else{ - lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO, carregarDadosFaltantes); + + if (isPeriodo) { + lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.BOLETO_DEVOLVIDO, carregarDadosFaltantes); + } else { + lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO, carregarDadosFaltantes); } - + Map totais = conferenciaComissaoService.totalizarBoletoComissaoDevolvidosTrocaOcd(lsBilhetesDevolvidos); totalBilhetesDevolvidos = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO); @@ -801,12 +820,12 @@ public class ConferenciaController extends MyGenericForwardComposer { } private void carregarBilhetesGap(List boletosComissaos) throws BusinessException { - if(isPeriodo){ + if (isPeriodo) { lsBilhetesGap = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.GAP_VENDIDOS, false); - }else{ + } else { lsBilhetesGap = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_VENDIDOS, false); } - + totalBilhetesGap = conferenciaComissaoService.totalizarBoletoComissao(lsBilhetesGap); txtTotalBilhetesGap.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesGap, LocaleUtil.getLocale())); txtQtdeTotalBilhetesGap.setValue(String.valueOf(lsBilhetesGap.size())); @@ -815,10 +834,10 @@ public class ConferenciaController extends MyGenericForwardComposer { verificarBilhetesSemConferencia(lsBilhetesGap, tabGapVenda); } - private void carregarBilhetesGapCancelados(List boletosComissaos) throws BusinessException { - if(isPeriodo){ + private void carregarBilhetesGapCancelados(List boletosComissaos) throws BusinessException { + if (isPeriodo) { lsBilhetesGapCancelados = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.GAP_CANCELADO, false); - }else{ + } else { lsBilhetesGapCancelados = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_CANCELADO, false); } totalBilhetesGapCancelados = conferenciaComissaoService.totalizarBoletoComissao(lsBilhetesGapCancelados); @@ -830,9 +849,9 @@ public class ConferenciaController extends MyGenericForwardComposer { } private void carregarBilhetesGapDevolvidos(List boletosComissaos) throws BusinessException { - if(isPeriodo){ + if (isPeriodo) { lsBilhetesGapDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencias, BoletoStatusComissao.GAP_DEVOLVIDO, false); - }else { + } else { lsBilhetesGapDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_DEVOLVIDO, false); } @@ -855,7 +874,7 @@ public class ConferenciaController extends MyGenericForwardComposer { private void carregarLogsConferencia() throws BusinessException { if (isPeriodo) { List temp = new ArrayList(); - lsLogsConferencia = new ArrayList(); + lsLogsConferencia = new ArrayList(); for (Conferencia c : conferencias) { temp = conferenciaComissaoService.carregarLogConferencia(c); @@ -871,20 +890,20 @@ public class ConferenciaController extends MyGenericForwardComposer { private void carregarEventosFinanceiros(List boletosComissaos) throws BusinessException { - if(isPeriodo){ + if (isPeriodo) { List temp = new ArrayList(); - if(lsEventosFinanceiros == null){ + if (lsEventosFinanceiros == null) { lsEventosFinanceiros = new ArrayList(); } - - for(Conferencia c : conferencias){ + + for (Conferencia c : conferencias) { temp = conferenciaComissaoService.carregarEventosFinanceiros(c); lsEventosFinanceiros.addAll(temp); } - }else{ + } else { lsEventosFinanceiros = conferenciaComissaoService.carregarEventosFinanceiros(conferencia); } - + eventosFinanceirosList.setData(lsEventosFinanceiros); totalCreditosEventoFinanceiros = BigDecimal.ZERO; @@ -906,13 +925,13 @@ public class ConferenciaController extends MyGenericForwardComposer { } private void carregarOcds() throws BusinessException { - + if (isPeriodo) { List temp = new ArrayList(); - if(lsOcds == null){ - lsOcds = new ArrayList(); + if (lsOcds == null) { + lsOcds = new ArrayList(); } - + for (Conferencia c : conferencias) { temp = conferenciaComissaoService.carregarOcds(c); lsOcds.addAll(temp); @@ -934,13 +953,13 @@ public class ConferenciaController extends MyGenericForwardComposer { public void onClick$btnChegadaMalote(Event event) throws InterruptedException { try { - if(isPeriodo){ - for(Conferencia c : conferencias){ + if (isPeriodo) { + for (Conferencia c : conferencias) { if (!isMaloteRecebido(c) && isMovimentoNaoEncerrado(c)) { conferenciaComissaoService.confirmarChegadaMalote(c); } } - }else{ + } else { conferencia = conferenciaComissaoService.confirmarChegadaMalote(conferencia); } Messagebox.show(Labels.getLabel("conferenciaController.msg.confirmarChegadaMalote"), @@ -956,19 +975,17 @@ public class ConferenciaController extends MyGenericForwardComposer { Messagebox.OK, Messagebox.ERROR); } } - - public void onClick$btnCancelarChegada(Event event) throws InterruptedException{ - conferencia=conferenciaComissaoService.cancelarChegadaMalote(conferencia); - + + public void onClick$btnCancelarChegada(Event event) throws InterruptedException { + conferencia = conferenciaComissaoService.cancelarChegadaMalote(conferencia); + log.debug("Chegada de malote canelada com sucesso"); Messagebox.show(Labels.getLabel("conferenciaController.msg.cancelarChegadaMalote"), Labels.getLabel("conferenciaController.window.title"), Messagebox.OK, Messagebox.INFORMATION); closeWindow(); - + } - - public void onClick$btnEncerrarMovimentoDiario(Event event) throws InterruptedException { try { @@ -999,24 +1016,6 @@ public class ConferenciaController extends MyGenericForwardComposer { Messagebox.OK, Messagebox.ERROR); } } - @SuppressWarnings("rawtypes") - public void onClick$btnInformarIrregularidade() throws InterruptedException { - List listNumSerie = ecfListBox.getSelectedModelItems(); - - if (listNumSerie.isEmpty()) { - Messagebox.show(Labels.getLabel("conferenciaController.MSG.nenhumaNumeroSerieEcfSelecionado"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - return; - } - - Map args = new HashMap(); - args.put("puntoVentaId", puntoventaId); - args.put("listNumSerie", listNumSerie); - openWindow("/gui/comissao/informeIrregularidadeComissao.zul", - Labels.getLabel("informeIrregularidadeController.window.title"), args); - - } private boolean isConferenciaPendente() throws InterruptedException, BusinessException { List lsBoletoComissao = new ArrayList(); @@ -1097,39 +1096,39 @@ public class ConferenciaController extends MyGenericForwardComposer { conferencia.setDatamovimento(DateUtil.getDateFromString(datamovimento, "dd/MM/yyyy")); } } - + private void recuperarConferencias(ConferenciaComissaoVO conferenciaComissao) throws ParseException, BusinessException { conferencias = new ArrayList(); - - if(conferenciaComissao.getDiasOrdenado() != null){ - for (DiaConferenciaComissaoVO d : conferenciaComissao.getDiasOrdenado()) { - Conferencia conf = null; - if (d.getConferenciaId() != null) { - conf = conferenciaComissaoService.obtenerID(d.getConferenciaId()); + if (conferenciaComissao.getDiasOrdenado() != null) { + for (DiaConferenciaComissaoVO d : conferenciaComissao.getDiasOrdenado()) { + Conferencia conf = null; + + if (d.getConferenciaId() != null) { + conf = conferenciaComissaoService.obtenerID(d.getConferenciaId()); + } + + if (conf == null) { + Calendar cal = Calendar.getInstance(); + cal.setTime(dataInicial); + cal.set(Calendar.DAY_OF_MONTH, d.getDia()); + + conf = new Conferencia(); + conf.setActivo(Boolean.TRUE); + conf.setFecmodif(new Date()); + conf.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + conf.setEmpresa(empresa); + conf.setPuntoVenta(new PuntoVenta(puntoventaId)); + conf.setDatamovimento(cal.getTime()); + } + conferencias.add(conf); } - - if (conf == null) { - Calendar cal = Calendar.getInstance(); - cal.setTime(dataInicial); - cal.set(Calendar.DAY_OF_MONTH, d.getDia()); - - conf = new Conferencia(); - conf.setActivo(Boolean.TRUE); - conf.setFecmodif(new Date()); - conf.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); - conf.setEmpresa(empresa); - conf.setPuntoVenta(new PuntoVenta(puntoventaId)); - conf.setDatamovimento(cal.getTime()); - } - conferencias.add(conf); - } } } - - private Short getDebitoCreditoInfo(){ - if(rCredito.isSelected()){ + + private Short getDebitoCreditoInfo() { + if (rCredito.isSelected()) { return (short) 1; } else if (rDebito.isSelected()) { return (short) 0; @@ -1145,9 +1144,9 @@ public class ConferenciaController extends MyGenericForwardComposer { LogConferencia logConferencia = new LogConferencia(); logConferencia.setPreco(txtPrecoLog.getValueDecimal()); logConferencia.setObservacao(txtObservacaoLog.getValue()); - if(isPeriodo){ + if (isPeriodo) { logConferencia.setConferencia((Conferencia) cmbConferenciaDia.getSelectedItem().getValue()); - }else{ + } else { logConferencia.setConferencia(conferencia); } logConferencia.setStatus(StatusLogConferencia.getStatusLogConferencia((Integer) cmbSituacaoLog.getSelectedItem().getValue())); @@ -1186,25 +1185,25 @@ public class ConferenciaController extends MyGenericForwardComposer { } private boolean validarCamposObservacao() throws InterruptedException { - try{ - txtObservacaoLog.getValue(); - }catch(Exception e){ - Messagebox.show(Labels.getLabel("conferenciaController.MSG.observacaoObrigatorio"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); - return false; - } - try{ - if(rInformativo.isSelected() && cmbTipoInformativo.getValue() == null){ - return false; - } - - //validação do campo com o getValue, se tentar recuperar o valor em string é lançada exceção + try { txtObservacaoLog.getValue(); } catch (Exception e) { Messagebox.show(Labels.getLabel("conferenciaController.MSG.observacaoObrigatorio"), Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.INFORMATION); + Messagebox.OK, Messagebox.ERROR); + return false; + } + try { + if (rInformativo.isSelected() && cmbTipoInformativo.getValue() == null) { + return false; + } + + // validação do campo com o getValue, se tentar recuperar o valor em string é lançada exceção + txtObservacaoLog.getValue(); + } catch (Exception e) { + Messagebox.show(Labels.getLabel("conferenciaController.MSG.observacaoObrigatorio"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); return false; } @@ -1218,12 +1217,12 @@ public class ConferenciaController extends MyGenericForwardComposer { Messagebox.OK, Messagebox.ERROR); return false; } - - if(isPeriodo - && cmbConferenciaDia.getSelectedItem() == null){ + + if (isPeriodo + && cmbConferenciaDia.getSelectedItem() == null) { Messagebox.show(Labels.getLabel("conferenciaController.MSG.tipoInfomativoObrigatorio"), Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); + Messagebox.OK, Messagebox.ERROR); return false; } @@ -1307,7 +1306,8 @@ public class ConferenciaController extends MyGenericForwardComposer { @SuppressWarnings("unchecked") private boolean isObservacaoLancada(BoletoComissao boletoComissao) { - for (LogConferenciaVO logConferencia : (List)logsConferenciaList.getListData()) { ; + for (LogConferenciaVO logConferencia : (List) logsConferenciaList.getListData()) { + ; if (boletoComissao.getCajaId().equals(logConferencia.getCajaId())) { return true; } @@ -1346,8 +1346,8 @@ public class ConferenciaController extends MyGenericForwardComposer { diaConferenciaComissaoAux.setIndsemmovimento(diaConferenciaComissao.getIndsemmovimento()); } } - if(conferenciaList != null){ - conferenciaList.updateItem(conferenciaComissao); + if (conferenciaList != null) { + conferenciaList.updateItem(conferenciaComissao); } } } catch (BusinessException e) { @@ -1359,7 +1359,7 @@ public class ConferenciaController extends MyGenericForwardComposer { try { if (isPeriodo) { lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(null, conferencias, BoletoStatusComissao.BOLETO_DEVOLVIDO, false); - }else{ + } else { lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(null, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO, false); } @@ -1409,15 +1409,15 @@ public class ConferenciaController extends MyGenericForwardComposer { public Boolean isMovimentoNaoEncerrado() { return conferencia.getIndconferido() == null || !conferencia.getIndconferido(); } - - public Boolean isMovimentoNaoEncerrado(Conferencia c){ + + public Boolean isMovimentoNaoEncerrado(Conferencia c) { return c.getIndconferido() == null || !c.getIndconferido(); } public Boolean isMovimentoEncerrado() { return conferencia.getIndconferido() != null && conferencia.getIndconferido(); } - + public Boolean isMovimentoEncerrado(Conferencia c) { return c.getIndconferido() != null && c.getIndconferido(); } @@ -1443,13 +1443,14 @@ public class ConferenciaController extends MyGenericForwardComposer { } return false; } + private Boolean exibirBtnLogPeriodo = true; - + public Boolean isExibirBotaoLancamentoObservacao() { - if(isPeriodo){ - //caso Periodo, a validação é feita no combo de dias de conferencia + if (isPeriodo) { + // caso Periodo, a validação é feita no combo de dias de conferencia return exibirBtnLogPeriodo; - }else{ + } else { return !isMovimentoEncerrado() && (isMaloteRecebido() || !isNaopermiteconfsemmalote()); } } @@ -1481,16 +1482,16 @@ public class ConferenciaController extends MyGenericForwardComposer { } return false; } - + private Boolean isMaloteRecebido() { - if(conferencia != null) { + if (conferencia != null) { return conferencia.getIndmaloterecebido() != null && conferencia.getIndmaloterecebido(); } return false; } - - private Boolean isMaloteRecebido(Conferencia c){ - if(c != null) { + + private Boolean isMaloteRecebido(Conferencia c) { + if (c != null) { return c.getIndmaloterecebido() != null && c.getIndmaloterecebido(); } return false; @@ -1532,13 +1533,13 @@ public class ConferenciaController extends MyGenericForwardComposer { private LogConferencia gravarLogConferencia(Conferencia c, TipoLogConferencia tipo, Long id, String numfoliosistema) throws BusinessException { LogConferencia logConferencia = new LogConferencia(); logConferencia.setObservacao("OK"); - - if(isPeriodo){ + + if (isPeriodo) { logConferencia.setConferencia(c); - }else{ + } else { logConferencia.setConferencia(conferencia); } - + logConferencia.setStatus(StatusLogConferencia.CONFERIDO); logConferencia.setTipo(tipo); logConferencia.setIndcredito((short) 1); @@ -1582,7 +1583,7 @@ public class ConferenciaController extends MyGenericForwardComposer { @SuppressWarnings("unchecked") private void gravarLogConferenciaBilhete(MyListbox bilhetes, BoletoComissao boletoComissao, Tab tab, String label) { try { - LogConferencia logConferencia = gravarLogConferencia(boletoComissao.getConferencia(),TipoLogConferencia.BOLETO, boletoComissao.getCajaId(), boletoComissao.getNumFolioSistema()); + LogConferencia logConferencia = gravarLogConferencia(boletoComissao.getConferencia(), TipoLogConferencia.BOLETO, boletoComissao.getCajaId(), boletoComissao.getNumFolioSistema()); boletoComissao.setLogconferenciaId(logConferencia.getLogconferenciaId()); boletoComissao.setStatus(logConferencia.getStatus().getValue()); boletoComissao.setConferido(Boolean.TRUE); @@ -1677,8 +1678,8 @@ public class ConferenciaController extends MyGenericForwardComposer { @Override public void closeWindow() { - if(!isPeriodo){ - carregarDadosConferencia(); + if (!isPeriodo) { + carregarDadosConferencia(); } super.closeWindow(); } @@ -1784,13 +1785,13 @@ public class ConferenciaController extends MyGenericForwardComposer { public void setRowDataMovimento(Row rowDataMovimento) { this.rowDataMovimento = rowDataMovimento; } - + private boolean getEnableDisableCheckBox(Conferencia conferencia) { - if(isPeriodo){ + if (isPeriodo) { return (isMovimentoEncerrado(conferencia) && isPermissaoReabrirMovimento() || !isMaloteRecebido(conferencia) && isNaopermiteconfsemmalote()); } return isExibirBotaoReabrirMovimento() || (!isMaloteRecebido() && isNaopermiteconfsemmalote()); - + } - + } \ No newline at end of file diff --git a/web/gui/comissao/conferencia.zul b/web/gui/comissao/conferencia.zul index 1a58f9756..bdfcf1960 100644 --- a/web/gui/comissao/conferencia.zul +++ b/web/gui/comissao/conferencia.zul @@ -24,11 +24,10 @@ image="/gui/img/confirmar_chegada.png" width="35px" tooltiptext="${c:l('conferenciaController.btnChegadaMalote.tooltiptext')}" visible="@{winConferencia$composer.exibirBotaoChegadaMalote}" /> -