@Listen("onClick = button#cfgSave")
 public void cfgSaveClick(MouseEvent event) {
   if (logger.isDebugEnabled()) logger.debug(" cfgSave button event = " + event);
   try {
     Properties config = Util.getConfig(null);
     if (isValidPort(portsToScan.getText())) {
       config.setProperty(Constants.SERIAL_PORTS, portsToScan.getValue());
     } else {
       Messagebox.show(
           "Device ports to scan is invalid. In Linux (pi) '/dev/ttyUSB0,/dev/ttyUSB1,etc', in MS Windows 'COM1,COM2,COM3,etc'");
     }
     if (isValidBaudRate(portBaudRate.getValue())) {
       config.setProperty(Constants.SERIAL_PORT_BAUD, portBaudRate.getValue());
       Util.saveConfig();
     } else {
       Messagebox.show("Device baud rate (speed) must be one of 4800,9600,19200,38400,57600");
     }
     if (NumberUtils.isNumber(cfgWindOffset.getValue())) {
       config.setProperty(Constants.WIND_ZERO_OFFSET, cfgWindOffset.getValue());
       Util.saveConfig();
       // notify others
       producer.sendBody(Constants.WIND_ZERO_ADJUST_CMD + ":" + cfgWindOffset.getValue() + ",");
     } else {
       Messagebox.show("Wind offset must be numeric");
     }
     config.setProperty(Constants.PREFER_RMC, (String) useRmcGroup.getSelectedItem().getValue());
     config.setProperty(
         Constants.DNS_USE_CHOICE, (String) useHomeGroup.getSelectedItem().getValue());
     Util.saveConfig();
   } catch (Exception e) {
     logger.error(e.getMessage(), e);
   }
 }
 public void viewReport() throws Exception {
   try {
     JadwalDosenDAO dao = new JadwalDosenDAOImpl();
     if (cmbNamaDosen.getValue() != null
         && cmbProgdi.getValue() != null
         && !cmbTahun.getSelectedItem().getValue().toString().isEmpty()
         && cmbSemester.getValue() != null) {
       datas =
           dao.getJadwalDosen(
               (Dosen) cmbNamaDosen.getSelectedItem().getValue(),
               (ProgramStudi) cmbProgdi.getSelectedItem().getValue(),
               cmbTahun.getSelectedItem().getValue().toString(),
               Integer.valueOf(cmbSemester.getSelectedItem().getValue().toString()));
       lstData.getItems().clear();
       for (JadwalDosen jd : datas) {
         Listitem item = new Listitem();
         item.setValue(jd);
         item.appendChild(new Listcell(jd.getJam()));
         item.appendChild(new Listcell(jd.getSenin()));
         item.appendChild(new Listcell(jd.getSelasa()));
         item.appendChild(new Listcell(jd.getRabu()));
         item.appendChild(new Listcell(jd.getKamis()));
         item.appendChild(new Listcell(jd.getJumat()));
         item.appendChild(new Listcell(jd.getSabtu()));
         lstData.appendChild(item);
       }
       btnExport.setDisabled(false);
     } else {
       Messagebox.show("Silahkan Input Parameter dengan benar");
       btnExport.setDisabled(true);
     }
   } catch (Exception ex) {
     Messagebox.show("Telah terjadi kesalahan..");
   }
 }
  public static void EditSalaryHead(Event event) {

    System.out.println("****************SubmitClaim Event Called*********");
    try {
      Component salaryHeadWindow = event.getTarget();
      GenericValue userLogin =
          (GenericValue)
              Executions.getCurrent().getDesktop().getSession().getAttribute("userLogin");
      GenericDelegator delegator =
          HrmsInfrastructure.getDelegator(); // GenericDelegator.getGenericDelegator("default");
      LocalDispatcher dispatcher =
          HrmsInfrastructure
              .getDispatcher(); // GenericDispatcher.getLocalDispatcher("default", delegator);
      Map submitUpdate = null;
      String salaryHeadId =
          (String) ((Textbox) salaryHeadWindow.getFellow("salaryHeadId")).getValue();

      String hrName = (String) ((Textbox) salaryHeadWindow.getFellow("applyHrName")).getValue();

      Listitem isCrListItem =
          (Listitem) ((Listbox) salaryHeadWindow.getFellow("applyCredit")).getSelectedItem();
      String isCr = (String) isCrListItem.getValue();

      Listitem salaryHeadTypeIdListItem =
          (Listitem)
              ((Listbox) salaryHeadWindow.getFellow("applySalaryHeadType")).getSelectedItem();
      String salaryHeadTypeId = (String) salaryHeadTypeIdListItem.getValue();

      /*
       * String geoId = (String) ((Bandbox) salaryHeadWindow
       * .getFellow("searchPanel")).getValue();
       */
      Combobox countryBox = ((Combobox) salaryHeadWindow.getFellow("countrybandbox"));
      String geoId =
          (String)
              (countryBox.getSelectedItem() == null
                  ? countryBox.getValue()
                  : countryBox.getSelectedItem().getValue());

      Listitem isTaxableListItem =
          (Listitem) ((Listbox) salaryHeadWindow.getFellow("applyTaxable")).getSelectedItem();
      String isTaxable = (String) isTaxableListItem.getValue();

      Listitem isMandatoryListItem =
          (Listitem) ((Listbox) salaryHeadWindow.getFellow("applyMandatory")).getSelectedItem();
      String isMandatory = (String) isMandatoryListItem.getValue();

      Listitem currencyUomIdListItem =
          (Listitem) ((Listbox) salaryHeadWindow.getFellow("applyCurrencyUomId")).getSelectedItem();
      String currencyUomId = (String) currencyUomIdListItem.getValue();

      Listitem salaryComputationTypeIdListItem =
          (Listitem)
              ((Listbox) salaryHeadWindow.getFellow("applyComputationType")).getSelectedItem();
      String salaryComputationTypeId = (String) salaryComputationTypeIdListItem.getValue();

      submitUpdate =
          UtilMisc.toMap(
              "userLogin",
              userLogin,
              "salaryHeadId",
              salaryHeadId,
              "hrName",
              hrName,
              "isCr",
              isCr,
              "salaryHeadTypeId",
              salaryHeadTypeId,
              "geoId",
              geoId,
              "isTaxable",
              isTaxable,
              "isMandatory",
              isMandatory,
              "currencyUomId",
              currencyUomId,
              "salaryComputationTypeId",
              salaryComputationTypeId);

      Map<String, Object> result = dispatcher.runSync("updateSalaryHead", submitUpdate);

      Messagebox messageBox = new Messagebox();
      String err = "";
      err = (String) result.get("responseMessage");
      if (err != null && err.equals("error"))
        messageBox.show((String) result.get("errorMessage"), "Error", 1, null);
      else
        messageBox.show(
            "Salary Head" + " " + hrName + " " + "Successfully Updated", "Success", 1, null);

      Events.postEvent(
          "onClick$searchButton", salaryHeadWindow.getPage().getFellow("searchPanel"), null);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 @Command
 @NotifyChange({
   "strCuentaCheques",
   "ctaCheqReadOnly",
   "strNombreCliente",
   "strCodigoBicRecepcion",
   "strCodigoBicEnvio",
   "strCdContratoSicoco",
   "boolOnce",
   "boolDieciseis",
   "strMonedaCbxId",
   "strMonedaCbxValue",
   "boolClienteAAA",
   "boolCuentaActiva",
   "boolMensualidad",
   "boolAnualidad",
   "dateFechaAlta",
   "dateFechaBaja",
   "lblFechaBaja",
   "dateBoxFecha",
   "boolGeneraReporteServicoBtn",
   "clientes",
   "strCdContrato"
 })
 public void showModal(Event evt) {
   Map<String, Object> mapDatos;
   mapDatos = new HashMap<String, Object>();
   logger.debug("this.strCuentaCheques:" + this.cuentaCheques.getValue());
   if (!this.cuentaCheques.getValue().isEmpty()) {
     tgm138Mt101ctrato = new Tgm138Mt101ctrato();
     tgm138Mt101ctrato.setCdCuentaCheques(cuentaCheques.getValue().toUpperCase().trim());
     tgm138Mt101ctrato.setCdMoneda(new Integer(moneda.getValue()));
     tgm138Mt101ctrato.setNbMoneda(monedaCbx.getValue());
     tgm138Mt101ctrato.setCdCodSwRec(codigoBicRecepcion.getValue().toUpperCase().trim());
     tgm138Mt101ctrato.setCdCodSwEnv(codigoBicEnvio.getValue().toUpperCase().trim());
     tgm138Mt101ctrato.setNbEmpresa(nombreCliente.getValue().toUpperCase().trim());
     tgm138Mt101ctrato.setCdTpClienteAaa(
         ((Boolean) clienteAAA.isChecked()).toString().trim().equals("true") ? "1" : "0");
     tgm138Mt101ctrato.setCdContratoSicoco(cdContratoSicoco.getValue());
     tgm138Mt101ctrato.setCdContrato(new Long(cdContrato.getValue().toUpperCase().trim()));
     tgm138Mt101ctrato.setCdMensualidad(
         ((Boolean) mensualidad.isChecked()).toString().trim().equals("true") ? "1" : "0");
     tgm138Mt101ctrato.setCdAnualidad(
         ((Boolean) anualidad.isChecked()).toString().trim().equals("true") ? "1" : "0");
     tgm138Mt101ctrato.setCdIva(new Integer((String) iva.getSelectedItem().getValue()));
     Timestamp timestampFechaAlta = new Timestamp(fechaAlta.getValue().getTime());
     tgm138Mt101ctrato.setFhAlta(timestampFechaAlta);
     tgm138Mt101ctrato.setFhBaja(fechaBaja.getValue() != null ? fechaBaja.getValue() : null);
     mapDatos.put("numeroCuenta", this.cuentaCheques.getValue());
     mapDatos.put("tgm138Mt101ctrato", tgm138Mt101ctrato);
     Window window =
         (Window)
             Executions.createComponents(
                 "/WEB-INF/flows/reporteServicio/reporteServicio.zul", this.getSelf(), mapDatos);
     window.doModal();
   } else {
     Messagebox.show(
         "¡Primero debe de seleccionar el cliente a consultar!",
         "Error",
         Messagebox.OK,
         Messagebox.ERROR);
   }
 }
  @Command
  @NotifyChange({"clientes"})
  public void setCliente(Event evt) {
    clientesBean = new ClientesBean();

    cuentaCheques.clearErrorMessage();
    nombreCliente.clearErrorMessage();
    codigoBicEnvio.clearErrorMessage();
    codigoBicRecepcion.clearErrorMessage();
    cdContratoSicoco.clearErrorMessage();
    errorIva.clearErrorMessage();
    moneda.clearErrorMessage();

    logger.debug("Entrando");
    logger.debug(cuentaCheques.getValue());
    logger.debug(nombreCliente.getValue());
    logger.debug(codigoBicRecepcion.getValue());
    logger.debug(codigoBicEnvio.getValue());
    logger.debug(iva.getSelectedItem() != null ? iva.getSelectedItem().getValue() : "");
    logger.debug(moneda.getValue());
    logger.debug(clienteAAA.isChecked());
    logger.debug(cuentaActiva.isChecked());
    logger.debug(mensualidad.isChecked());
    logger.debug(anualidad.isChecked());
    logger.debug(fechaAlta.getValue());
    logger.debug(cdContratoSicoco.getValue());

    boolean errorGuardar = false;
    if (cuentaCheques.getValue().isEmpty()) {
      cuentaCheques.setErrorMessage("Favor de introducir el Número de Cuenta de Cheques");
      errorGuardar = true;
    } else if (cuentaCheques.getValue().length() < 10) {
      cuentaCheques.setErrorMessage("El Número de Cuenta de Cheques dede ser de 10 digitos");
      errorGuardar = true;
    } else if (!cuentaCheques.getValue().matches(".[0-9]+")) {
      cuentaCheques.setErrorMessage("El Número de Cuenta de Cheques solo debe contener números");
      errorGuardar = true;
    }

    if (codigoBicRecepcion.getValue().isEmpty()) {
      codigoBicRecepcion.setErrorMessage("Favor de introducir el Código BIC de Recepción");
      errorGuardar = true;
    } else if (codigoBicRecepcion.getValue().length() < 11) {
      codigoBicRecepcion.setErrorMessage("El Código BIC de Recepción dede ser de 11 digitos");
      errorGuardar = true;
    } else if (!codigoBicRecepcion.getValue().matches(".[a-zA-Z0-9]+")) {
      codigoBicRecepcion.setErrorMessage(
          "El Código BIC de Recepción solo debe contener números o letras");
      errorGuardar = true;
    }

    if (!codigoBicEnvio.getValue().isEmpty()) {
      if (codigoBicEnvio.getValue().length() < 11) {
        codigoBicEnvio.setErrorMessage("El Código BIC de Envío dede ser de 11 digitos");
        errorGuardar = true;
      } else if (!codigoBicEnvio.getValue().matches(".[a-zA-Z0-9]+")) {
        codigoBicEnvio.setErrorMessage(
            "El Código BIC de Envío solo debe contener números o letras");
        errorGuardar = true;
      }
    }

    if (cdContratoSicoco.getValue().isEmpty()) {
      cdContratoSicoco.setErrorMessage("Favor de introducir el Número de Contrato");
      errorGuardar = true;
    } else if (cdContratoSicoco.getValue().length() < 12) {
      cdContratoSicoco.setErrorMessage("El Número de Contado dede ser de 12 digitos");
      errorGuardar = true;
    } else if (!cdContratoSicoco.getValue().matches(".[0-9]+")) {
      cdContratoSicoco.setErrorMessage("El Número de Contrato solo debe contener números");
      errorGuardar = true;
    }

    if (iva.getSelectedItem() == null
        || iva.getSelectedItem().getValue() == null
        || iva.getSelectedItem().getValue().toString().isEmpty()) {
      errorIva.setErrorMessage("No se ha seleccionado el valor del IVA.");
      errorGuardar = true;
    }

    if (nombreCliente.getValue().isEmpty()) {
      nombreCliente.setErrorMessage("Favor de introducir el nombre del cliente.");
      errorGuardar = true;
    }

    if (monedaCbx.getValue() != null && monedaCbx.getValue().isEmpty()) {
      monedaCbx.setErrorMessage("Favor de seleccionar la moneda");
      errorGuardar = true;
    }

    if (!cuentaActiva.isChecked()) {
      cuentaActiva.setChecked(true);
    }

    if (!errorGuardar) {
      // if(false){
      logger.info("ContratoController: - Metodo: setCliente -- **inicio**");
      tgm138Mt101ctrato = new Tgm138Mt101ctrato();
      tgm138Mt101ctrato.setCdCuentaCheques(cuentaCheques.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setCdMoneda(new Integer(moneda.getValue()));
      tgm138Mt101ctrato.setCdCodSwRec(codigoBicRecepcion.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setCdCodSwEnv(codigoBicEnvio.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setNbEmpresa(nombreCliente.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setCdTpClienteAaa(
          ((Boolean) clienteAAA.isChecked()).toString().trim().equals("true") ? "1" : "0");
      // tgm138Mt101ctrato.setCdContrato(null);
      tgm138Mt101ctrato.setCdContratoSicoco(cdContratoSicoco.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setCdMensualidad(
          ((Boolean) mensualidad.isChecked()).toString().trim().equals("true") ? "1" : "0");
      tgm138Mt101ctrato.setCdAnualidad(
          ((Boolean) anualidad.isChecked()).toString().trim().equals("true") ? "1" : "0");
      tgm138Mt101ctrato.setCdIva(new Integer((String) iva.getSelectedItem().getValue()));
      Timestamp timestampFechaAlta = new Timestamp(fechaAlta.getValue().getTime());
      tgm138Mt101ctrato.setFhAlta(timestampFechaAlta);
      // ((Boolean)this.cuentaActiva.isChecked()).toString().trim()
      if (cuentaCheques.isReadonly()) {
        if (clientesBean.existeCodigoBicRecepcion(tgm138Mt101ctrato) == null) {
          codigoBicRecepcion.setErrorMessage("No existe el código BIC de recepción capturado.");
          errorGuardar = true;
        }
        if (!tgm138Mt101ctrato.getCdCodSwEnv().isEmpty()) {
          if (clientesBean.existeCodigoBicEnvio(tgm138Mt101ctrato) == null) {
            codigoBicEnvio.setErrorMessage("No existe el código BIC de envío capturado.");
            errorGuardar = true;
          }
        }
        if (!errorGuardar) {
          logger.debug("Actualizando cliente");
          clientesBean.actualizarCliente(tgm138Mt101ctrato);
          registraEvento("editó la cuenta " + tgm138Mt101ctrato.getCdCuentaCheques());
          cdContratoSicoco.setValue(null);
          cdContrato.setValue(null);
          cuentaCheques.setValue(null);
          moneda.setValue(null);
          monedaCbx.setValue(null);
          codigoBicRecepcion.setValue(null);
          codigoBicEnvio.setValue(null);
          nombreCliente.setValue(null);
          clienteAAA.setChecked(false);
          mensualidad.setChecked(false);
          anualidad.setChecked(false);
          cuentaActiva.setChecked(false);
          iva.setSelectedItem(null);
          cuentaCheques.setReadonly(false);
          establecerFiltroClientes();

          Messagebox.show(
              "Registro actualizado con exito!!",
              "Confirmación",
              Messagebox.OK,
              Messagebox.INFORMATION);
          this.clientes = this.getAllClientes();
          this.clientesGrid.invalidate();
        }
      } else {
        if (clientesBean.obtieneCuentaCheques(tgm138Mt101ctrato) != null) {
          cuentaCheques.setErrorMessage("El número de cuenta ya tiene servicio.");
          errorGuardar = true;
        }
        if (clientesBean.existeCodigoBicRecepcion(tgm138Mt101ctrato) == null) {
          codigoBicRecepcion.setErrorMessage("No existe el código BIC de recepción capturado.");
          errorGuardar = true;
        }
        if (!tgm138Mt101ctrato.getCdCodSwEnv().isEmpty()) {
          if (clientesBean.existeCodigoBicEnvio(tgm138Mt101ctrato) == null) {
            codigoBicEnvio.setErrorMessage("No existe el código BIC de envío capturado.");
            errorGuardar = true;
          }
        }
        if (!errorGuardar) {

          logger.debug("Registrando nuevo cliente");
          clientesBean.salvarCliente(tgm138Mt101ctrato);
          registraEvento("regsitró la cuenta " + tgm138Mt101ctrato.getCdCuentaCheques());
          cdContratoSicoco.setValue(null);
          cdContrato.setValue(null);
          cuentaCheques.setValue(null);
          moneda.setValue(null);
          monedaCbx.setValue(null);
          codigoBicRecepcion.setValue(null);
          codigoBicEnvio.setValue(null);
          nombreCliente.setValue(null);
          clienteAAA.setChecked(false);
          mensualidad.setChecked(false);
          anualidad.setChecked(false);
          cuentaActiva.setChecked(false);
          iva.setSelectedItem(null);
          cuentaCheques.setReadonly(false);
          Messagebox.show(
              "Registro guardado con exito!!",
              "Confirmación",
              Messagebox.OK,
              Messagebox.INFORMATION);
          this.clientes = this.getAllClientes();
          this.clientesGrid.invalidate();
        }
      }
    }
  }
 public void validar() {
   txtNombre.getValue();
   cmbInstalacion.getValue();
   txtDescripcion.getValue();
   dboxCapacidad.getValue();
 }