//$xRec		= new cReciboDeOperacion(12);
//$xRec->setGenerarPoliza();
//$xRec->setForceUpdateSaldos();
//$idrecibo	=  $xRec->setNuevoRecibo(1,1,$fechaop, 1, 12, "CIERRE_DE_SEGUIMIENTO", "NA", "ninguno", "NA", DEFAULT_GRUPO);
//$xRec->setNumeroDeRecibo($idrecibo);
$messages .= "=======================================================================================\r\n";
$messages .= "=========================\t\t" . EACP_NAME . " \r\n";
$messages .= "=========================\t\t" . getSucursal() . " \r\n";
$messages .= "=======================================================================================\r\n";
$messages .= "=========================\t\tINICIANDO EL CIERRE DE RIESGOS ===================\r\n";
$messages .= "=========================\t\tRECIBO: {$idrecibo}\t\t\t\t   ====================\r\n";
$messages .= "=======================================================================================\r\n";
if (MODULO_AML_ACTIVADO == true) {
    $mql = new MQL();
    //crear arbol de relaciones
    $xUtils = new cPersonas_utils();
    $xUtils->setCrearArbolRelaciones();
    //Validar perfiles transaccionales
    //Validar Documentos
    //TODO: Agregar cierre de riesgos
    //checar documentos de todos los socios
    $OSoc = new cSocios_general();
    $rs = $OSoc->query()->select()->exec();
    foreach ($rs as $data) {
        $OSoc->setData($data);
        $xAml = new cAMLPersonas($OSoc->codigo()->v());
        $xAml->init();
        //$xAml->setForceAlerts();
        $xAml->setVerificarDocumentosCompletos($fechaop);
        $xAml->setVerificarDocumentosVencidos($fechaop);
        $messages .= $xAml->getMessages(OUT_TXT);
     break;
 case 21101:
     $xUtils = new cUtileriasParaCreditos();
     $msg .= $xUtils->setActualizarPrimerPago();
     break;
 case 8201:
     $xUAml = new cUtileriasParaAML();
     $msg .= $xUAml->setGenerarPerfilesPorActividadEconomica();
     break;
 case 8202:
     $ForzarCorreccion = strtoupper($id) == "SI" ? true : false;
     $xUAml = new cUtileriasParaAML();
     $msg .= $xUAml->setActualizarNivelDeRiesgo($ForzarCorreccion);
     break;
 case 8203:
     $xUPers = new cPersonas_utils();
     $xUPers->setCrearArbolRelaciones();
     break;
 case 9001:
     $desucursal = $id;
     $asucursal = $id2;
     $ql = new MQL();
     $sql = "SHOW TABLES IN " . MY_DB_IN;
     $rs = $ql->getDataRecord($sql);
     foreach ($rs as $row) {
         $tabla = $row["Tables_in_" . MY_DB_IN];
         $isql = "UPDATE {$tabla} SET sucursal='{$asucursal}' WHERE sucursal='{$desucursal}' ";
         $ql->setRawQuery($isql);
         $ql->setRawQuery("UPDATE {$tabla} SET sucursal=LOWER(sucursal)");
     }
     break;