$frecuencia = parametro("periocidad", SYS_TODAS);
$producto = parametro("convenio", SYS_TODAS);
$producto = parametro("producto", $producto);
$empresa = parametro("empresa", SYS_TODAS);
$out = parametro("out", SYS_DEFAULT);
$FechaInicial = parametro("on", false);
$FechaInicial = parametro("fecha-1", $FechaInicial);
$FechaInicial = $FechaInicial == false ? FECHA_INICIO_OPERACIONES_SISTEMA : $xF->getFechaISO($FechaInicial);
$FechaFinal = parametro("off", false);
$FechaFinal = parametro("off", $FechaFinal);
$FechaFinal = $FechaFinal == false ? fechasys() : $xF->getFechaISO($FechaFinal);
$definitivo = parametro("definitivo", false, MQL_BOOL);
$preguntar = parametro("pregunta", false, MQL_BOOL);
$xLayout->setTipo($xLayout->OPERACIONES_INTERNAS);
$datos = $xLayout->read();
$Estructura = $xLayout->getContent();
$production = ($out == OUT_TXT or $out == OUT_CSV) ? true : false;
$FechaExtraccion = $FechaFinal;
$FechaTitulo = date("ymd", strtotime($FechaFinal));
$casfin = EACP_CLAVE_CASFIN;
$delimitador = $xLayout->getSeparador();
$msg = "";
$supervisor = 2;
//$xCatalogoActividades	= new cPersonaActividadEconomica();
$sql = "SELECT\n\t\t*\nFROM\n\t`aml_risk_catalog` `aml_risk_catalog`\n\t\tINNER JOIN `aml_risk_register` `aml_risk_register`\n\t\tON `aml_risk_catalog`.`clave_de_control` = `aml_risk_register`.\n\t\t`tipo_de_riesgo`\nWHERE\n\t(`aml_risk_catalog`.`tipo_de_riesgo` = " . AML_CLAVE_OPERACIONES_INTERNAS . "\n\tOR\n\t`aml_risk_catalog`.`tipo_de_riesgo` = " . AML_CLAVE_OPERACIONES_INUSUALES . ")\t\t\n\t\n\tAND \n\t(`aml_risk_register`.`estado_de_envio` =0)\n\tAND\n\t(`aml_risk_register`.`reporte_inmediato` =1)\n\tORDER BY `aml_risk_register`.`fecha_de_reporte`\n";
$xTBL = new cTabla($sql);
$rpt = "";
$rs = $query->getDataRecord($sql);
$xEquivOps = new cSistemaEquivalencias(TOPERACIONES_RECIBOSTIPOS);
$xEquivOps->init($xEquivOps->PLD_OPERACIONES);
$xEquivInst = new cSistemaEquivalencias(TTESORERIA_TIPOS_DE_PAGO);