From 4020ca4fefd039a71d8d8f6f5432a0a007232cac Mon Sep 17 00:00:00 2001 From: edgar Date: Tue, 27 Sep 2016 12:38:12 +0000 Subject: [PATCH] fixes bug #7905 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@60763 d1611594-4594-4d17-8e1d-87c2c4800839 --- .classpath | 1 + .../comissao/ConferenciaController.java | 654 ++++----- .../InformeIrregularidadeController.java | 61 + web/WEB-INF/i3-label_es_MX.label | 15 +- web/WEB-INF/i3-label_pt_BR.label | 17 +- web/gui/comissao/conferencia.zul | 1264 +++++++++-------- .../informeIrregularidadeComissao.zul | 36 + 7 files changed, 1067 insertions(+), 981 deletions(-) create mode 100644 src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/InformeIrregularidadeController.java create mode 100644 web/gui/comissao/informeIrregularidadeComissao.zul diff --git a/.classpath b/.classpath index e775c7556..9dc0ea26c 100644 --- a/.classpath +++ b/.classpath @@ -106,5 +106,6 @@ + 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 094e469ca..3bfdbc70b 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 @@ -66,9 +66,9 @@ public class ConferenciaController extends MyGenericForwardComposer { private static final long serialVersionUID = 1L; private static Logger log = Logger.getLogger(ConferenciaController.class); - + @Autowired - private ConferenciaComissaoService conferenciaComissaoService; + private ConferenciaComissaoService conferenciaComissaoService; private String datamovimento; private Empresa empresa; @@ -76,17 +76,17 @@ public class ConferenciaController extends MyGenericForwardComposer { private PuntoVenta puntoventaFiltro; private String puntoventa; private Conferencia conferencia; - + private MyListbox eventosFinanceirosList; private List lsEventosFinanceiros; - + private MyListbox logsConferenciaList; private List lsLogsConferencia; - + private MyTextboxDecimal txtTotalCreditosEventoFinanceiros; private MyTextboxDecimal txtTotalDebitosEventoFinanceiros; private MyTextboxDecimal txtTotalDiferencaEventoFinanceiros; - + private MyTextboxDecimal txtTotalBilhetes; private MyTextboxDecimal txtTotalBilhetesCancelados; private MyTextboxDecimal txtTotalBilhetesDevolvidos; @@ -112,36 +112,36 @@ public class ConferenciaController extends MyGenericForwardComposer { private MyComboboxEstandar cmbSituacaoLog; private MyTextboxDecimal txtPrecoLog; private MyTextbox txtObservacaoLog; - + private MyListbox bilhetesList; private List lsBilhetes; - + private MyListbox bilhetesCanceladosList; private List lsBilhetesCancelados; - + private MyListbox bilhetesDevolvidosList; private List lsBilhetesDevolvidos; - + private MyListbox bilhetesGapList; private List lsBilhetesGap; - + private MyListbox bilhetesGapCanceladosList; private List lsBilhetesGapCancelados; - + private MyListbox bilhetesGapDevolvidosList; private List lsBilhetesGapDevolvidos; - + private MyListbox bilhetesManualList; private List lsBilhetesManual; private List lsOcds; private MyListbox ocdsList; - + private MyListbox conferenciaList; - + private Radio rDebito; private Radio rCredito; - + private ResumoComissao resumo; private BigDecimal totalBilhetesManual; private BigDecimal totalBilhetesVendidos; @@ -160,10 +160,10 @@ public class ConferenciaController extends MyGenericForwardComposer { private MyListbox formapagosList; private ConferenciaComissaoVO conferenciaComissao; - + @Override public void doAfterCompose(Component comp) throws Exception { - + conferenciaList = (MyListbox) Executions.getCurrent().getArg().get("conferenciaList"); Long conferenciaId = (Long) Executions.getCurrent().getArg().get("conferenciaId"); datamovimento = (String) Executions.getCurrent().getArg().get("datamovimento"); @@ -178,26 +178,26 @@ public class ConferenciaController extends MyGenericForwardComposer { super.doAfterCompose(comp); logsConferenciaList.setItemRenderer(new RenderLogConferencia()); - - ocdsList.setItemRenderer(new RenderOcd(){ + + ocdsList.setItemRenderer(new RenderOcd() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final OcdVO ocd = (OcdVO) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && ocd.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && ocd.getLogconferenciaId() == null) { gravarLogConferenciaOcd(ocd); - } else if(!checkEvent.isChecked() && ocd.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && ocd.getLogconferenciaId() != null) { removerLogConferenciaOcd(ocd); } } @@ -214,25 +214,25 @@ public class ConferenciaController extends MyGenericForwardComposer { } }); - eventosFinanceirosList.setItemRenderer(new RenderEventosFinanceiros(){ + eventosFinanceirosList.setItemRenderer(new RenderEventosFinanceiros() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final EventosFinanceirosVO eventoFinanceiro = (EventosFinanceirosVO) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && eventoFinanceiro.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && eventoFinanceiro.getLogconferenciaId() == null) { gravarLogConferenciaEventoFinanceiro(eventoFinanceiro); - } else if(!checkEvent.isChecked() && eventoFinanceiro.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && eventoFinanceiro.getLogconferenciaId() != null) { removerLogConferenciaEventoFinanceiro(eventoFinanceiro); } } @@ -241,62 +241,62 @@ public class ConferenciaController extends MyGenericForwardComposer { } } }); - + eventosFinanceirosList.addEventListener("onDoubleClick", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - EventosFinanceirosVO eventosFinanceiros = (EventosFinanceirosVO) eventosFinanceirosList.getSelected(); - lancarLogConferenciaEventosFinanceiros(eventosFinanceiros, eventosFinanceirosList); - } - }); - + @Override + public void onEvent(Event event) throws Exception { + EventosFinanceirosVO eventosFinanceiros = (EventosFinanceirosVO) eventosFinanceirosList.getSelected(); + lancarLogConferenciaEventosFinanceiros(eventosFinanceiros, eventosFinanceirosList); + } + }); + cmbSituacaoLog.addEventListener("onSelect", new EventListener() { @Override public void onEvent(Event event) throws Exception { - StatusLogConferencia status = StatusLogConferencia.getStatusLogConferencia((Integer)cmbSituacaoLog.getSelectedItem().getValue()); - if(StatusLogConferencia.CONFERIDO.equals(status)) { + StatusLogConferencia status = StatusLogConferencia.getStatusLogConferencia((Integer) cmbSituacaoLog.getSelectedItem().getValue()); + if (StatusLogConferencia.CONFERIDO.equals(status)) { txtPrecoLog.setDisabled(true); rDebito.setDisabled(true); rCredito.setDisabled(true); - } else if(StatusLogConferencia.PENDENCIA.equals(status)) { + } else if (StatusLogConferencia.PENDENCIA.equals(status)) { txtPrecoLog.setDisabled(false); rDebito.setDisabled(false); rCredito.setDisabled(false); } } }); - + ajustarListsBilhetes(); - + rDebito.setChecked(Boolean.TRUE); - + formapagosList.setItemRenderer(new RenderFormapagoComissao()); - + popularCombobox(); - + carregarDados(); } private void ajustarListsBilhetes() { - bilhetesManualList.setItemRenderer(new RenderBoletoComissao(){ + bilhetesManualList.setItemRenderer(new RenderBoletoComissao() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final BoletoComissao boletoComissao = (BoletoComissao) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { gravarLogConferenciaBilhete(bilhetesManualList, boletoComissao); - } else if(!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { removerLogConferenciaBilhete(bilhetesManualList, boletoComissao); } } @@ -312,26 +312,26 @@ public class ConferenciaController extends MyGenericForwardComposer { lancarLogConferenciaBilhete(boletoComissao, bilhetesManualList); } }); - - bilhetesList.setItemRenderer(new RenderBoletoComissao(){ + + bilhetesList.setItemRenderer(new RenderBoletoComissao() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final BoletoComissao boletoComissao = (BoletoComissao) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { gravarLogConferenciaBilhete(bilhetesList, boletoComissao); - } else if(!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { removerLogConferenciaBilhete(bilhetesList, boletoComissao); } } @@ -348,25 +348,25 @@ public class ConferenciaController extends MyGenericForwardComposer { } }); - bilhetesCanceladosList.setItemRenderer(new RenderBoletoComissao(){ + bilhetesCanceladosList.setItemRenderer(new RenderBoletoComissao() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final BoletoComissao boletoComissao = (BoletoComissao) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { gravarLogConferenciaBilhete(bilhetesCanceladosList, boletoComissao); - } else if(!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { removerLogConferenciaBilhete(bilhetesCanceladosList, boletoComissao); } } @@ -376,32 +376,32 @@ public class ConferenciaController extends MyGenericForwardComposer { } }); bilhetesCanceladosList.addEventListener("onDoubleClick", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - BoletoComissao boletoComissao = (BoletoComissao) bilhetesCanceladosList.getSelected(); - lancarLogConferenciaBilhete(boletoComissao, bilhetesCanceladosList); - } - }); - - bilhetesDevolvidosList.setItemRenderer(new RenderBoletoComissao(){ + @Override + public void onEvent(Event event) throws Exception { + BoletoComissao boletoComissao = (BoletoComissao) bilhetesCanceladosList.getSelected(); + lancarLogConferenciaBilhete(boletoComissao, bilhetesCanceladosList); + } + }); + + bilhetesDevolvidosList.setItemRenderer(new RenderBoletoComissao() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final BoletoComissao boletoComissao = (BoletoComissao) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { gravarLogConferenciaBilhete(bilhetesDevolvidosList, boletoComissao); - } else if(!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { removerLogConferenciaBilhete(bilhetesDevolvidosList, boletoComissao); } } @@ -411,32 +411,32 @@ public class ConferenciaController extends MyGenericForwardComposer { } }); bilhetesDevolvidosList.addEventListener("onDoubleClick", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - BoletoComissao boletoComissao = (BoletoComissao) bilhetesDevolvidosList.getSelected(); - lancarLogConferenciaBilhete(boletoComissao, bilhetesDevolvidosList); - } - }); - - bilhetesGapList.setItemRenderer(new RenderBoletoComissao(){ + @Override + public void onEvent(Event event) throws Exception { + BoletoComissao boletoComissao = (BoletoComissao) bilhetesDevolvidosList.getSelected(); + lancarLogConferenciaBilhete(boletoComissao, bilhetesDevolvidosList); + } + }); + + bilhetesGapList.setItemRenderer(new RenderBoletoComissao() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final BoletoComissao boletoComissao = (BoletoComissao) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { gravarLogConferenciaBilhete(bilhetesGapList, boletoComissao); - } else if(!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { removerLogConferenciaBilhete(bilhetesGapList, boletoComissao); } } @@ -446,32 +446,32 @@ public class ConferenciaController extends MyGenericForwardComposer { } }); bilhetesGapList.addEventListener("onDoubleClick", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapList.getSelected(); - lancarLogConferenciaBilhete(boletoComissao, bilhetesGapList); - } - }); - - bilhetesGapCanceladosList.setItemRenderer(new RenderBoletoComissao(){ + @Override + public void onEvent(Event event) throws Exception { + BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapList.getSelected(); + lancarLogConferenciaBilhete(boletoComissao, bilhetesGapList); + } + }); + + bilhetesGapCanceladosList.setItemRenderer(new RenderBoletoComissao() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final BoletoComissao boletoComissao = (BoletoComissao) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { gravarLogConferenciaBilhete(bilhetesGapCanceladosList, boletoComissao); - } else if(!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { removerLogConferenciaBilhete(bilhetesGapCanceladosList, boletoComissao); } } @@ -481,32 +481,32 @@ public class ConferenciaController extends MyGenericForwardComposer { } }); bilhetesGapCanceladosList.addEventListener("onDoubleClick", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapCanceladosList.getSelected(); - lancarLogConferenciaBilhete(boletoComissao, bilhetesCanceladosList); - } - }); - - bilhetesGapDevolvidosList.setItemRenderer(new RenderBoletoComissao(){ + @Override + public void onEvent(Event event) throws Exception { + BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapCanceladosList.getSelected(); + lancarLogConferenciaBilhete(boletoComissao, bilhetesCanceladosList); + } + }); + + bilhetesGapDevolvidosList.setItemRenderer(new RenderBoletoComissao() { @Override @SuppressWarnings("unchecked") public void render(Listitem lstm, Object o) throws Exception { super.render(lstm, o); final BoletoComissao boletoComissao = (BoletoComissao) o; List com = lstm.getChildren(); - for (Component component: com) { + for (Component component : com) { Listcell listCell = (Listcell) component; - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); + if (listCell.getFirstChild() instanceof Checkbox) { + Checkbox chk = (Checkbox) component.getFirstChild(); chk.setDisabled(isExibirBotaoReabrirMovimento()); chk.addEventListener("onCheck", new EventListener() { @Override public void onEvent(Event event) throws Exception { CheckEvent checkEvent = (CheckEvent) event; - if(checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { + if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) { gravarLogConferenciaBilhete(bilhetesGapDevolvidosList, boletoComissao); - } else if(!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { + } else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) { removerLogConferenciaBilhete(bilhetesGapDevolvidosList, boletoComissao); } } @@ -516,12 +516,12 @@ public class ConferenciaController extends MyGenericForwardComposer { } }); bilhetesGapDevolvidosList.addEventListener("onDoubleClick", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapDevolvidosList.getSelected(); - lancarLogConferenciaBilhete(boletoComissao, bilhetesDevolvidosList); - } - }); + @Override + public void onEvent(Event event) throws Exception { + BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapDevolvidosList.getSelected(); + lancarLogConferenciaBilhete(boletoComissao, bilhetesDevolvidosList); + } + }); } private void popularCombobox() { @@ -535,7 +535,7 @@ public class ConferenciaController extends MyGenericForwardComposer { private void carregarDados() { try { List boletosComissaos = conferenciaComissaoService.carregarBilhetesComissao(null, getConferencia(), null); - + carregarBilhetesManual(boletosComissaos); carregarBilhetesVendidos(boletosComissaos); carregarBilhetesCancelados(boletosComissaos); @@ -551,7 +551,7 @@ public class ConferenciaController extends MyGenericForwardComposer { log.error(e.getMessage(), e); } } - + private void carregarResumo(List boletosComissaos) throws BusinessException { resumo = conferenciaComissaoService.gerarResumo(conferencia, boletosComissaos, lsEventosFinanceiros, totalBilhetesManual, totalBilhetesVendidos, totalBilhetesCancelados, totalBilhetesDevolvidos, totalBilhetesGap, totalBilhetesGapCancelados, totalBilhetesGapDevolvidos, totalCreditosEventoFinanceiros, totalDebitosEventoFinanceiros, ocdTotal); formapagosList.setData(resumo.getTotalFormapago()); @@ -585,16 +585,16 @@ public class ConferenciaController extends MyGenericForwardComposer { totalBilhetesDevolvidos = BigDecimal.ZERO; lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO); Map totais = conferenciaComissaoService.totalizarBoletoComissaoDevolvidosTrocaOcd(lsBilhetesDevolvidos); - + totalBilhetesDevolvidos = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO); totalBilhetesDevolvidosOcd = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO_OCD); totalBilhetesDevolvidosTroca = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO_TROCADO); - + txtTotalBilhetesDevolvidos.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesDevolvidos, LocaleUtil.getLocale())); txtTotalBilhetesDevolvidosTroca.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesDevolvidosTroca, LocaleUtil.getLocale())); txtTotalBilhetesDevolvidosOcd.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesDevolvidosOcd, LocaleUtil.getLocale())); txtQtdeTotalBilhetesDevolvidos.setValue(String.valueOf(lsBilhetesDevolvidos.size())); - + bilhetesDevolvidosList.setData(lsBilhetesDevolvidos); } @@ -611,22 +611,22 @@ public class ConferenciaController extends MyGenericForwardComposer { totalBilhetesGapCancelados = conferenciaComissaoService.totalizarBoletoComissao(lsBilhetesGapCancelados); txtTotalBilhetesGapCancelados.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesGapCancelados, LocaleUtil.getLocale())); txtQtdeTotalBilhetesGapCancelados.setValue(String.valueOf(lsBilhetesGapCancelados.size())); - bilhetesGapCanceladosList.setData(lsBilhetesGapCancelados); + bilhetesGapCanceladosList.setData(lsBilhetesGapCancelados); } private void carregarBilhetesGapDevolvidos(List boletosComissaos) throws BusinessException { lsBilhetesGapDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_DEVOLVIDO); - + Map totais = conferenciaComissaoService.totalizarBoletoComissaoDevolvidosTrocaOcd(lsBilhetesGapDevolvidos); - + totalBilhetesGapDevolvidos = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO); totalBilhetesGapDevolvidosOcd = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO_OCD); totalBilhetesGapDevolvidosTroca = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO_TROCADO); - + txtTotalBilhetesGapDevolvidos.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesGapDevolvidos, LocaleUtil.getLocale())); txtTotalBilhetesGapDevolvidosOcd.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesGapDevolvidosOcd, LocaleUtil.getLocale())); txtTotalBilhetesGapDevolvidosTroca.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesGapDevolvidosTroca, LocaleUtil.getLocale())); - + txtQtdeTotalBilhetesGapDevolvidos.setValue(String.valueOf(lsBilhetesGapDevolvidos.size())); bilhetesGapDevolvidosList.setData(lsBilhetesGapDevolvidos); } @@ -639,28 +639,28 @@ public class ConferenciaController extends MyGenericForwardComposer { private void carregarEventosFinanceiros() throws BusinessException { lsEventosFinanceiros = conferenciaComissaoService.carregarEventosFinanceiros(conferencia); eventosFinanceirosList.setData(lsEventosFinanceiros); - + totalCreditosEventoFinanceiros = BigDecimal.ZERO; totalDebitosEventoFinanceiros = BigDecimal.ZERO; - + for (EventosFinanceirosVO eventoFinanceiro : lsEventosFinanceiros) { - if(eventoFinanceiro.isCredito()) { + if (eventoFinanceiro.isCredito()) { totalCreditosEventoFinanceiros = totalCreditosEventoFinanceiros.add(eventoFinanceiro.getImpingreso()); } else { totalDebitosEventoFinanceiros = totalDebitosEventoFinanceiros.add(eventoFinanceiro.getImpingreso()); } } - + txtTotalCreditosEventoFinanceiros.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalCreditosEventoFinanceiros, LocaleUtil.getLocale())); txtTotalDebitosEventoFinanceiros.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalDebitosEventoFinanceiros, LocaleUtil.getLocale())); txtTotalDiferencaEventoFinanceiros.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalCreditosEventoFinanceiros.subtract(totalDebitosEventoFinanceiros), LocaleUtil.getLocale())); } - + private void carregarOcds() throws BusinessException { lsOcds = conferenciaComissaoService.carregarOcds(conferencia); ocdTotal = conferenciaComissaoService.totalizarOcd(lsOcds); - - if(ocdTotal != null) { + + if (ocdTotal != null) { txtTotalOcdValorPagar.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(ocdTotal.getValorPagar(), LocaleUtil.getLocale())); txtQtdeTotalOcd.setValue(String.valueOf(lsOcds.size())); } @@ -671,42 +671,49 @@ public class ConferenciaController extends MyGenericForwardComposer { try { conferencia = conferenciaComissaoService.confirmarChegadaMalote(conferencia); - Messagebox.show(Labels.getLabel("conferenciaController.msg.confirmarChegadaMalote"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.INFORMATION); - - closeWindow(); + Messagebox.show(Labels.getLabel("conferenciaController.msg.confirmarChegadaMalote"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); } catch (Exception e) { log.error(e.getMessage(), e); - Messagebox.show(Labels.getLabel("MSG.Error"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); + Messagebox.show(Labels.getLabel("MSG.Error"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); } } public void onClick$btnEncerrarMovimentoDiario(Event event) throws InterruptedException { try { - if(isConferenciaPendente()) { + if (isConferenciaPendente()) { return; } - + conferencia = conferenciaComissaoService.encerrarMovimentoDiario(conferencia); - Messagebox.show(Labels.getLabel("conferenciaController.msg.encerrarMovimentoDiario"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.INFORMATION); - - closeWindow(); + Messagebox.show(Labels.getLabel("conferenciaController.msg.encerrarMovimentoDiario"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); } catch (Exception e) { log.error(e.getMessage(), e); - Messagebox.show(Labels.getLabel("MSG.Error"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); + Messagebox.show(Labels.getLabel("MSG.Error"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); } } + public void onClick$btnIrregularidade(Event event) throws InterruptedException { + Map args = new HashMap(); + args.put("puntoVentaId", puntoventaId); + openWindow("/gui/comissao/informeIrregularidadeComissao.zul", + Labels.getLabel("informeIrregularidadeController.window.title"), args); + } + private boolean isConferenciaPendente() throws InterruptedException, BusinessException { List lsBoletoComissao = new ArrayList(); lsBoletoComissao.addAll(lsBilhetesManual); @@ -716,59 +723,59 @@ public class ConferenciaController extends MyGenericForwardComposer { lsBoletoComissao.addAll(lsBilhetesGap); lsBoletoComissao.addAll(lsBilhetesGapCancelados); lsBoletoComissao.addAll(lsBilhetesGapDevolvidos); - - if(conferenciaComissaoService.isBilhetesSemConferencia(lsBoletoComissao)) { - Messagebox.show(Labels.getLabel("conferenciaController.MSG.bilheteSemConferenciaFormapagoCategoria"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.EXCLAMATION); - return true; + + if (conferenciaComissaoService.isBilhetesSemConferencia(lsBoletoComissao)) { + Messagebox.show(Labels.getLabel("conferenciaController.MSG.bilheteSemConferenciaFormapagoCategoria"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return true; } - if(conferenciaComissaoService.isEventosFinanceirosSemConferencia(lsEventosFinanceiros)) { + if (conferenciaComissaoService.isEventosFinanceirosSemConferencia(lsEventosFinanceiros)) { Messagebox.show(Labels.getLabel("conferenciaController.MSG.eventosFinanceirosSemConferenciaFormapago"), Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.EXCLAMATION); + Messagebox.OK, Messagebox.EXCLAMATION); return true; } - - if(conferenciaComissaoService.isOcdSemConferencia(lsOcds)) { + + if (conferenciaComissaoService.isOcdSemConferencia(lsOcds)) { Messagebox.show(Labels.getLabel("conferenciaController.MSG.ocdSemConferencia"), Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.EXCLAMATION); + Messagebox.OK, Messagebox.EXCLAMATION); return true; } - + return false; } public void onClick$btnReabrirMovimentoDiario(Event event) throws InterruptedException { try { conferencia = conferenciaComissaoService.reabrirMovimentoDiario(conferencia); - + Messagebox.show(Labels.getLabel("conferenciaController.msg.reabrirMovimentoDiario"), Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.INFORMATION); - + Messagebox.OK, Messagebox.INFORMATION); + closeWindow(); - + } catch (Exception e) { log.error(e.getMessage(), e); Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); + Messagebox.OK, Messagebox.ERROR); } } - + private void recuperarConferencia(Long conferenciaId) throws ParseException, BusinessException { - if(conferenciaId != null) { + if (conferenciaId != null) { conferencia = conferenciaComissaoService.obtenerID(conferenciaId); } - - if(conferencia == null) { + + if (conferencia == null) { conferencia = conferenciaComissaoService.obtenerConferenciaDataMovimento(DateUtil.getDateFromString(datamovimento, "dd/MM/yyyy"), puntoventaId, empresa.getEmpresaId()); } - - if(conferencia == null) { + + if (conferencia == null) { conferencia = new Conferencia(); conferencia.setActivo(Boolean.TRUE); conferencia.setFecmodif(new Date()); @@ -778,49 +785,49 @@ public class ConferenciaController extends MyGenericForwardComposer { conferencia.setDatamovimento(DateUtil.getDateFromString(datamovimento, "dd/MM/yyyy")); } } - + public void onClick$btnAdicionarObservacaoLog(Event event) throws InterruptedException { try { - if(validarCamposObservacao()) { - + if (validarCamposObservacao()) { + LogConferencia logConferencia = new LogConferencia(); logConferencia.setPreco(txtPrecoLog.getValueDecimal()); logConferencia.setObservacao(txtObservacaoLog.getValue()); logConferencia.setConferencia(conferencia); - logConferencia.setStatus(StatusLogConferencia.getStatusLogConferencia((Integer)cmbSituacaoLog.getSelectedItem().getValue())); + logConferencia.setStatus(StatusLogConferencia.getStatusLogConferencia((Integer) cmbSituacaoLog.getSelectedItem().getValue())); logConferencia.setTipo(TipoLogConferencia.AVULSO); logConferencia.setIndcredito(!rDebito.isChecked()); conferenciaComissaoService.suscribirLogConferencia(logConferencia); - + carregarLogsConferencia(); - - Messagebox.show(Labels.getLabel("conferenciaController.msg.adicionarLogConferencia"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.INFORMATION); - + + Messagebox.show(Labels.getLabel("conferenciaController.msg.adicionarLogConferencia"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } } catch (Exception e) { log.error(e.getMessage(), e); - Messagebox.show(Labels.getLabel("MSG.Error"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); + Messagebox.show(Labels.getLabel("MSG.Error"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); } } - + private boolean validarCamposObservacao() throws InterruptedException { try { - if(StringUtils.isBlank(txtObservacaoLog.getValue())) { + if (StringUtils.isBlank(txtObservacaoLog.getValue())) { Messagebox.show(Labels.getLabel("conferenciaController.MSG.observacaoObrigatorio"), Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); + Messagebox.OK, Messagebox.ERROR); return false; } } catch (Exception e) { - Messagebox.show(Labels.getLabel("conferenciaController.MSG.observacaoObrigatorio"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); - return false; + Messagebox.show(Labels.getLabel("conferenciaController.MSG.observacaoObrigatorio"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + return false; } return true; } @@ -836,100 +843,100 @@ public class ConferenciaController extends MyGenericForwardComposer { LogConferenciaVO logConferenciaVO = (LogConferenciaVO) logsConferenciaList.getSelected(); LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(logConferenciaVO.getLogconferenciaId()); conferenciaComissaoService.borrarLogConferencia(logConferencia); - + carregarDados(); - - Messagebox.show(Labels.getLabel("conferenciaController.msg.removerLogConferencia"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.INFORMATION); + + Messagebox.show(Labels.getLabel("conferenciaController.msg.removerLogConferencia"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); } - + } catch (Exception e) { log.error(e.getMessage(), e); - Messagebox.show(Labels.getLabel("MSG.Error"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); + Messagebox.show(Labels.getLabel("MSG.Error"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); } } - + private void lancarLogConferenciaBilhete(BoletoComissao boletoComissao, MyListbox localBilhetesList) { if (boletoComissao == null || isObservacaoLancada(boletoComissao) || isMovimentoEncerrado()) { - return; - } + return; + } - Map args = new HashMap(); - args.put("boletoComissao", boletoComissao); - args.put("logsConferenciaList", logsConferenciaList); - args.put("bilhetesList", localBilhetesList); - args.put("conferencia", conferencia); + Map args = new HashMap(); + args.put("boletoComissao", boletoComissao); + args.put("logsConferenciaList", logsConferenciaList); + args.put("bilhetesList", localBilhetesList); + args.put("conferencia", conferencia); + + openWindow("/gui/comissao/editarLogConferenciaComissao.zul", + Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL); + } - openWindow("/gui/comissao/editarLogConferenciaComissao.zul", - Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL); - } - private void lancarLogConferenciaEventosFinanceiros(EventosFinanceirosVO eventosFinanceiros, MyListbox eventosFinanceirosList) { - if (eventosFinanceiros == null || isObservacaoLancada(eventosFinanceiros) || isMovimentoEncerrado()) { - return; - } + if (eventosFinanceiros == null || isObservacaoLancada(eventosFinanceiros) || isMovimentoEncerrado()) { + return; + } - Map args = new HashMap(); - args.put("eventosFinanceiros", eventosFinanceiros); - args.put("logsConferenciaList", logsConferenciaList); - args.put("eventosFinanceirosList", eventosFinanceirosList); - args.put("conferencia", conferencia); + Map args = new HashMap(); + args.put("eventosFinanceiros", eventosFinanceiros); + args.put("logsConferenciaList", logsConferenciaList); + args.put("eventosFinanceirosList", eventosFinanceirosList); + args.put("conferencia", conferencia); - openWindow("/gui/comissao/editarLogConferenciaComissao.zul", - Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL); + openWindow("/gui/comissao/editarLogConferenciaComissao.zul", + Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL); } - + private void lancarLogConferenciaOcd(OcdVO ocd, MyListbox ocdsList) { - if (ocd == null || isObservacaoLancada(ocd) || isMovimentoEncerrado()) { - return; - } + if (ocd == null || isObservacaoLancada(ocd) || isMovimentoEncerrado()) { + return; + } - Map args = new HashMap(); - args.put("ocd", ocd); - args.put("logsConferenciaList", logsConferenciaList); - args.put("ocdsList", ocdsList); - args.put("conferencia", conferencia); + Map args = new HashMap(); + args.put("ocd", ocd); + args.put("logsConferenciaList", logsConferenciaList); + args.put("ocdsList", ocdsList); + args.put("conferencia", conferencia); - openWindow("/gui/comissao/editarLogConferenciaComissao.zul", - Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL); + openWindow("/gui/comissao/editarLogConferenciaComissao.zul", + Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL); } - + private boolean isObservacaoLancada(BoletoComissao boletoComissao) { for (LogConferenciaVO logConferencia : lsLogsConferencia) { - if(boletoComissao.getBoletoId().equals(logConferencia.getBoletoId())) { + if (boletoComissao.getBoletoId().equals(logConferencia.getBoletoId())) { return true; } } return false; } - + private boolean isObservacaoLancada(EventosFinanceirosVO eventosFinanceiros) { for (LogConferenciaVO logConferencia : lsLogsConferencia) { - if(eventosFinanceiros.getEventoextraId().equals(logConferencia.getEventoextraId())) { + if (eventosFinanceiros.getEventoextraId().equals(logConferencia.getEventoextraId())) { return true; } } return false; } - + private boolean isObservacaoLancada(OcdVO ocd) { for (LogConferenciaVO logConferencia : lsLogsConferencia) { - if(ocd.getOcdId().equals(logConferencia.getOcdId())) { + if (ocd.getOcdId().equals(logConferencia.getOcdId())) { return true; } } return false; } - + private void carregarDadosConferencia() { try { DiaConferenciaComissaoVO diaConferenciaComissao = conferenciaComissaoService.carregarConferenciaRegistrada(conferencia.getDatamovimento(), conferencia.getEmpresa(), puntoventaFiltro); - if(diaConferenciaComissao != null) { + if (diaConferenciaComissao != null) { for (DiaConferenciaComissaoVO diaConferenciaComissaoAux : conferenciaComissao.getDiasOrdenado()) { - if(diaConferenciaComissao.equals(diaConferenciaComissaoAux)) { + if (diaConferenciaComissao.equals(diaConferenciaComissaoAux)) { diaConferenciaComissaoAux.setIndboletogerado(diaConferenciaComissao.getIndboletogerado()); diaConferenciaComissaoAux.setIndconferido(diaConferenciaComissao.getIndconferido()); diaConferenciaComissaoAux.setIndmaloterecebido(diaConferenciaComissao.getIndmaloterecebido()); @@ -943,23 +950,19 @@ public class ConferenciaController extends MyGenericForwardComposer { log.error(e.getMessage(), e); } } - + public void onClick$btnPesquisaBoletoDevolvido(Event event) throws InterruptedException { try { -/* if((empresa.getIndcarboletosdevolvidosconf() == null || !empresa.getIndcarboletosdevolvidosconf()) && - StringUtils.isBlank(conferencia.getNumfoliosistema())) { - Messagebox.show(Labels.getLabel("conferenciaController.msg.numfoliosistemaNaoInformado"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.INFORMATION); - return; - }*/ + /* + * if((empresa.getIndcarboletosdevolvidosconf() == null || !empresa.getIndcarboletosdevolvidosconf()) && StringUtils.isBlank(conferencia.getNumfoliosistema())) { Messagebox.show(Labels.getLabel("conferenciaController.msg.numfoliosistemaNaoInformado"), Labels.getLabel("conferenciaController.window.title"), Messagebox.OK,Messagebox.INFORMATION); return; } + */ lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(null, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO); - + Map totais = conferenciaComissaoService.totalizarBoletoComissaoDevolvidosTrocaOcd(lsBilhetesDevolvidos); totalBilhetesDevolvidos = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO); txtTotalBilhetesDevolvidos.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesDevolvidos, LocaleUtil.getLocale())); txtQtdeTotalBilhetesDevolvidos.setValue(String.valueOf(lsBilhetesDevolvidos.size())); - + bilhetesDevolvidosList.setData(lsBilhetesDevolvidos); } catch (BusinessException e) { log.error(e.getMessage(), e); @@ -997,30 +1000,30 @@ public class ConferenciaController extends MyGenericForwardComposer { public void setConferencia(Conferencia conferencia) { this.conferencia = conferencia; } - + public Boolean isMovimentoNaoEncerrado() { return conferencia.getIndconferido() == null || !conferencia.getIndconferido(); - } - + } + public Boolean isMovimentoEncerrado() { return conferencia.getIndconferido() != null && conferencia.getIndconferido(); - } - + } + public Boolean isPermissaoEncerrarMovimento() { return UsuarioLogado.getUsuarioLogado().isPermisoClave(Constantes.CLAVE_ENCERRAR_MOVIMENTODIARIO); - } + } public Boolean isPermissaoReabrirMovimento() { return UsuarioLogado.getUsuarioLogado().isPermisoClave(Constantes.CLAVE_REABRIR_MOVIMENTODIARIO); - } + } public Boolean isExibirBotaoReabrirMovimento() { return isMovimentoEncerrado() && isPermissaoReabrirMovimento(); - } + } public Boolean isExibirBotaoEncerrarMovimento() { return isMovimentoNaoEncerrado() && isPermissaoEncerrarMovimento(); - } + } public Boolean isExibirBotaoChegadaMalote() { return (conferencia.getIndmaloterecebido() == null || !conferencia.getIndmaloterecebido()) && isMovimentoNaoEncerrado(); @@ -1038,12 +1041,12 @@ public class ConferenciaController extends MyGenericForwardComposer { validarOcds(); } catch (Exception e) { log.error(e.getMessage(), e); - Messagebox.show(Labels.getLabel("MSG.Error"), - Labels.getLabel("conferenciaController.window.title"), - Messagebox.OK,Messagebox.ERROR); + Messagebox.show(Labels.getLabel("MSG.Error"), + Labels.getLabel("conferenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); } } - + private void validarOcds() { } @@ -1051,40 +1054,16 @@ public class ConferenciaController extends MyGenericForwardComposer { } private void validarBilhetes() throws BusinessException { - /*validarListBilhetes(bilhetesManualList); - validarListBilhetes(bilhetesList); - validarListBilhetes(bilhetesCanceladosList); - validarListBilhetes(bilhetesDevolvidosList); - validarListBilhetes(bilhetesGapCanceladosList); - validarListBilhetes(bilhetesGapDevolvidosList); - validarListBilhetes(bilhetesGapList);*/ + /* + * validarListBilhetes(bilhetesManualList); validarListBilhetes(bilhetesList); validarListBilhetes(bilhetesCanceladosList); validarListBilhetes(bilhetesDevolvidosList); validarListBilhetes(bilhetesGapCanceladosList); validarListBilhetes(bilhetesGapDevolvidosList); validarListBilhetes(bilhetesGapList); + */ } - /*@SuppressWarnings("unchecked") - private void validarListBilhetes(MyListbox bilhetes) throws BusinessException { - int index = 0; - List itens = bilhetes.getItems(); - List boletoComissaos = bilhetes.getListData(); - for (Listitem item: itens) { - BoletoComissao boletoComissao = boletoComissaos.get(index++); - boletoComissao.setConferido(validarListitemMarcado(item, boletoComissao)); - if(boletoComissao.isConferido() && boletoComissao.getLogconferenciaId() == null) { - LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.BOLETO, boletoComissao.getBoletoId(), boletoComissao.getNumFolioSistema()); - boletoComissao.setLogconferenciaId(logConferencia.getLogconferenciaId()); - boletoComissao.setStatus(logConferencia.getStatus().getValue()); - boletoComissao.setConferido(Boolean.TRUE); - bilhetes.updateItem(boletoComissao); - } else if(!boletoComissao.isConferido() && boletoComissao.getLogconferenciaId() != null) { - LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(boletoComissao.getLogconferenciaId()); - conferenciaComissaoService.borrarLogConferencia(logConferencia); - boletoComissao.setLogconferenciaId(null); - boletoComissao.setStatus(null); - boletoComissao.setConferido(Boolean.FALSE); - removerLogConferencia(logConferencia); - bilhetes.updateItem(boletoComissao); - } - } - }*/ + /* + * @SuppressWarnings("unchecked") private void validarListBilhetes(MyListbox bilhetes) throws BusinessException { int index = 0; List itens = bilhetes.getItems(); List boletoComissaos = bilhetes.getListData(); for (Listitem item: itens) { BoletoComissao boletoComissao = boletoComissaos.get(index++); boletoComissao.setConferido(validarListitemMarcado(item, boletoComissao)); if(boletoComissao.isConferido() && boletoComissao.getLogconferenciaId() == + * null) { LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.BOLETO, boletoComissao.getBoletoId(), boletoComissao.getNumFolioSistema()); boletoComissao.setLogconferenciaId(logConferencia.getLogconferenciaId()); boletoComissao.setStatus(logConferencia.getStatus().getValue()); boletoComissao.setConferido(Boolean.TRUE); bilhetes.updateItem(boletoComissao); } else if(!boletoComissao.isConferido() && boletoComissao.getLogconferenciaId() != null) { + * LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(boletoComissao.getLogconferenciaId()); conferenciaComissaoService.borrarLogConferencia(logConferencia); boletoComissao.setLogconferenciaId(null); boletoComissao.setStatus(null); boletoComissao.setConferido(Boolean.FALSE); removerLogConferencia(logConferencia); bilhetes.updateItem(boletoComissao); } } } + */ private void removerLogConferencia(Long logconferenciaId) { LogConferenciaVO log = new LogConferenciaVO(logconferenciaId); @@ -1099,23 +1078,23 @@ public class ConferenciaController extends MyGenericForwardComposer { logConferencia.setStatus(StatusLogConferencia.CONFERIDO); logConferencia.setTipo(tipo); logConferencia.setIndcredito(Boolean.TRUE); - - if(tipo.equals(TipoLogConferencia.BOLETO)) { + + if (tipo.equals(TipoLogConferencia.BOLETO)) { logConferencia.setBoletoId(id); } - if(tipo.equals(TipoLogConferencia.OCD)) { + if (tipo.equals(TipoLogConferencia.OCD)) { logConferencia.setOcdId(id); } - if(tipo.equals(TipoLogConferencia.EVENTO_FINANCEIRO)) { + if (tipo.equals(TipoLogConferencia.EVENTO_FINANCEIRO)) { logConferencia.setEventoextraId(id); } - + logConferencia = conferenciaComissaoService.suscribirLogConferencia(logConferencia); atualizarLogConferenciaList(logConferencia, numfoliosistema); - + return logConferencia; } - + private void atualizarLogConferenciaList(LogConferencia logConferencia, String numfoliosistema) { LogConferenciaVO logConferenciaVO = new LogConferenciaVO(); logConferenciaVO.setLogconferenciaId(logConferencia.getLogconferenciaId()); @@ -1133,30 +1112,13 @@ public class ConferenciaController extends MyGenericForwardComposer { lsLogsConferencia.add(logConferenciaVO); } - /*@SuppressWarnings("unchecked") - private void addCheckboxEventListenerBilhetes(MyListbox bilhetes) { - int index = 0; - List itens = bilhetes.getItems(); - List boletoComissaos = bilhetes.getListData(); - for (Listitem item: itens) { - List com = item.getChildren(); - for (Component component: com) { - Listcell listCell = (Listcell) component; - System.out.println(listCell.getFirstChild()); - if(listCell.getFirstChild() instanceof Checkbox) { - Checkbox chk = (Checkbox)component.getFirstChild(); - chk.setId(boletoComissaos.get(index++).getBoletoId()+""); - chk.addEventListener("onCheck", new EventListener() { - @Override - public void onEvent(Event arg0) throws Exception { - System.out.println("EXECUTOU"); - } - }); - } - } - } - }*/ - + /* + * @SuppressWarnings("unchecked") private void addCheckboxEventListenerBilhetes(MyListbox bilhetes) { int index = 0; List itens = bilhetes.getItems(); List boletoComissaos = bilhetes.getListData(); for (Listitem item: itens) { List com = item.getChildren(); for (Component component: com) { Listcell listCell = (Listcell) component; System.out.println(listCell.getFirstChild()); if(listCell.getFirstChild() instanceof Checkbox) { Checkbox + * chk = (Checkbox)component.getFirstChild(); chk.setId(boletoComissaos.get(index++).getBoletoId()+""); chk.addEventListener("onCheck", new EventListener() { + * + * @Override public void onEvent(Event arg0) throws Exception { System.out.println("EXECUTOU"); } }); } } } } + */ + private void gravarLogConferenciaBilhete(MyListbox bilhetes, BoletoComissao boletoComissao) { try { LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.BOLETO, boletoComissao.getBoletoId(), boletoComissao.getNumFolioSistema()); @@ -1168,7 +1130,7 @@ public class ConferenciaController extends MyGenericForwardComposer { log.error(e.getMessage(), e); } } - + private void removerLogConferenciaBilhete(MyListbox bilhetes, BoletoComissao boletoComissao) { try { LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(boletoComissao.getLogconferenciaId()); @@ -1182,7 +1144,7 @@ public class ConferenciaController extends MyGenericForwardComposer { log.error(e.getMessage(), e); } } - + private void gravarLogConferenciaEventoFinanceiro(EventosFinanceirosVO eventoFinanceiro) { try { LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.EVENTO_FINANCEIRO, eventoFinanceiro.getEventoextraId(), null); @@ -1194,7 +1156,7 @@ public class ConferenciaController extends MyGenericForwardComposer { log.error(e.getMessage(), e); } } - + private void removerLogConferenciaEventoFinanceiro(EventosFinanceirosVO eventoFinanceiro) { try { LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(eventoFinanceiro.getLogconferenciaId()); @@ -1208,7 +1170,7 @@ public class ConferenciaController extends MyGenericForwardComposer { log.error(e.getMessage(), e); } } - + private void gravarLogConferenciaOcd(OcdVO ocd) { try { LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.OCD, ocd.getOcdId(), null); @@ -1220,7 +1182,7 @@ public class ConferenciaController extends MyGenericForwardComposer { log.error(e.getMessage(), e); } } - + private void removerLogConferenciaOcd(OcdVO ocd) { try { LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(ocd.getLogconferenciaId()); @@ -1234,7 +1196,7 @@ public class ConferenciaController extends MyGenericForwardComposer { log.error(e.getMessage(), e); } } - + @Override public void closeWindow() { carregarDadosConferencia(); @@ -1255,6 +1217,6 @@ public class ConferenciaController extends MyGenericForwardComposer { public void setFormapagosList(MyListbox formapagosList) { this.formapagosList = formapagosList; - } + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/InformeIrregularidadeController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/InformeIrregularidadeController.java new file mode 100644 index 000000000..882872ff7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/InformeIrregularidadeController.java @@ -0,0 +1,61 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.comissao; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.ConferenciaComissaoService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +@Scope("prototype") +@Controller("informeIrregularidadeController") +public class InformeIrregularidadeController extends MyGenericForwardComposer { + private static final long serialVersionUID = 1L; + + @Autowired + PuntoVentaService puntoVentaService; + + @Autowired + ConferenciaComissaoService conferenciaComissaoService; + + private Textbox txtEmail; + private Textbox txtConteudoEmail; + + private PuntoVenta puntoVenta; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + Integer puntoVentaId = (Integer) Executions.getCurrent().getArg().get("puntoVentaId"); + puntoVenta = puntoVentaService.obtenerID(puntoVentaId); + } + + public void onClick$btnEnviar(Event event) throws InterruptedException { + try { + conferenciaComissaoService.enviarEmailIrregularidadeECF(txtEmail.getValue(), + txtConteudoEmail.getValue(), Labels.getLabel("informeIrregularidadeController.window.title")); + } catch (Exception e) { + Messagebox.show(e.getMessage(), Labels.getLabel("informeIrregularidadeController.mail.erro"), + Messagebox.OK, + Messagebox.ERROR); + e.printStackTrace(); + } + closeWindow(); + } + + public void onClick$btnCancelar(Event event) { + closeWindow(); + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } +} diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 92acab052..51f0995e4 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -3,7 +3,7 @@ # E abrir a planilha no editor. # Formato da clav -# Control ZUL. Identificación del Componente. Propiedad = XXX +# Control ZUL. Identificación del Componente. Propiedad = XXX # . . = XXX indexController.app.nome=Administracion de la Venta @@ -6456,7 +6456,9 @@ conferenciaController.lbValorTotalDevolvidosTroca.label = Total Cambio conferenciaController.lbQtdeTotal.label = Cantidad conferenciaController.lbTotalOcdPenalizacion.label = Total Penalización conferenciaController.lbTotalOcdValorPagar.label = Total Pagar -conferenciaController.lbTotalOcdValorPago.label = Total Pago +conferenciaController.lbTotalOcdValorPago.label = Total Pago OCD +conferenciaController.lbQuantidadeECF.label= Quantidade ECF +conferenciaController.lbBtnIrregularidade.label=Comunicar Irregularidade conferenciaController.lhNombusuario.value = Cajero conferenciaController.lhTotalVenda.value = Total Venda conferenciaController.lhTotalCancelados.value = Total Cancelados @@ -6470,6 +6472,15 @@ conferenciaController.lhConferido.value = Chequeado conferenciaController.lhNumoperacionBilhete.value = Localizador conferenciaController.lhFeccorridaServico.value = Fec-Serv +informeIrregularidadeController.window.title=Irregularidade ECF +informeIrregularidadeController.mail.msg= Pela quantidade de ECF's, estão faltando reduções Z. Favor verificar +informeIrregularidadeController.lbMail=E-mail +informeIrregularidadeController.lbMsg=Menssagem +informeIrregularidadeController.mail.enviar=Enviar +informeIrregularidadeController.mail.cancelar=Cancelar +informeIrregularidadeController.mail.configuracoes=Verifique as configurações de email! +informeIrregularidadeController.mail.erro= Falha no envio + # Editar LogConferencia Comissao editarLogConferenciaComissaoController.window.title = Registro de Observaciones editarLogConferenciaComissaoController.lhSituacaoLog.value = Situación diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index b24045aa2..8ae0d93c4 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -9,7 +9,7 @@ indexController.app.nome=Administração da Venta #Versao do VentaBoleto: versao = ADM_20130830_1RC216 - + # MSG Defaut: MSG.CONSTRAINT.CAMPOOBRIGATORIO=Preencha os campos obrigatórios ou limpe os dados tela! MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100 @@ -6620,8 +6620,10 @@ conferenciaController.lbValorTotalDevolvidosOcd.label = Total OCD conferenciaController.lbValorTotalDevolvidosTroca.label = Total Troca conferenciaController.lbQtdeTotal.label = Quantidade conferenciaController.lbTotalOcdPenalizacion.label = Total Penalização -conferenciaController.lbTotalOcdValorPagar.label = Total Pagar -conferenciaController.lbTotalOcdValorPago.label = Total Pago +conferenciaController.lbTotalOcdValorPagar.label =Total Pagar +conferenciaController.lbTotalOcdValorPago.label =Total Pago OCD +conferenciaController.lbQuantidadeECF.label=Quantidade ECF +conferenciaController.lbBtnIrregularidade.label=Comunicar Irregularidade conferenciaController.lhNombusuario.value = Bilheteiro conferenciaController.lhTotalVenda.value = Total Venda conferenciaController.lhTotalCancelados.value = Total Cancelados @@ -6635,6 +6637,15 @@ conferenciaController.lhConferido.value = Conferido conferenciaController.lhNumoperacionBilhete.value = Localizador conferenciaController.lhFeccorridaServico.value = DT-Serv +informeIrregularidadeController.window.title=Irregularidade ECF +informeIrregularidadeController.mail.msg= Pela quantidade de ECF's, estão faltando reduções Z. Favor verificar +informeIrregularidadeController.lbMail=E-mail +informeIrregularidadeController.lbMsg=Mensagem +informeIrregularidadeController.mail.enviar=Enviar +informeIrregularidadeController.mail.cancelar=Cancelar +informeIrregularidadeController.mail.configuracoes=Verifique as configurações de email! +informeIrregularidadeController.mail.erro= Falha no envio + # Editar LogConferencia Comissao editarLogConferenciaComissaoController.window.title = Lançamento de Observações editarLogConferenciaComissaoController.lhSituacaoLog.value = Situação diff --git a/web/gui/comissao/conferencia.zul b/web/gui/comissao/conferencia.zul index 674a7e22b..389b952bf 100644 --- a/web/gui/comissao/conferencia.zul +++ b/web/gui/comissao/conferencia.zul @@ -4,93 +4,98 @@ - - - -