From ab332da6a32ee8ad345db95f8398db85cd61cb0d Mon Sep 17 00:00:00 2001 From: rodrigo Date: Tue, 21 Aug 2012 21:50:16 +0000 Subject: [PATCH] git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@20649 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../BusquedaTipoEventoExtraController.java | 101 +-- .../EditarTipoEventoExtraController.java | 745 ++++++++---------- web/WEB-INF/i3-label_pt_BR.label | 2 +- web/gui/ingreso/busquedaIngreso.zul | 126 +-- web/gui/ingreso/editarTipoEventoExtra.zul | 338 ++++---- 5 files changed, 584 insertions(+), 728 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaTipoEventoExtraController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaTipoEventoExtraController.java index 7ada103cc..58ebc7725 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaTipoEventoExtraController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaTipoEventoExtraController.java @@ -5,7 +5,6 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.ingreso; * and open the template in the editor. */ import java.util.HashMap; -import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -20,9 +19,7 @@ import org.zkoss.zul.Combobox; import org.zkoss.zul.Paging; import org.zkoss.zul.Textbox; -import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; -import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; @@ -37,91 +34,16 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoEventoExtra @Scope("prototype") public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer { + private static final long serialVersionUID = 1L; @Autowired private transient PagedListWrapper plwTipoEventoExtra; - @Autowired - private EmpresaService empresaService; - private List lsEmpresa; private MyListbox tipoEventoExtraList; private Paging pagingTipoEventoExtra; - // private Intbox idTipoEventoExtra; private Textbox txtNombre; private Combobox cmbIndOperacion; - public Combobox getCmbIndOperacion() { - return cmbIndOperacion; - } - - public void setCmbIndOperacion(Combobox cmbIndOperacion) { - this.cmbIndOperacion = cmbIndOperacion; - } - - public MyListbox getTipoEventoExtraList() { - return tipoEventoExtraList; - } - - public void setTipoEventoExtraList(MyListbox tipoEventoExtraList) { - this.tipoEventoExtraList = tipoEventoExtraList; - } - - public Paging getPagingTipoEventoExtra() { - return pagingTipoEventoExtra; - } - - public void setPagingTipoEventoExtra(Paging pagingTipoEventoExtra) { - this.pagingTipoEventoExtra = pagingTipoEventoExtra; - } - - public PagedListWrapper getPlwTipoEventoExtra() { - return plwTipoEventoExtra; - } - - public void setPlwTipoEventoExtra( - PagedListWrapper plwTipoEventoExtra) { - this.plwTipoEventoExtra = plwTipoEventoExtra; - } - - public Textbox getTxtNombre() { - return txtNombre; - } - - public void setTxtNombre(Textbox txtNombre) { - this.txtNombre = txtNombre; - } - - public void onClick$btnPesquisa(Event ev) throws InterruptedException { - refreshLista(); - } - - public void onClick$btnRefresh(Event ev) { - refreshLista(); - } - - public void onClick$btnNovo(Event ev) { - verPeriodo(new TipoEventoExtra()); - } - - public EmpresaService getEmpresaService() { - return empresaService; - } - - public void setEmpresaService(EmpresaService empresaService) { - this.empresaService = empresaService; - } - - public List getLsEmpresa() { - return lsEmpresa; - } - - public void setLsEmpresa(List lsEmpresa) { - this.lsEmpresa = lsEmpresa; - } - @Override public void doAfterCompose(Component comp) throws Exception { - - lsEmpresa = empresaService.buscarTodosExceto(-1); - super.doAfterCompose(comp); tipoEventoExtraList.setItemRenderer(new RenderTipoEventoExtra()); @@ -141,6 +63,7 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer txtNombre.focus(); } + @SuppressWarnings({ "rawtypes", "unchecked" }) private void verPeriodo(TipoEventoExtra emp) { if (emp == null) { return; @@ -157,15 +80,17 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer } private void refreshLista() { - HibernateSearchObject tipoEventoExtraBusqueda = new HibernateSearchObject(TipoEventoExtra.class, pagingTipoEventoExtra.getPageSize()); + HibernateSearchObject tipoEventoExtraBusqueda = + new HibernateSearchObject(TipoEventoExtra.class, + pagingTipoEventoExtra.getPageSize()); tipoEventoExtraBusqueda.addFilterLike("descTipoEvento", "%" + txtNombre.getText().trim().concat("%")); if (cmbIndOperacion.getSelectedItem() != null) { - tipoEventoExtraBusqueda.addFilterEqual("indoperacion", Short.parseShort(cmbIndOperacion.getSelectedItem().getValue().toString())); + tipoEventoExtraBusqueda.addFilterEqual("indoperacion", + Short.parseShort(cmbIndOperacion.getSelectedItem().getValue().toString())); } tipoEventoExtraBusqueda.addFilterEqual("activo", Boolean.TRUE); tipoEventoExtraBusqueda.addSortAsc("descTipoEvento"); - plwTipoEventoExtra.init(tipoEventoExtraBusqueda, tipoEventoExtraList, pagingTipoEventoExtra); @@ -179,4 +104,16 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer } } } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new TipoEventoExtra()); + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarTipoEventoExtraController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarTipoEventoExtraController.java index 0a160e413..4ebe9bc50 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarTipoEventoExtraController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarTipoEventoExtraController.java @@ -22,7 +22,6 @@ import org.zkoss.zul.Button; import org.zkoss.zul.Checkbox; import org.zkoss.zul.Combobox; import org.zkoss.zul.Messagebox; -import org.zkoss.zul.Radio; import org.zkoss.zul.Radiogroup; import org.zkoss.zul.Row; import org.zkoss.zul.Textbox; @@ -33,7 +32,6 @@ import com.rjconsultores.ventaboletos.entidad.ParamArticulo; import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; import com.rjconsultores.ventaboletos.exception.BusinessException; import com.rjconsultores.ventaboletos.service.ArticuloService; -import com.rjconsultores.ventaboletos.service.EventoExtraService; import com.rjconsultores.ventaboletos.service.FormaPagoService; import com.rjconsultores.ventaboletos.service.ParamArticuloService; import com.rjconsultores.ventaboletos.service.TipoEventoExtraService; @@ -51,459 +49,366 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; @Scope("prototype") public class EditarTipoEventoExtraController extends MyGenericForwardComposer { - @Autowired - private TipoEventoExtraService tipoEventoExtraService; - @Autowired - private ArticuloService articuloService; - @Autowired - private FormaPagoService formaPagoService; - @Autowired - private ParamArticuloService paramArticuloService; - @Autowired - private EventoExtraService eventoExtraService; - private List lsArticulo; - private List lsFormaPago; - private List lsParamArticulo; - private TipoEventoExtra tipoEventoExtra; - private MyListbox tipoEventoExtraList; - private static Logger log = Logger.getLogger(EditarTipoEventoExtraController.class); - private MyTextbox txtNome; - private Button btnApagar; - private Textbox impMax; - private Textbox porcIva; - private Radio boletoSi; - private Radio ajusteSi; - private Radio boletoNo; - private Radio ajusteNo; - private Checkbox cbValidaCorte; - private Checkbox cbValidaDocumento; - private Checkbox cbContrapartida; - private Checkbox cbOrdenServicio; - private Checkbox cbBoleto; - private Combobox cmbIndOperacion; - private Combobox cmbFormaPago2; - private Combobox cmbParamArticulo; - private Combobox cmbParamArticulo2; - private Radiogroup sv1; - private Radiogroup sv2; - private Row rowParamArticulo; - private Row rowParamArticulo2; - - public Radiogroup getSv1() { - return sv1; - } - - public void setSv1(Radiogroup sv1) { - this.sv1 = sv1; - } - - public Radiogroup getSv2() { - return sv2; - } - - public void setSv2(Radiogroup sv2) { - this.sv2 = sv2; - } - - public List getLsParamArticulo() { - return lsParamArticulo; - } - - public void setLsParamArticulo(List lsParamArticulo) { - this.lsParamArticulo = lsParamArticulo; - } - - public Combobox getCmbParamArticulo() { - return cmbParamArticulo; - } - - public void setCmbParamArticulo(Combobox cmbParamArticulo) { - this.cmbParamArticulo = cmbParamArticulo; - } - - public Combobox getCmbParamArticulo2() { - return cmbParamArticulo2; - } - - public void setCmbParamArticulo2(Combobox cmbParamArticulo2) { - this.cmbParamArticulo2 = cmbParamArticulo2; - } - - public Combobox getCmbFormaPago2() { - return cmbFormaPago2; - } - - public void setCmbFormaPago2(Combobox cmbFormaPago2) { - this.cmbFormaPago2 = cmbFormaPago2; - } - private Combobox cmbFormaPago; - - public TipoEventoExtra getTipoEventoExtra() { - return tipoEventoExtra; - } - - public void setTipoEventoExtra(TipoEventoExtra tipoEventoExtra) { - this.tipoEventoExtra = tipoEventoExtra; - } - - public MyListbox getTipoEventoExtraList() { - return tipoEventoExtraList; - } - - public void setTipoEventoExtraList(MyListbox tipoEventoExtraList) { - this.tipoEventoExtraList = tipoEventoExtraList; - } - - public TipoEventoExtraService getTipoEventoExtraService() { - return tipoEventoExtraService; - } - - public void setTipoEventoExtraService(TipoEventoExtraService tipoEventoExtraService) { - this.tipoEventoExtraService = tipoEventoExtraService; - } - - public Button getBtnApagar() { - return btnApagar; - } - - public void setBtnApagar(Button btnApagar) { - this.btnApagar = btnApagar; - } - - public static Logger getLog() { - return log; - } - - public static void setLog(Logger log) { - EditarTipoEventoExtraController.log = log; - } - - public MyTextbox getTxtNome() { - return txtNome; - } - - public void setTxtNome(MyTextbox txtNome) { - this.txtNome = txtNome; - } - - public ArticuloService getArticuloService() { - return articuloService; - } - - public void setArticuloService(ArticuloService articuloService) { - this.articuloService = articuloService; - } - - public FormaPagoService getFormaPagoService() { - return formaPagoService; - } + private static final long serialVersionUID = 1L; + @Autowired + private TipoEventoExtraService tipoEventoExtraService; + @Autowired + private ArticuloService articuloService; + @Autowired + private FormaPagoService formaPagoService; + @Autowired + private ParamArticuloService paramArticuloService; + private List lsArticulo; + private List lsFormaPago; + private List lsParamArticulo; + private TipoEventoExtra tipoEventoExtra; + private MyListbox tipoEventoExtraList; + private MyTextbox txtNome; + private Button btnApagar; + private Textbox impMax; + private Textbox porcIva; + private Checkbox cbValidaCorte; + private Checkbox cbValidaDocumento; + private Checkbox cbContrapartida; + private Checkbox cbOrdenServicio; + private Checkbox cbBoleto; + private Combobox cmbIndOperacion; + private Combobox cmbFormaPago2; + private Combobox cmbParamArticulo; + private Combobox cmbParamArticulo2; + private Combobox cmbFormaPago; + private Radiogroup sv1; + private Radiogroup sv2; + private Row rowParamArticulo; + private Row rowParamArticulo2; + private static Logger log = Logger.getLogger(EditarTipoEventoExtraController.class); + + public List getLsParamArticulo() { + return lsParamArticulo; + } + + public void setLsParamArticulo(List lsParamArticulo) { + this.lsParamArticulo = lsParamArticulo; + } + + public TipoEventoExtra getTipoEventoExtra() { + return tipoEventoExtra; + } + + public void setTipoEventoExtra(TipoEventoExtra tipoEventoExtra) { + this.tipoEventoExtra = tipoEventoExtra; + } + + public List getLsArticulo() { + return lsArticulo; + } + + public void setLsArticulo(List lsArticulo) { + this.lsArticulo = lsArticulo; + } + + public List getLsFormaPago() { + return lsFormaPago; + } + + public void setLsFormaPago(List lsFormaPago) { + this.lsFormaPago = lsFormaPago; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsArticulo = articuloService.obtenerTodos(); + lsFormaPago = formaPagoService.obtenerTodos(); + lsParamArticulo = paramArticuloService.obtenerTodos(); + + super.doAfterCompose(comp); + + tipoEventoExtra = (TipoEventoExtra) Executions.getCurrent().getArg().get("tipoEventoExtra"); + tipoEventoExtraList = (MyListbox) Executions.getCurrent().getArg().get("tipoEventoExtraList"); + + if (tipoEventoExtra.getTipoeventoextraId() != null) { + cbContrapartida.setChecked(tipoEventoExtra.getIndcontrapartida()); + cbOrdenServicio.setChecked(tipoEventoExtra.getIndordenservicio()); + cbValidaCorte.setChecked(tipoEventoExtra.getIndvalidacorte()); + cbValidaDocumento.setChecked(tipoEventoExtra.getIndvalidadocumento()); + if (tipoEventoExtra.getIndboleto() == Boolean.TRUE) { + cbBoleto.setChecked(true); + } + + onChange$cmbIndOperacion(null); + + if (tipoEventoExtra.getIndtipo() != null) { + if (tipoEventoExtra.getIndtipo().equals("0")) { + sv1.setSelectedIndex(1); + } else { + sv1.setSelectedIndex(0); + } + } + + if (tipoEventoExtra.getIndtipo2() != null) { + if (tipoEventoExtra.getIndtipo2().equals("0")) { + sv2.setSelectedIndex(1); + } else { + sv2.setSelectedIndex(0); + } + } + } else { + btnApagar.setVisible(false); + } - public void setFormaPagoService(FormaPagoService formaPagoService) { - this.formaPagoService = formaPagoService; - } + // Sino es para exhibir la cuenta contable, no dejo las lines visibles. + if (!exhibirCuentaContable()) { + rowParamArticulo.setVisible(false); + rowParamArticulo2.setVisible(false); - public List getLsArticulo() { - return lsArticulo; - } + cmbParamArticulo.setConstraint(""); + } - public void setLsArticulo(List lsArticulo) { - this.lsArticulo = lsArticulo; - } + txtNome.focus(); + } - public List getLsFormaPago() { - return lsFormaPago; - } + public void onChange$cmbIndOperacion(Event ev) throws InterruptedException { + if (tipoEventoExtra.getIndoperacion() != null) { + sv1.setSelectedIndex(-1); + sv2.setSelectedIndex(-1); + if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("1"))) { + cbValidaCorte.setDisabled(true); + cbValidaCorte.setChecked(false); - public void setLsFormaPago(List lsFormaPago) { - this.lsFormaPago = lsFormaPago; - } + cbValidaDocumento.setDisabled(false); - @Override - public void doAfterCompose(Component comp) throws Exception { + cbContrapartida.setDisabled(true); + cbContrapartida.setChecked(false); - lsArticulo = articuloService.obtenerTodos(); - lsFormaPago = formaPagoService.obtenerTodos(); - lsParamArticulo = paramArticuloService.obtenerTodos(); + cbBoleto.setDisabled(false); - super.doAfterCompose(comp); + cbOrdenServicio.setDisabled(true); + cbOrdenServicio.setChecked(false); - tipoEventoExtra = (TipoEventoExtra) Executions.getCurrent().getArg().get("tipoEventoExtra"); - tipoEventoExtraList = (MyListbox) Executions.getCurrent().getArg().get("tipoEventoExtraList"); + BindingListModel listModelCiudad = new BindingListModelList(new ArrayList(), true); + cmbFormaPago2.setModel(listModelCiudad); - if (tipoEventoExtra.getTipoeventoextraId() != null) { - cbContrapartida.setChecked(tipoEventoExtra.getIndcontrapartida()); - cbOrdenServicio.setChecked(tipoEventoExtra.getIndordenservicio()); - cbValidaCorte.setChecked(tipoEventoExtra.getIndvalidacorte()); - cbValidaDocumento.setChecked(tipoEventoExtra.getIndvalidadocumento()); - if (tipoEventoExtra.getIndboleto() == Boolean.TRUE) { - cbBoleto.setChecked(true); - } + cmbFormaPago2.setDisabled(true); - onChange$cmbIndOperacion(null); + cmbFormaPago2.setSelectedItem(null); - if (tipoEventoExtra.getIndtipo() != null) { - if (tipoEventoExtra.getIndtipo().equals("0")) { - sv1.setSelectedIndex(1); - } else { - sv1.setSelectedIndex(0); - } - } + BindingListModel listModelParmArticulo = new BindingListModelList(new ArrayList(), true); + cmbParamArticulo2.setModel(listModelParmArticulo); - if (tipoEventoExtra.getIndtipo2() != null) { - if (tipoEventoExtra.getIndtipo2().equals("0")) { - sv2.setSelectedIndex(1); - } else { - sv2.setSelectedIndex(0); - } - } - } else { - btnApagar.setVisible(false); - } + cmbParamArticulo2.setDisabled(true); - // Sino es para exhibir la cuenta contable, no dejo las lines visibles. - if (!exhibirCuentaContable()) { - rowParamArticulo.setVisible(false); - rowParamArticulo2.setVisible(false); + cmbParamArticulo2.setSelectedItem(null); - cmbParamArticulo.setConstraint(""); - } + } else if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("2"))) { - txtNome.focus(); + cbValidaCorte.setDisabled(true); + cbValidaCorte.setChecked(true); - } + cbValidaDocumento.setDisabled(false); - public void onChange$cmbIndOperacion(Event ev) throws InterruptedException { - if (tipoEventoExtra.getIndoperacion() != null) { - sv1.setSelectedIndex(-1); - sv2.setSelectedIndex(-1); - if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("1"))) { - cbValidaCorte.setDisabled(true); - cbValidaCorte.setChecked(false); + cbContrapartida.setDisabled(true); + cbContrapartida.setChecked(true); - cbValidaDocumento.setDisabled(false); + cbBoleto.setDisabled(true); + cbBoleto.setChecked(false); - cbContrapartida.setDisabled(true); - cbContrapartida.setChecked(false); + cbOrdenServicio.setDisabled(false); - cbBoleto.setDisabled(false); + BindingListModel listModelCiudad = new BindingListModelList(lsFormaPago, true); + cmbFormaPago2.setModel(listModelCiudad); + cmbFormaPago2.setDisabled(false); - cbOrdenServicio.setDisabled(true); - cbOrdenServicio.setChecked(false); + BindingListModel listModelParmArticulo = new BindingListModelList(lsParamArticulo, true); + cmbParamArticulo2.setModel(listModelParmArticulo); - BindingListModel listModelCiudad = new BindingListModelList(new ArrayList(), true); - cmbFormaPago2.setModel(listModelCiudad); + cmbParamArticulo2.setDisabled(false); - cmbFormaPago2.setDisabled(true); + cmbParamArticulo2.setSelectedItem(null); - cmbFormaPago2.setSelectedItem(null); + } else if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("3"))) { + + cbValidaCorte.setDisabled(true); + cbValidaCorte.setChecked(false); + + cbValidaDocumento.setChecked(true); + cbValidaDocumento.setDisabled(true); - BindingListModel listModelParmArticulo = new BindingListModelList(new ArrayList(), true); - cmbParamArticulo2.setModel(listModelParmArticulo); + cbContrapartida.setDisabled(true); + cbContrapartida.setChecked(true); - cmbParamArticulo2.setDisabled(true); + cbBoleto.setDisabled(true); + cbBoleto.setChecked(false); + + cbOrdenServicio.setDisabled(true); + cbOrdenServicio.setChecked(false); - cmbParamArticulo2.setSelectedItem(null); + BindingListModel listModelCiudad = new BindingListModelList(lsFormaPago, true); + cmbFormaPago2.setModel(listModelCiudad); - } else if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("2"))) { + cmbFormaPago2.setDisabled(false); - cbValidaCorte.setDisabled(true); - cbValidaCorte.setChecked(true); + BindingListModel listModelParmArticulo = new BindingListModelList(lsParamArticulo, true); + cmbParamArticulo2.setModel(listModelParmArticulo); - cbValidaDocumento.setDisabled(false); + cmbParamArticulo2.setDisabled(false); - cbContrapartida.setDisabled(true); - cbContrapartida.setChecked(true); + cmbParamArticulo2.setSelectedItem(null); + } + } + } - cbBoleto.setDisabled(true); - cbBoleto.setChecked(false); + public void onClick$btnSalvar(Event ev) throws InterruptedException { - cbOrdenServicio.setDisabled(false); + txtNome.getValue(); + impMax.getValue(); + cmbIndOperacion.getValue(); + porcIva.getValue(); + cmbFormaPago.getValue(); + cmbParamArticulo.getValue(); - BindingListModel listModelCiudad = new BindingListModelList(lsFormaPago, true); - cmbFormaPago2.setModel(listModelCiudad); - cmbFormaPago2.setDisabled(false); + if (sv1.getSelectedIndex() == -1) { + Messagebox.show(Labels.getLabel("MSG.necesita.tipoEvento"), + Labels.getLabel("editarTipoEventoExtraController.MSG.tipoObligatolia"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } - BindingListModel listModelParmArticulo = new BindingListModelList(lsParamArticulo, true); - cmbParamArticulo2.setModel(listModelParmArticulo); + try { - cmbParamArticulo2.setDisabled(false); - - cmbParamArticulo2.setSelectedItem(null); - - } else if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("3"))) { - - cbValidaCorte.setDisabled(true); - cbValidaCorte.setChecked(false); - - cbValidaDocumento.setChecked(true); - cbValidaDocumento.setDisabled(true); - - cbContrapartida.setDisabled(true); - cbContrapartida.setChecked(true); - - cbBoleto.setDisabled(true); - cbBoleto.setChecked(false); - - cbOrdenServicio.setDisabled(true); - cbOrdenServicio.setChecked(false); - - BindingListModel listModelCiudad = new BindingListModelList(lsFormaPago, true); - cmbFormaPago2.setModel(listModelCiudad); - - cmbFormaPago2.setDisabled(false); - - BindingListModel listModelParmArticulo = new BindingListModelList(lsParamArticulo, true); - cmbParamArticulo2.setModel(listModelParmArticulo); - - cmbParamArticulo2.setDisabled(false); - - cmbParamArticulo2.setSelectedItem(null); - } - } - } - - public void onClick$btnSalvar(Event ev) throws InterruptedException { - - txtNome.getValue(); - impMax.getValue(); - cmbIndOperacion.getValue(); - porcIva.getValue(); - cmbFormaPago.getValue(); - cmbParamArticulo.getValue(); - - if (sv1.getSelectedIndex() == -1) { - Messagebox.show(Labels.getLabel("MSG.necesita.tipoEvento"), Labels.getLabel("editarTipoEventoExtraController.MSG.tipoObligatolia"), Messagebox.OK, - Messagebox.EXCLAMATION); - return; - } - - try { - - if (!cmbFormaPago2.isDisabled() && cmbFormaPago2.getSelectedItem() == null) { - Messagebox.show(Labels.getLabel("MSG.necesita.formaPago"), Labels.getLabel("editarTipoEventoExtraController.MSG.formaPagoObligatolia"), Messagebox.OK, - Messagebox.EXCLAMATION); - return; - } - - if (exhibirCuentaContable()) { - if (cmbIndOperacion.getSelectedItem() != null) { - String indOp = (String) cmbIndOperacion.getSelectedItem().getValue(); - if (!cmbParamArticulo2.isDisabled() && indOp.equals("3")) { - if (cmbParamArticulo2.getSelectedItem() == null) { - Messagebox.show(Labels.getLabel("MSG.necesita.contaContable"), Labels.getLabel("editarTarjetaViajeController.MSG.cuentaContableObligatorio"), - Messagebox.OK, Messagebox.EXCLAMATION); - return; - } - } - } - } - - tipoEventoExtra.setActivo(Boolean.TRUE); - tipoEventoExtra.setFecmodif(Calendar.getInstance().getTime()); - tipoEventoExtra.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); - - List lsTipoEventoExtra = tipoEventoExtraService.buscar(tipoEventoExtra.getDescTipoEvento()); - boolean podeSalvar = false; - if (lsTipoEventoExtra.isEmpty()) { - podeSalvar = true; - } else { - for (TipoEventoExtra b : lsTipoEventoExtra) { - if (b.getTipoeventoextraId().equals(tipoEventoExtra.getTipoeventoextraId())) { - podeSalvar = true; - } - } - } - if (!podeSalvar) { - Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); - return; - } else { - - if (sv1.getSelectedIndex() == 0) { - tipoEventoExtra.setIndtipo("1"); - } else { - tipoEventoExtra.setIndtipo("0"); - } - - if (sv2.getSelectedIndex() == -1) { - tipoEventoExtra.setIndtipo2(null); - } else if (sv2.getSelectedIndex() == 0) { - tipoEventoExtra.setIndtipo2("1"); - } else { - tipoEventoExtra.setIndtipo2("0"); - } - - tipoEventoExtra.setFormaPago((FormaPago) cmbFormaPago.getSelectedItem().getValue()); - - tipoEventoExtra.setIndvalidacorte(cbValidaCorte.isChecked()); - tipoEventoExtra.setIndvalidadocumento(cbValidaDocumento.isChecked()); - tipoEventoExtra.setIndcontrapartida(cbContrapartida.isChecked()); - tipoEventoExtra.setIndordenservicio(cbOrdenServicio.isChecked()); - tipoEventoExtra.setIndboleto(cbBoleto.isChecked() ? Boolean.TRUE : Boolean.FALSE); - - tipoEventoExtra.setParamArticulo(cmbParamArticulo.getSelectedItem() == null ? null : (ParamArticulo) cmbParamArticulo.getSelectedItem().getValue()); - tipoEventoExtra.setParamArticulo2(cmbParamArticulo2.getSelectedItem() == null ? null : (ParamArticulo) cmbParamArticulo2.getSelectedItem().getValue()); - - if (tipoEventoExtra.getTipoeventoextraId() == null) { - tipoEventoExtraService.suscribir(tipoEventoExtra); - tipoEventoExtraList.addItem(tipoEventoExtra); - } else { - tipoEventoExtraService.actualizacion(tipoEventoExtra); - tipoEventoExtraList.updateItem(tipoEventoExtra); - } - } - - Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.suscribirOK"), Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, - Messagebox.INFORMATION); - - closeWindow(); - - } catch (Exception ex) { - log.error("editarTipoEventoExtraController: " + ex); - Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, Messagebox.ERROR); - } - } - - public void onCheck$sv1(Event ev) { - String indOperacion = null; - if (cmbIndOperacion.getSelectedItem() != null) { - indOperacion = (String) cmbIndOperacion.getSelectedItem().getValue(); - } else { - return; - } - if (!indOperacion.equals("1")) { - if (sv1.getSelectedIndex() == 0) { - sv2.setSelectedIndex(1); - } else { - sv2.setSelectedIndex(0); - } - } - } - - public void onClick$btnApagar(Event ev) throws InterruptedException { - try { - int resp = Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.borrarPergunta"), - Labels.getLabel("editarTipoEventoExtraController.window.title"), - Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); - - if (resp == Messagebox.YES) { - tipoEventoExtraService.borrar(tipoEventoExtra); - - Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.borrarOK"), - Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, - Messagebox.INFORMATION); - - tipoEventoExtraList.removeItem(tipoEventoExtra); - - closeWindow(); - } - - } catch (BusinessException ex) { - Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, - Messagebox.INFORMATION); - } - } - - private boolean exhibirCuentaContable() { - return ApplicationProperties.getInstance().exhibirCuentaContableTiposEventos(); - } + if (!cmbFormaPago2.isDisabled() && cmbFormaPago2.getSelectedItem() == null) { + Messagebox.show(Labels.getLabel("MSG.necesita.formaPago"), + Labels.getLabel("editarTipoEventoExtraController.MSG.formaPagoObligatolia"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + if (exhibirCuentaContable()) { + if (cmbIndOperacion.getSelectedItem() != null) { + String indOp = (String) cmbIndOperacion.getSelectedItem().getValue(); + if (!cmbParamArticulo2.isDisabled() && indOp.equals("3")) { + if (cmbParamArticulo2.getSelectedItem() == null) { + Messagebox.show(Labels.getLabel("MSG.necesita.contaContable"), + Labels.getLabel("editarTarjetaViajeController.MSG.cuentaContableObligatorio"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } + } + } + + tipoEventoExtra.setActivo(Boolean.TRUE); + tipoEventoExtra.setFecmodif(Calendar.getInstance().getTime()); + tipoEventoExtra.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoEventoExtra = tipoEventoExtraService.buscar(tipoEventoExtra.getDescTipoEvento()); + boolean podeSalvar = false; + if (lsTipoEventoExtra.isEmpty()) { + podeSalvar = true; + } else { + for (TipoEventoExtra b : lsTipoEventoExtra) { + if (b.getTipoeventoextraId().equals(tipoEventoExtra.getTipoeventoextraId())) { + podeSalvar = true; + } + } + } + if (!podeSalvar) { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoEventoExtraController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } else { + + if (sv1.getSelectedIndex() == 0) { + tipoEventoExtra.setIndtipo("1"); + } else { + tipoEventoExtra.setIndtipo("0"); + } + + if (sv2.getSelectedIndex() == -1) { + tipoEventoExtra.setIndtipo2(null); + } else if (sv2.getSelectedIndex() == 0) { + tipoEventoExtra.setIndtipo2("1"); + } else { + tipoEventoExtra.setIndtipo2("0"); + } + + tipoEventoExtra.setFormaPago((FormaPago) cmbFormaPago.getSelectedItem().getValue()); + + tipoEventoExtra.setIndvalidacorte(cbValidaCorte.isChecked()); + tipoEventoExtra.setIndvalidadocumento(cbValidaDocumento.isChecked()); + tipoEventoExtra.setIndcontrapartida(cbContrapartida.isChecked()); + tipoEventoExtra.setIndordenservicio(cbOrdenServicio.isChecked()); + tipoEventoExtra.setIndboleto(cbBoleto.isChecked() ? Boolean.TRUE : Boolean.FALSE); + + tipoEventoExtra.setParamArticulo(cmbParamArticulo.getSelectedItem() == null ? null : (ParamArticulo) cmbParamArticulo.getSelectedItem().getValue()); + tipoEventoExtra.setParamArticulo2(cmbParamArticulo2.getSelectedItem() == null ? null : (ParamArticulo) cmbParamArticulo2.getSelectedItem().getValue()); + + if (tipoEventoExtra.getTipoeventoextraId() == null) { + tipoEventoExtraService.suscribir(tipoEventoExtra); + tipoEventoExtraList.addItem(tipoEventoExtra); + } else { + tipoEventoExtraService.actualizacion(tipoEventoExtra); + tipoEventoExtraList.updateItem(tipoEventoExtra); + } + } + + Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.suscribirOK"), + Labels.getLabel("editarTipoEventoExtraController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } catch (Exception ex) { + log.error("editarTipoEventoExtraController: " + ex); + Messagebox.show(Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoEventoExtraController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onCheck$sv1(Event ev) { + String indOperacion = null; + if (cmbIndOperacion.getSelectedItem() != null) { + indOperacion = (String) cmbIndOperacion.getSelectedItem().getValue(); + } else { + return; + } + if (!indOperacion.equals("1")) { + if (sv1.getSelectedIndex() == 0) { + sv2.setSelectedIndex(1); + } else { + sv2.setSelectedIndex(0); + } + } + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoEventoExtraController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + tipoEventoExtraService.borrar(tipoEventoExtra); + + Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.borrarOK"), + Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + tipoEventoExtraList.removeItem(tipoEventoExtra); + + closeWindow(); + } + + } catch (BusinessException ex) { + Messagebox.show(ex.getLocalizedMessage(), + Labels.getLabel("editarTipoEventoExtraController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + private boolean exhibirCuentaContable() { + return ApplicationProperties.getInstance().exhibirCuentaContableTiposEventos(); + } } diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index b0089094b..0d26c0452 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -511,7 +511,7 @@ editarPuntoVentaController.MSG.Achou.FormaPago = Forma de Pagamento já está re editarPuntoVentaController.MSG.Achou.ParamRecoleccion = Parametro para sangria já está registrada. editarPuntoVentaController.MSG.Achou.PtovtaEmpresa = Empresas para Venda já está registrada. editarPuntoVentaController.MSG.Achou.PtovtaUsuario = Empresa já está registrado. -editarPuntoVentaController.tab.label.endereco = Dirección +editarPuntoVentaController.tab.label.endereco = Endereço editarPuntoVentaController.tab.label.recoleccion = Sangria editarPuntoVentaController.tab.label.empVenta = Empresas para Venda editarPuntoVentaController.tab.label.usuBancario = Usuarios bancários diff --git a/web/gui/ingreso/busquedaIngreso.zul b/web/gui/ingreso/busquedaIngreso.zul index 877e80dc9..9909346fc 100644 --- a/web/gui/ingreso/busquedaIngreso.zul +++ b/web/gui/ingreso/busquedaIngreso.zul @@ -5,65 +5,75 @@ - - -