function jsaGetListadoDeAvisos($tipo, $fecha_inicial, $fecha_final)
{
    $tipo = $tipo == SYS_TODAS ? false : $tipo;
    $xF = new cFecha();
    $xAl = new cAml_alerts();
    $xlistas = new cSQLListas();
    $xBtn = new cHButton();
    $xImg = new cHImg();
    $fecha_inicial = $xF->getFechaISO($fecha_inicial);
    $fecha_final = $xF->getFechaISO($fecha_final);
    $sql = $xlistas->getListadoDeRiesgosConfirmados($fecha_inicial, $fecha_final, $tipo);
    // getListadoDeAlertas($tipo, $fecha_inicial, $fecha_final, false, " AND `estado_en_sistema`= " . SYS_UNO);
    $xT = new cTabla($sql);
    $xT->addEspTool($xImg->get24("check", " onclick=\"jsConfirmRiesgo(_REPLACE_ID_)\" "));
    $xT->addEspTool($xImg->get24("delete", " onclick=\"jsDescartarRiesgo(_REPLACE_ID_)\" "));
    $xT->setKeyField($xAl->getKey());
    $xT->setKeyTable($xAl->get());
    return $xT->Show();
}
function jsaGetListadoDeAvisos($tipo, $fecha_inicial, $fecha_final)
{
    $tipo = $tipo == SYS_TODAS ? false : $tipo;
    $xF = new cFecha();
    $xAl = new cAml_risk_register();
    $xlistas = new cSQLListas();
    $xBtn = new cHButton();
    $xImg = new cHImg();
    $fecha_inicial = $xF->getFechaISO($fecha_inicial);
    $fecha_final = $xF->getFechaISO($fecha_final);
    $sql = $xlistas->getListadoDeRiesgosConfirmados(false, false, false, $tipo, false, " AND (`aml_risk_register`.`estado_de_envio` =0) AND (`aml_risk_register`.`fecha_de_checking` =0) ");
    $xT = new cTabla($sql);
    //setLog($sql);
    $xT->OButton("TR.Dictaminar", "jsModificarEstatus(_REPLACE_ID_)", $xT->ODicIcons()->REPORTE);
    $xT->OButton("TR.Modificar", "jsEditarRiesgo(_REPLACE_ID_)", $xT->ODicIcons()->EDITAR);
    //$xT->addTool(1);
    $xT->setKeyField($xAl->getKey());
    $xT->setKeyTable($xAl->get());
    return $xT->Show();
}
$xRPT->setFile($archivo);
$xRPT->setOut($out);
//$xRPT->setSQL($sql);
$xRPT->setTitle($xHP->getTitle());
//============ Reporte
$xSoc = new cSocio($persona);
$xSoc->init();
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
$xRPT->addContent($xSoc->getFicha(true));
//Bajo revision
$xAl = new cAml_alerts();
$xlistas = new cSQLListas();
$sql = $xlistas->getListadoDeAlertas(false, false, false, $persona, " AND `estado_en_sistema` =" . SYS_UNO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show("TR.Alertas pendientes de verificar"));
//Descartados
$sql = $xlistas->getListadoDeAlertas(false, false, false, $persona, " AND `estado_en_sistema` =" . SYS_CERO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show("TR.Alertas ignoradas"));
//Riesgos para reportar
$sql = $xlistas->getListadoDeRiesgosConfirmados(false, false, false, false, $persona, " AND `estado_de_envio`= " . SYS_CERO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show("TR.Alertas pendientes de reportar"));
$sql = $xlistas->getListadoDeRiesgosConfirmados(false, false, false, false, $persona, " AND `estado_de_envio`= " . SYS_UNO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show("TR.Alertas reportadas"));
$xRPT->setResponse();
$xRPT->setSenders($senders);
echo $xRPT->render(true);
$persona = parametro("socio", $persona, MQL_INT);
$persona = parametro("idsocio", $persona, MQL_INT);
$FechaInicial = parametro("on", false);
$FechaInicial = parametro("fecha-0", $FechaInicial);
$FechaInicial = $FechaInicial == false ? FECHA_INICIO_OPERACIONES_SISTEMA : $xF->getFechaISO($FechaInicial);
$FechaFinal = parametro("off", false);
$FechaFinal = parametro("fecha-1", $FechaFinal);
$FechaFinal = $FechaFinal == false ? fechasys() : $xF->getFechaISO($FechaFinal);
$jsEvent = $out != OUT_EXCEL ? "initComponents()" : "";
$senders = getEmails($_REQUEST);
$titulo = "";
$archivo = "";
$xRPT = new cReportes($titulo);
$xRPT->setFile($archivo);
$xRPT->setOut($out);
//$xRPT->setSQL($sql);
$xRPT->setTitle($xHP->getTitle());
//============ Reporte
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
//Descartados
$sql = $xlistas->getListadoDeRiesgosConfirmados($FechaInicial, $FechaFinal, false, false, false, " AND `estado_de_envio`= " . SYS_CERO);
$xT = new cTabla($sql);
$xRPT->addContent($xT->Show());
//$sql		= $xlistas->getListadoDeRiesgosConfirmados(false, false, false, false, false, " AND `estado_de_envio`= " . SYS_CERO);
//$xT			= new cTabla($sql);
//$xRPT->addContent( $xT->Show( "TR.Alertas pendientes de reportar" ) );
$xRPT->setResponse();
$xRPT->setSenders($senders);
echo $xRPT->render(true);