Example #1
0
 @Listen("onClick = #btnRemover")
 public void removerItem() {
   if (ltbPedidos.getItemCount() != 0) {
     if (ltbPedidos.getSelectedItems().size() == 1) {
       Listitem listItem = ltbPedidos.getSelectedItem();
       TabDetalles modelo = listItem.getValue();
       int i = listItem.getIndex();
       ltbPedidos.removeItemAt(i);
       listaDetalle.remove(modelo);
       ltbPedidos.renderAll();
       Double cantidad = txtTotal.getValue();
       if (cantidad == null) cantidad = (double) 0;
       txtTotal.setValue(cantidad - modelo.getImpNot());
     } else msj.mensajeAlerta(Mensaje.editarSoloUno);
   } else msj.mensajeAlerta(Mensaje.noHayRegistros);
 }
Example #2
0
 public void limpiarCampos() {
   TabConfigur configuracion = servicioConfiguracion.buscar(1);
   TabEmpresa empresa = servicioEmpresa.buscar(configuracion.getIdEmp());
   txtNumero.setValue(0);
   idEmpresa = empresa.getIDEmp();
   lblNombre.setValue(empresa.getNomEmp());
   lblDireccion.setValue(empresa.getDirEmp());
   lblFax.setValue(empresa.getFaxEmp());
   lblNit.setValue(empresa.getNitEmp());
   lblRif.setValue(empresa.getRifEmp());
   lblTelefono.setValue(empresa.getTelEmp());
   lblElaborado.setValue(nombreUsuarioSesion());
   lblAutorizado.setValue(configuracion.getAutoriza());
   lblRevisado.setValue(configuracion.getRevisa());
   clave = null;
   txtTotal.setValue(null);
   txtNumero.setValue(null);
   txtProveedor.setValue(null);
   lblProveedor.setValue("");
   buscadorClase.settearCampo(null);
   buscadorMoneda.settearCampo(null);
   buscadorTipo.settearCampo(null);
   listaDetalle.clear();
   ltbPedidos.getItems().clear();
   limpiarCamposItem();
 }
Example #3
0
 @Listen("onClick = #btnAgregar")
 public void annadirLista() {
   if (validarItems()) {
     // contador++;
     Double cantidad = txtTotal.getValue();
     if (cantidad == null) cantidad = (double) 0;
     txtTotal.setValue(cantidad + spnImporte.getValue());
     TabDetalles object = new TabDetalles();
     object.setConNot(txtConcepto.getValue());
     object.setRefNot(txtReferencia.getValue());
     object.setMonNot(spnImporte.getValue());
     object.setImpNot(spnImporte.getValue());
     listaDetalle.add(object);
     ltbPedidos.setModel(new ListModelList<TabDetalles>(listaDetalle));
     ltbPedidos.renderAll();
     limpiarCamposItem();
   } else msj.mensajeError(Mensaje.camposVaciosItem);
 }
  public void adicionarProcedimiento(Map<String, Object> pcd) {
    String codigo_cups = (String) pcd.get("codigo_cups");
    String nombre_procedimiento = (String) pcd.get("nombre_procedimiento");

    String codigo_manual = (String) pcd.get("codigo_manual");

    Double valor_defecto = 0D;

    String tipo = lbxTipo_manual.getSelectedItem().getValue().toString();

    if (tipo.equals(IConstantes.TIPO_MANUAL_SOAT)) {
      valor_defecto = (Double) pcd.get("porcentaje_defecto");
    } else if (tipo.equals(IConstantes.TIPO_MANUAL_ISS01)) {
      valor_defecto = (Double) pcd.get("valoriss01_defecto");
    } else if (tipo.equals(IConstantes.TIPO_MANUAL_ISS04)) {
      valor_defecto = (Double) pcd.get("valoriss04_defecto");
    }

    Listitem listitem = new Listitem();
    listitem.setValue(pcd);

    listitem.appendChild(new Listcell());
    listitem.appendChild(new Listcell(codigo_cups));

    Textbox tbxCodigo_manual = new Textbox(codigo_manual != null ? codigo_manual : codigo_cups);
    tbxCodigo_manual.setHflex("1");
    Listcell listcell = new Listcell();
    listcell.appendChild(tbxCodigo_manual);
    listitem.appendChild(listcell);

    Res.cargarAutomatica(tbxCodigo_manual, pcd, "codigo_manual", null);
    pcd.put("codigo_manual", codigo_manual != null ? codigo_manual : codigo_cups);

    Textbox tbxNombre = new Textbox(nombre_procedimiento);
    tbxNombre.setHflex("1");
    tbxNombre.setReadonly(true);
    listcell = new Listcell();
    listcell.appendChild(tbxNombre);
    listitem.appendChild(listcell);

    Double valor = (Double) pcd.get("valor");

    Doublebox dbxValor = new Doublebox();
    dbxValor.setValue(valor != null ? valor : valor_defecto);
    dbxValor.setHflex("1");
    listcell = new Listcell();
    listcell.appendChild(dbxValor);
    listitem.appendChild(listcell);

    Res.cargarAutomatica(dbxValor, pcd, "valor", null);
    pcd.put("valor", valor != null ? valor : valor_defecto);

    String grupo_uvr = (String) pcd.get("grupo_uvr");

    Textbox tbxGrupoUvr = new Textbox(grupo_uvr != null ? grupo_uvr : "");
    tbxGrupoUvr.setHflex("1");
    listcell = new Listcell();
    listcell.appendChild(tbxGrupoUvr);
    listitem.appendChild(listcell);

    Res.cargarAutomatica(tbxGrupoUvr, pcd, "grupo_uvr", null);
    pcd.put("grupo_uvr", grupo_uvr != null ? grupo_uvr : "");

    String nro_cuenta = (String) pcd.get("nro_cuenta");

    Textbox tbxNro_cuenta = new Textbox(nro_cuenta != null ? nro_cuenta : "");
    tbxNro_cuenta.setHflex("1");
    listcell = new Listcell();
    listcell.appendChild(tbxNro_cuenta);
    listitem.appendChild(listcell);

    Res.cargarAutomatica(tbxNro_cuenta, pcd, "nro_cuenta", null);
    pcd.put("nro_cuenta", nro_cuenta != null ? nro_cuenta : "");

    listboxProcedimientos.appendChild(listitem);
  }
 public void validar() {
   txtNombre.getValue();
   cmbInstalacion.getValue();
   txtDescripcion.getValue();
   dboxCapacidad.getValue();
 }