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);
 }
 /**
  * Valida la Cuenta de Captacion
  * @param boolean $ForzarCorreccion
  */
 function setValidar($ForzarCorreccion = false)
 {
     $arrUp = array();
     $DC = $this->getDatosInArray();
     $socio = $this->mSocioTitular;
     $cuenta = $this->mNumeroCuenta;
     $grupo = $this->mGrupoAsociado;
     $sucursal = $DC["sucursal"];
     $user = $DC["idusuario"];
     $oficial = $DC["oficial_de_captacion"];
     $credito = $DC["numero_solicitud"];
     $FApertura = $DC["fecha_apertura"];
     $FAfecta = $DC["fecha_afectacion"];
     //Fecha Valida
     $FechaValida = true;
     $msg = "VALIDAR CUENTA {$cuenta}\r\n";
     //Datos propios de la Inversion
     $FVencInv = $DC["inversion_fecha_vcto"];
     $DiasInv = $DC["dias_invertidos"];
     $TCuenta = $DC["tipo_cuenta"];
     //Cuenta de Intereses
     $CtaInts = $DC["cuenta_de_intereses"];
     //Datos producto
     $xDT = new cInformacionProductoCaptacion($TCuenta);
     $DT = $xDT->init();
     //validar socios
     $xSoc = new cSocio($socio);
     if ($xSoc->existe($socio) == false) {
         $msg .= "CRITICO\tSOCIO\tEl Socio {$socio} no EXISTE \r\n";
         if ($ForzarCorreccion == true) {
             $xSoc->add("SOCIO_CUENTA_{$cuenta}");
             $msg .= "NUEVO\tSOCIO\tAgregado el Socio {$socio}\r\n";
         }
     }
     //validar grupo
     if ($grupo == false or $grupo == 0) {
         $arrUp["numero_grupo"] = DEFAULT_GRUPO;
         $msg .= "ERROR\tGRUPO\tEl Grupo {$grupo} No es Valido, se actualiza al default \r\n";
     } else {
         //Controlar Grupo
         $xGrp = new cGrupo($grupo);
         if ($xGrp->existe($grupo) == false) {
             $msg .= "CRITICO\tGRUPO\tEl Grupo {$grupo} no EXISTE \r\n";
             if ($ForzarCorreccion == true) {
                 $xGrp->add("GRUPO_CUENTA_{$cuenta}", "", false, false, 10, 1, $grupo, $sucursal);
                 $msg .= "NUEVO\tGRUPO\tSe Agrego el Grupo {$grupo} \r\n";
             }
         }
     }
     //Restaurar Credito
     if ($credito != DEFAULT_CREDITO) {
         $arrUp["numero_solicitud"] = DEFAULT_CREDITO;
     }
     //
     //Controlar Usuario
     $xUsr = new cSystemUser($user);
     if ($xUsr->existe($user) == false) {
         $msg .= "CRITICO\tUSUARIO\tEl Usuario {$user} no EXISTE \r\n";
         if ($ForzarCorreccion == true) {
             $xUsr->add("usr{$user}", "", 2, "USR_CTA_{$cuenta}", "", "", "", false, "baja", "", $sucursal, $user);
             $msg .= "NUEVO\tUSUARIO\tSe Agrego el Usuario {$user} \r\n";
         }
     }
     //Controlar Oficial de Captacion
     if ($xUsr->existe($oficial) == false) {
         $msg .= "ERROR\tOFICIAL\tEl Oficial de Captacion {$oficial} no EXISTE \r\n";
         if ($ForzarCorreccion == true) {
             $xUsr->add("usr{$oficial}", "", 2, "OFICIAL_CTA_{$cuenta}", "", "", "", false, "baja", "", $sucursal, $oficial);
             $msg .= "NUEVO\tOFICIAL\tSe Agrego el OFICIAL {$oficial} \r\n";
         }
     }
     if ($FApertura == '0000-00-00') {
         $msg .= "WARN\tLa fecha de Apertura {$FApertura} es INVALIDA\r\n";
         $arrUp["fecha_apertura"] = fechasys();
         $FechaValida = false;
     }
     if ($FAfecta == '0000-00-00') {
         $msg .= "WARN\tLa fecha de Afectacion {$FAfecta} es INVALIDA\r\n";
         $arrUp["fecha_afectacion"] = fechasys();
         $FechaValida = false;
     }
     //Validar las fechas
     if ($FechaValida == true) {
         if (strtotime($FApertura) > strtotime($FAfecta)) {
             $msg .= "WARN\tLa fecha de Apertura {$FApertura} es mayor a la de operaciones {$FAfecta}\r\n";
             $arrUp["fecha_apertura"] = $FAfecta;
         }
     }
     //Validar las funciones del Subproducto
     if ($ForzarCorreccion == true) {
         //Guardar Cambios
         $this->setUpdate($arrUp);
         return $msg;
     }
 }
     $msg .= "ERROR\tEl Nombre de Usuario no puede tener menos de 4 caracteres\r\n";
     $sucess = false;
 }
 if ($nivelacceso >= $_SESSION["SN_d567c9b2d95fbc0a51e94d665abe9da3"]) {
     $msg .= "ERROR\tUsted no Puede Asignar Permisos Mayores a su Nivel\r\n";
     $sucess = false;
 }
 if ($operation == 1 and ($idusuario == 0 or $idusuario == false or $idusuario == "")) {
     $msg .= "ERROR\tNo se Puede Actualizar un USUARIO sin Codigo\r\n";
     $sucess = false;
 }
 if ($sucess == true) {
     switch ($operation) {
         case 0:
             $xUsr = new cSystemUser();
             $xUsr->add($nombreusuario, $contrasenna, $nivelacceso, $nombrecompleto, $apellidopaterno, $apellidomaterno, $puesto, $FechaDeExpiracion, $estatus, "", $sucursal, false, $clavedepersona);
             $msg .= $xUsr->getMessages("txt");
             break;
         case 1:
             $sqlset = "\n\t\t\t\t\tf_34023acbff254d34664f94c3e08d836e='{$contrasenna}',\n\t\t\t\t\tnombres = '{$nombrecompleto}',\n\t\t\t\t\tapellidopaterno = '{$apellidopaterno}',\n\t\t\t\t\tapellidomaterno = '{$apellidomaterno}',\n\t\t\t\t\tpuesto = '{$puesto}',\n\t\t\t\t\tf_f2cd801e90b78ef4dc673a4659c1482d = {$nivelacceso},\n\t\t\t\t\testatus = '{$estatus}',\n\t\t\t\t\tsucursal ='{$sucursal}',\n\t\t\t\t\tdate_expire ='{$FechaDeExpiracion}',\n\t\t\t\t\t`codigo_de_persona` = {$clavedepersona}\n\t\t\t\t\t";
             $sqli = "UPDATE t_03f996214fba4a1d05a68b18fece8e71 SET {$sqlset}\n\t\t\t\t\t\t\t\t\t\tWHERE f_28fb96d57b21090705cfdf8bc3445d2a='{$nombreusuario}' ";
             $inStat = my_query($sqli);
             //exit($sqli);
             if ($inStat["stat"] == false) {
                 $msg .= "ERROR\tERROR EN LA ACTUALIZACION DEL USUARIO; EL SISTEMA DEVOLVIO " . $inStat["error"] . "\r\n ";
             } else {
                 $msg .= "SUCESS\tLA ACTUALIZACION DEL USUARIO SE HA EFECTUADO SATISFACTORIAMENTE\r\n";
             }
             break;
         default:
             $msg .= "ERROR\tNO HA ESTABLECIDO UNA ACCION\r\n";