$xOEmp->dias_de_avisos($dias_aviso);
    $xOEmp->dias_de_liquidacion($dias_pago);
    $xOEmp->dias_de_pago_nomina($dias_nomina);
    $xOEmp->directivo_principal($directivo);
    $xOEmp->clave_de_directivo($iddirectivo);
    $xOEmp->periocidad_de_avisos($periocidad1);
    $xOEmp->oficial_que_cierra($oficial);
    $xOEmp->nombre_corto($alias);
    $xOEmp->producto_preferente($producto);
    $xOEmp->email_de_envio($emails);
    $xOEmp->clave_de_persona($idsocio);
    $xOEmp->query()->update()->save($empresa);
    $xEmp = new cEmpresas($empresa);
    $xEmp->init();
    $xEmp->setActualizarPorPersona();
    $msg .= $xEmp->getMessages();
}
if (setNoMenorQueCero($empresa) > 0) {
    $xEmp = new cEmpresas($empresa);
    $xEmp->init();
    if ($xEmp->isInit() == true) {
        $alias = $xEmp->getNombreCorto();
        //$iddirectivo=
        $iddirectivo = $xEmp->getClaveDeContacto();
        $directivo = $xEmp->getNombreContacto();
        $idsocio = $xEmp->getClaveDePersona();
        $periocidad1 = $xEmp->getPeriocidadPref();
        $lstPeriodos = $xEmp->getListaDePeriocidad();
        $periocidad2 = isset($lstPeriodos[1]) ? $lstPeriodos[1] : $periocidad1;
        $producto = $xEmp->getProductoPref();
        $mails = $xEmp->getEmailsDeEnvio();
function jsaActualizarEmpresa($idempresa)
{
    $xEmp = new cEmpresas($idempresa);
    $xEmp->init();
    $xEmp->setActualizarPorPersona();
    return $xEmp->getMessages(OUT_HTML);
}
 function getValidacion($out = OUT_TXT, $corregir = false)
 {
     $txt = "";
     $cTipo = new cTipos();
     $ready = true;
     $xLog = new cCoreLog();
     $EsOperable = true;
     $xLoc = new cLocal();
     if ($this->mSocioIniciado == false) {
         $this->init();
     }
     //Validar GrupoSolidario
     if ($this->getClaveDeGrupo() > DEFAULT_GRUPO) {
         $xGrupo = new cGrupo($this->getClaveDeGrupo());
         if ($xGrupo->init() == false) {
             $ready = false;
             $xLog->add("ERROR\t" . $this->mCodigo . "\tGRUPO\tEl Grupo " . $this->mGrupoAsociado . " No Existe \r\n");
             if ($corregir == true) {
                 $xGrupo->add("_GRUPO_NO_EXISTENTE_", "_GRUPO_EN_ALTA_POR_CORRECION_SOCIO_" . $this->mCodigo, $this->mCodigo, DEFAULT_SOCIO, 10, 1, $this->mGrupoAsociado);
                 $xLog->add("WARN\t" . $this->mCodigo . "\tGRUPO\tEl Grupo " . $this->mGrupoAsociado . " Ha sido AGREGADO \r\n");
                 $xLog->add($xGrupo->getMessages(), $xLog->DEVELOPER);
             }
         }
     }
     //Validar Caja Local
     if (SISTEMA_CAJASLOCALES_ACTIVA == true) {
         $xCL = new cCajaLocal();
         if ($xCL->init() == false) {
             $xLog->add("ERROR\t" . $this->mCodigo . "\tCAJALOCAL\tLa Caja Local " . $this->mCajaLocal . " No Existe \r\n");
             $ready = false;
         }
     }
     //Validar Dependencias
     if ($this->getClaveDeEmpresa() != DEFAULT_EMPRESA) {
         $xEmp = new cEmpresas($this->getClaveDeEmpresa());
         if ($xEmp->init() == false) {
             $xLog->add("ERROR\t" . $this->mCodigo . "\tDEPENDENCIA_E\tLa Dependencia " . $this->mDependencia . " No Existe \r\n");
             $xLog->add($xEmp->getMessages(), $xLog->DEVELOPER);
             $ready = false;
         }
     }
     //Validar propietario
     if ($this->getClaveDeUsuario() != DEFAULT_USER) {
         $xUsr = new cSystemUser($this->getClaveDeUsuario());
         if ($xUsr->init() == false) {
             $xLog->add("ERROR\t" . $this->mCodigo . "\tPROPIETARIO\tEl Propietario # " . $this->mPropietario . " NO EXISTE \r\n");
             if ($corregir == true) {
                 $xUsr->add("usr" . $this->mPropietario, "", 2, "USUARIO", "AGREGADO", "EN_VERIFICACION", "", false, "baja", "", false, $this->mPropietario);
             }
             $xLog->add($xUsr->getMessages(), $xLog->DEVELOPER);
         }
     }
     //Validar persona Moral
     if ($this->getEsPersonaFisica() == false) {
         if ($this->getORepresentanteLegal() == null) {
             $xLog->add("ERROR\t" . $this->mCodigo . "\tREP_LEGAL\tEl representante legal NO EXISTE \r\n");
             $ready = false;
             $EsOperable = false;
         }
     }
     //Validar Tipo de Ingreso
     $xT = new cPersonasTipoDeIngreso($this->mTipoDeIngreso);
     if ($xT->init() == false) {
         $txt .= "ERROR\t" . $this->mCodigo . "\tTIPO_INGRESO\tLa Dependencia " . $this->mTipoDeIngreso . " No Existe \r\n";
         $ready = false;
     }
     //Validar Actividad Economica
     if ($this->getOActividadEconomica() == null) {
         $ready = false;
         $EsOperable = false;
         $xLog->add("ERROR\t" . $this->mCodigo . "\tACTIVIDAD\tEL Socio NO tiene Registrado alguna ACTIVIDAD ECONOMICA \r\n");
     }
     //Validar Vivienda
     if ($this->getODomicilio() == null) {
         $ready = false;
         $EsOperable = false;
         $xLog->add("ERROR\t" . $this->mCodigo . "\tVIVIENDA\tEL Socio NO tiene Registrado algun DOMICILIO Valido \r\n");
         if ($corregir == true) {
             $codigo_postal = $xLoc->DomicilioCodigoPostal();
             $this->addVivienda("DESCONOCIDO", "POR_REGISTRAR", $codigo_postal);
         }
     } else {
         //TODO: 2014/01/12 Terminar Validacion de codigo postal y busqueda por domicilio aternativo
     }
     //Valida el codigo postal
     /*$sqlDV		= "SELECT idsocios_vivienda, socio_numero, tipo_regimen, calle, numero_exterior, numero_interior, colonia, localidad, estado, municipio, telefono_residencial, telefono_movil, tiempo_residencia, referencia, idusuario, principal, tipo_domicilio, codigo_postal, fecha_alta, codigo, sucursal, eacp, coordenadas_gps
     					    FROM socios_vivienda
     						WHERE socio_numero = " . $this->mCodigo . " ";
     		$rsV		= mysql_query($sqlDV, cnnGeneral() );
     		if($corregir == true){
     			while($rwV	= mysql_fetch_array($rsV) ){
     				$cpostal	= $cTipo->cInt($rwV["codigo_postal"]);
     				$clave		= $rwV["idsocios_vivienda"];
     				if ( strlen($cpostal) < DIGITOS_DE_CODIGO_POSTAL ){
     					$xCl		= new cCajaLocal( $this->mCajaLocal );
     					$xCl->init();
     					$DCL		= $xCl->getDatosInArray();
     					$codigo_postal	= $DCL["codigo_postal"];
     					$sqlUV = "UPDATE socios_vivienda
     						    SET codigo_postal='$codigo_postal'
     						    WHERE idsocios_vivienda=$clave";
     					my_query($sqlUV);
     					$txt	.= "WARN\tCORREC_VIVIENDA\tSe Actualiza el Codigo postal de [$cpostal] a [$codigo_postal] \r\n";
     				}
     			}
     		}*/
     //validar fecha de Ingreso
     /*$mDA		= date("Y", strtotime($this->mFechaDeIngreso) );
     		$mMA		= date("m", strtotime($this->mFechaDeIngreso) );
     		$mAA		= date("d", strtotime($this->mFechaDeIngreso) );
     		$mFValida	= checkdate($mMA, $mAA, $mDA  );
     		if ( $mFValida == false ){
     			$mFSustituta	= EACP_FECHA_DE_CONSTITUCION;
     			$sqlNFI		= "UPDATE socios_general
     							    SET fechaalta=(SELECT fecha_operacion FROM operaciones_recibos WHERE numero_socio = " . $this->mCodigo . " LIMIT 0,1)
     							    WHERE  codigo= " . $this->mCodigo . " ";
     			my_query($sqlNFI);
     			$txt	.= "ERROR\t" . $this->mCodigo . "\tFINGRESO\tLa fecha de Alta no es valida, se Actualiza a la Primera Operacion\r\n";
     
     		}*/
     //Validar modulo de AML
     if (MODULO_AML_ACTIVADO == true) {
         $xAml = new cAMLPersonas($this->getCodigo());
         $xAml->init($this->getCodigo(), $this->getDatosInArray());
         $NRiesgo = $xAml->setAnalizarNivelDeRiesgo();
         if ($this->getNivelDeRiesgo() != $NRiesgo) {
             $ready = false;
             $EsOperable = false;
             $xLog->add("ERROR\t" . $this->mCodigo . "\tRiesgo\tEl riesgo({$NRiesgo}) es diferente al actual(" . $this->getNivelDeRiesgo() . ") \r\n");
             if ($corregir == true) {
                 $this->setActualizarNivelDeRiesgo($NRiesgo, $xAml->getMessages());
             }
         }
         $xLog->add($xAml->getMessages(), $xLog->DEVELOPER);
         //Perfil Transaccional
         $xTrans = new cAMLPersonas_PerfilTransaccional($this->getCodigo());
         if ($xTrans->getNumeroEntradas() <= 0) {
             $ready = false;
             $EsOperable = false;
             $xLog->add("ERROR\t" . $this->mCodigo . "\tPerfilT\tNo existe perfil transaccional \r\n");
         }
     }
     return $xLog->getMessages($out);
 }