From 630da56865cde96f001fd462a9b6e624c922a46c Mon Sep 17 00:00:00 2001 From: valdevir Date: Thu, 10 Nov 2016 13:36:02 +0000 Subject: [PATCH] fixes bug #8233 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@62509 d1611594-4594-4d17-8e1d-87c2c4800839 --- ...BusquedaConferenciaComissaoController.java | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/BusquedaConferenciaComissaoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/BusquedaConferenciaComissaoController.java index fbde6c789..5e4d4d6cd 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/BusquedaConferenciaComissaoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/comissao/BusquedaConferenciaComissaoController.java @@ -6,7 +6,6 @@ import java.util.Map; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import org.zkoss.util.resource.Labels; @@ -17,8 +16,8 @@ import org.zkoss.zul.Textbox; import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; -import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.web.utilerias.MaskUtil; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @@ -26,15 +25,12 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @Scope("prototype") @Controller("busquedaConferenciaComissaoController") public class BusquedaConferenciaComissaoController extends MyGenericForwardComposer { - + private static Logger log = Logger.getLogger(BusquedaConferenciaComissaoController.class); private static final long serialVersionUID = 1L; // private static final Logger log = LoggerFactory.getLogger(BusquedaConferenciaComissaoController.class); - @Autowired - private EmpresaService empresaService; - private Textbox txtCompetencia; private MyComboboxPuntoVenta cmbPuntoVenta; private PuntoVenta puntoVenta; @@ -45,7 +41,8 @@ public class BusquedaConferenciaComissaoController extends MyGenericForwardCompo public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); aplicarMascara(); - lsEmpresas = empresaService.obtenerTodos(); + // lsEmpresas = empresaService.obtenerTodos(); + lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa(); txtCompetencia.focus(); } @@ -53,30 +50,30 @@ public class BusquedaConferenciaComissaoController extends MyGenericForwardCompo txtCompetencia.getValue(); cmbPuntoVenta.getValue(); try { - - if(verificarCampos()) { + + if (verificarCampos()) { Map args = new HashMap(); args.put("competencia", txtCompetencia.getValue()); args.put("empresa", empresa); - - if(StringUtils.isNotBlank(cmbPuntoVenta.getValue())) { + + if (StringUtils.isNotBlank(cmbPuntoVenta.getValue())) { args.put("puntoVenta", puntoVenta); } - + openWindow("/gui/comissao/conferenciaComissao.zul", Labels.getLabel("conferenciaComissaoController.window.title"), args, MODAL); } - + } catch (Exception e) { log.error(e.getMessage(), e); } } - + private boolean verificarCampos() throws Exception { - if(!DateUtil.isCompetenciaValida(txtCompetencia.getValue())) { + if (!DateUtil.isCompetenciaValida(txtCompetencia.getValue())) { Messagebox.show(Labels.getLabel("MSG.Error.invalida.competencia"), - Labels.getLabel("conferenciaComissaoController.window.title"), - Messagebox.OK, Messagebox.ERROR); + Labels.getLabel("conferenciaComissaoController.window.title"), + Messagebox.OK, Messagebox.ERROR); return false; } return true;