function jsaReRelaciones($idsocio)
{
    //Checar compatibilidad numerica entre los dependientes economicos
    $sqlL = new cSQLListas();
    $cBenef = new cTabla($sqlL->getListadoDeRelaciones($idsocio));
    $xTbl = new cHTabla("idtblrels");
    $xHSel = new cHSelect();
    $xChk = new cHCheckBox();
    $xText = new cHText();
    $xText->setDivClass("");
    $xChk->setDivClass("");
    $xBtn = new cHButton();
    $xUl = new cHUl();
    $li = $xUl->getO();
    $li->setT("ul");
    $li->setClass("tags blue");
    $li->add($xBtn->getBasic("TR.Guadar", "jsGuardarReferencia()", $xBtn->ic()->GUARDAR, "idguardar", false, true), "");
    $xTbl->initRow();
    $xTbl->addTD($xText->getDeNombreDePersona());
    $xTbl->addTD($xHSel->getListaDeTiposDeRelaciones("", "")->get(""));
    $xTbl->addTD($xHSel->getListaDeTiposDeParentesco()->get(""));
    $xTbl->addTD($xChk->get("TR.es dependiente_economico", "dependiente"));
    $xTbl->addRaw("<td class='toolbar-24'>" . $xUl->get() . "</td>");
    $xTbl->endRow();
    $cBenef->addTool(1);
    $cBenef->addTool(2);
    $cBenef->setKeyField("idsocios_relaciones");
    return $xTbl->get() . $cBenef->Show();
}
//============ Reporte
//$xT		= new cTabla($sql, 2);
//$xT->setTipoSalida($out);
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
$xCats = new cCatalogoDeDatos("");
$DActividades = $xCats->get("clave_interna", "nombre_de_la_actividad", "personas_actividad_economica_tipos");
$DGenero = $xCats->get("idsocios_genero", "descripcion_genero", "socios_genero");
$DPaises = $xCats->initPorTabla(TCATALOGOS_PAISES);
$DRiesgo = $xCats->initPorTabla(TCATALOGOS_GRADO_RIESGO);
//$xT->setEventKey("jsGoPanel");
//$xT->setKeyField("creditos_solicitud");
$sql = $xL->getInicialDePersonas() . " WHERE (`personalidad_juridica` = 2 OR `personalidad_juridica` = 5)";
$rs = $query->getDataRecord($sql);
$xTa = new cHTabla();
$xDSoc = new cSocios_general();
$xF = new cFecha();
$xTa->initRow();
$xTa->addTH("Sucursal");
$xTa->addTH("Nombre");
$xTa->addTH("Fecha de Constitucion");
$xTa->addTH("Nacionalidad");
$xTa->addTH("RFC");
$xTa->addTH("Actividad economica");
//$xTa->addTH("Puesto o Ocupacion");
$xTa->addTH("Direccion");
$xTa->addTH("Telefono Principal");
$xTa->addTH("Apoderado");
$xTa->addTH("Es PEP");
$xTa->addTH("Lista Negra");
//============ Reporte
//$xT		= new cTabla($sql, 2);
//$xT->setTipoSalida($out);
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
$xCats = new cCatalogoDeDatos("");
$DActividades = $xCats->get("clave_interna", "nombre_de_la_actividad", "personas_actividad_economica_tipos");
$DGenero = $xCats->get("idsocios_genero", "descripcion_genero", "socios_genero");
$DPaises = $xCats->initPorTabla(TCATALOGOS_PAISES);
$DRiesgo = $xCats->initPorTabla(TCATALOGOS_GRADO_RIESGO);
//$xT->setEventKey("jsGoPanel");
//$xT->setKeyField("creditos_solicitud");
$sql = $xL->getInicialDePersonas() . " WHERE (`personalidad_juridica` != 2 AND `personalidad_juridica` != 5)";
$rs = $query->getDataRecord($sql);
$xTa = new cHTabla();
$xDSoc = new cSocios_general();
$xF = new cFecha();
$xTa->initRow();
$xTa->addTH("Sucursal");
$xTa->addTH("Primer Apellido");
$xTa->addTH("Segundo Apellido");
$xTa->addTH("Nombre");
$xTa->addTH("Genero");
$xTa->addTH("Fecha de Nacimiento");
$xTa->addTH("Pais de Nacimiento");
$xTa->addTH("Lugar de Nacimiento");
$xTa->addTH("Nacionalidad");
$xTa->addTH("RFC");
$xTa->addTH("Actividad economica");
$xTa->addTH("Puesto o Ocupacion");
             }
         }
         if (MODO_DEBUG == true) {
             $msg .= $xGrupo->getMessages();
         }
     }
 }
 //Agregar Domicilio si existe
 $persona = $xSoc->getCodigo();
 $xFRM->addHTML($xSoc->getFicha());
 $lastpersona = $xCL->getUltimoSocioRegistrado(true);
 $xFRM->addPersonaComandos($persona);
 $xFRM->addAvisoRegistroOK();
 //==================================== Nuevas Relaciones
 if ($origen_relacion == false) {
     $xTbl = new cHTabla("idtblrels");
     $xHSel = new cHSelect();
     $xChk = new cHCheckBox();
     $xText = new cHText();
     $xText->setDivClass("");
     $xChk->setDivClass("");
     $xBtn = new cHButton();
     $xUl = new cHUl();
     $li = $xUl->getO();
     $li->setT("ul");
     $li->setClass("tags blue");
     $li->add($xBtn->getBasic("TR.Guadar", "jsGuardarReferencia()", $xBtn->ic()->GUARDAR, "idguardar", false, true), "");
     $xTbl->initRow();
     $xTbl->addTD($xText->getDeNombreDePersona());
     $xTbl->addTD($xHSel->getListaDeTiposDeRelaciones("", "")->get(""));
     $xTbl->addTD($xHSel->getListaDeTiposDeParentesco()->get(""));
 function getResumenDeCaja()
 {
     $xF = new cFecha();
     $xSQL = new cSQLListas();
     $xTxt = new cHText();
     $xLn = new cLang();
     $xTbl = new cHTabla();
     $this->mSumaRecibos = 0;
     $this->mSumaCobros = 0;
     $resumen = "";
     $fecha_inicial = $this->mFecha;
     $fecha_final = $this->mFecha;
     $cajero = $this->mCajero;
     //==================================================================== TOTAL CORTE
     $resumen .= "<h3>" . $xLn->getT("TR.Resumen de caja") . "</h3>";
     $sqlTi = $xSQL->getListadoResumenTesoreria($cajero, $fecha_inicial, $fecha_final);
     $xT = new cTabla($sqlTi);
     $xT->setTdClassByType();
     $xT->setFootSum(array(2 => "operacion", 3 => "recibido", 4 => "cambio"));
     $resumen .= $xT->Show("TR.Resumen");
     $resumen .= "<input type='hidden' id='idsumacaja' value='" . $xT->getFieldsSum("recibido") . "' />";
     $resumen .= "<h3>" . $xLn->getT("TR.Efectivo") . "</h3>";
     //==================================================================== EFECTIVO
     $sqlTE = $xSQL->getListadoResumenOperaciones($fecha_inicial, $fecha_final, $cajero, TESORERIA_COBRO_EFECTIVO);
     $xTE = new cTabla($sqlTE);
     $xTE->setTdClassByType();
     $xTE->setFootSum(array(5 => "total"));
     $resumen .= $xTE->Show("TR.Cobros por Efectivo");
     $this->mSumaRecibos += $xTE->getFieldsSum("total");
     $resumen .= "<h3>" . $xLn->getT("TR.Documentos") . "</h3>";
     $sqlArq = "SELECT\r\n\t\t\t\t`tesoreria_caja_arqueos`.`fecha_de_arqueo`,\r\n\t\t\t\t`tesoreria_caja_arqueos`.`documento`,\r\n\t\t\t\t`tesoreria_caja_arqueos`.`monto_total_arqueado`,\r\n\t\t\t\t`tesoreria_caja_arqueos`.`observaciones` \r\n\t\t\tFROM\r\n\t\t\t\t`tesoreria_caja_arqueos` `tesoreria_caja_arqueos` \r\n\t\t\tWHERE\r\n\t\t\t\t(`tesoreria_caja_arqueos`.`codigo_de_caja` ='" . $this->getKey() . "')";
     $xTArq = new cTabla($sqlArq);
     $xTArq->setTdClassByType();
     $xTArq->setFootSum(array(2 => "monto_total_arqueado"));
     $resumen .= $xTArq->Show("TR.Arqueo");
     $this->mSumaCobros += $xTArq->getFieldsSum("monto_total_arqueado");
     //==================================================================== CHEQUES Y DOCUMENTOS
     $sqlLC = $xSQL->getListadoDeTesoreria($cajero, $fecha_inicial, $fecha_final, TESORERIA_COBRO_CHEQUE);
     $xT2 = new cTabla($sqlLC);
     $xT2->setTdClassByType();
     $xT2->setFootSum(array(5 => "operacion"));
     $resumen .= $xT2->Show("TR.Operaciones en Cheque");
     $this->mSumaCobros += $xT2->getFieldsSum("operacion");
     $sqlTD = $xSQL->getListadoResumenOperaciones($fecha_inicial, $fecha_final, $cajero, TESORERIA_COBRO_CHEQUE);
     $xTD = new cTabla($sqlTD);
     $xTD->setTdClassByType();
     $xTD->setFootSum(array(5 => "total"));
     $resumen .= $xTD->Show("TR.Cobros por Cheque");
     $this->mSumaRecibos += $xTD->getFieldsSum("total");
     $resumen .= "<h3>" . $xLn->getT("TR.Bancos") . "</h3>";
     //==================================================================== TRANFERENCIAS
     $sqlTO = $xSQL->getListadoDeCajaEnBanco(BANCOS_OPERACION_DEPOSITO, "", $cajero, $fecha_inicial, $fecha_final);
     $xT = new cTabla($sqlTO);
     $xT->setTdClassByType();
     $xT->setFootSum(array(4 => "monto"));
     $resumen .= $xT->Show("TR.Operaciones Bancarias");
     $this->mSumaCobros += $xT->getFieldsSum("monto");
     //-------------------------------------------
     $sqlT = $xSQL->getListadoResumenOperaciones($fecha_inicial, $fecha_final, $cajero, TESORERIA_COBRO_TRANSFERENCIA);
     $xT = new cTabla($sqlT);
     $xT->setTdClassByType();
     $xT->setFootSum(array(5 => "total"));
     $resumen .= $xT->Show("TR.Cobros por Transferencia");
     $this->mSumaRecibos += $xT->getFieldsSum("total");
     //====================================================================
     $xTbl->initRow();
     $xTbl->addTH("TR.Suma de Recibos");
     $xTbl->addTD(getFMoney($this->mSumaRecibos));
     $xTbl->endRow();
     $xTbl->initRow();
     $xTbl->addTH("TR.Suma de Cobranza");
     $xTbl->addTD(getFMoney($this->mSumaCobros));
     $xTbl->endRow();
     $resumen .= $xTbl->get();
     $resumen .= "<input type='hidden' id='idsumaoperaciones' value='" . $this->mSumaRecibos . "' />";
     $resumen .= "<input type='hidden' id='idsumacobros' value='" . $this->mSumaCobros . "' />";
     $this->mArqueoInit = true;
     return $resumen;
 }
     $json["record_{$idx}"][$campo] = $valor;
     //base64_encode($valor);//utf8_encode($valor);
 }
 $idx++;
 //Generar el Acuse
 if ($getPDF == true) {
     $id = $row["codigo"];
     $tipo = $row["tipo"];
     $app1 = $row["primerapellido"];
     $app2 = $row["segundoapellido"];
     $noms = $row["nombres"];
     $flTitle = "";
     //generar aka
     $xSoc = new cSocio($id);
     $xSoc->init();
     $xTbl = new cHTabla();
     $xTbl->initRow();
     //score
     $xTbl->addTH($xLng->getT("TR.SDN Numero"));
     switch ($tipo) {
         case "soundlike":
             $flTitle = $xLng->getT("TR.Algoritmo") . " : SQL-SOUNDLIKE";
             //$xTbl->addTH("Algoritmo");
             //$xTbl->addTD("SOUNDLIKE");
             $xTbl->addRaw("<td /><td />");
             break;
         case "jarowinkler":
             $flTitle = $xLng->getT("TR.Algoritmo") . " : JARO-WINKLER";
             $xTbl->addTH($xLng->getT("TR.Coincidencia"));
             $score1 = 0;
             $score2 = 0;
include_once "../core/core.db.inc.php";
$theFile = __FILE__;
$permiso = getSIPAKALPermissions($theFile);
if ($permiso === false) {
    header("location:../404.php?i=999");
}
$_SESSION["current_file"] = addslashes($theFile);
//=====================================================================================================
$xHP = new cHPage("TR.VISTA_PREVIA DEL REPORTE_X_HORAS", HP_REPORT);
$mql = new cSQLListas();
$xF = new cFecha();
$query = new MQL();
$xT = new cTipos();
$xLoc = new cLocal();
$xLayout = new cReportes_Layout();
$xHTable = new cHTabla();
$xHNot = new cHNotif();
$estatus = parametro("estado", SYS_TODAS);
$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);
$xTxM->addEvent("jsActualizarMonedas", "onchange");
$xDiv->addHElem("<h3>" . $xFRM->lang("Valores") . "<id id='totalmonedas'></i></h3>");
$xDiv->addHElem($xTxM->getDeMoneda("mone-10-cents", "TR.Monedas de 10 centimos", 0));
$xDiv->addHElem($xTxM->getDeMoneda("mone-20-cents", "TR.Monedas de 20 centimos", 0));
$xDiv->addHElem($xTxM->getDeMoneda("mone-50-cents", "TR.Monedas de 50 centimos", 0));
$xDiv->addHElem($xTxM->getDeMoneda("mone-1", "TR.Monedas de 1", 0));
$xDiv->addHElem($xTxM->getDeMoneda("mone-2", "TR.Monedas de 2", 0));
$xDiv->addHElem($xTxM->getDeMoneda("mone-5", "TR.Monedas de 5", 0));
$xDiv->addHElem($xTxM->getDeMoneda("mone-10", "TR.Monedas de 10", 0));
$xDiv->addHElem($xTxM->getDeMoneda("bille-20", "TR.Billetes de 20", 0));
$xDiv->addHElem($xTxM->getDeMoneda("bille-50", "TR.Billetes de 50", 0));
$xDiv->addHElem($xTxM->getDeMoneda("bille-100", "TR.Billetes de 100", 0));
$xDiv->addHElem($xTxM->getDeMoneda("bille-200", "TR.Billetes de 200", 0));
$xDiv->addHElem($xTxM->getDeMoneda("bille-500", "TR.Billetes de 500", 0));
$xDiv->addHElem("<h3>" . $xFRM->lang("Documentos") . "<id id='totaldocumentos'></i></h3>");
$xHT = new cHTabla();
$xTxD = new cHText();
$xTxD->setDivClass("");
$xHT->initRow();
$xTxD->addEvent("jsActualizarDoctos", "onchange");
$xHT->addTH("#");
$xHT->addTH("TR.Documento");
$xHT->addTH("TR.Monto");
$xHT->addTH("TR.Observaciones");
$xHT->endRow();
$xHT->initRow();
$xTxD->addEvent("jsActualizarDoctos", "onchange");
$xHT->addTD("1");
$xHT->addTD($xTxD->getNormal("documento-01"));
$xHT->addTD($xTxD->getDeMoneda("idmontodoc-01"));
$xHT->addTD($xTxD->getDeObservaciones("idobserva-01"));
$iduser = $_SESSION["log_id"];
//=====================================================================================================
$xHP = new cHPage("TR.Estado de Cuenta de Depositos plazo_fijo", HP_REPORT);
$xQl = new MQL();
$cuenta = parametro("cuenta", DEFAULT_CUENTA_CORRIENTE, MQL_INT);
$cuenta = parametro("idcuenta", $cuenta, MQL_INT);
$cuenta = parametro("docto", $cuenta, MQL_INT);
$idcuenta = $cuenta;
//parametro("docto", false, MQL_INT);
$AppByFechas = parametro("v73", false, MQL_BOOL);
//Boolean por fechas
$fecha_inicial = $_GET["on"];
$fecha_final = $_GET["off"];
$out = parametro("out", SYS_DEFAULT);
$es_por_fechas = "";
$xHT = new cHTabla();
//ini_set("display_errors", "on");
$xCuenta = new cCuentaInversionPlazoFijo($cuenta);
$xCuenta->init();
$saldo = $xCuenta->getSaldoActual();
$xRPT = new cReportes();
$persona = $xCuenta->getClaveDePersona();
$xSoc = new cSocio($persona);
$xSoc->init();
$xRPT->setTitle($xHP->getTitle(), true);
$xRPT->addContent($xSoc->getFicha());
$xRPT->addContent($xCuenta->getFicha(true, "", true));
//Datos de la Cuenta
$sqlMvtos = "SELECT\n\t\t\t`operaciones_mvtos`.*,\n\t\t\t\t(`operaciones_mvtos`.`afectacion_real` *\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`afectacion`) AS 'monto',\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`afectacion`\n\t\t\tFROM\n\t\t\t`operaciones_mvtos` `operaciones_mvtos`\n\t\t\t\tINNER JOIN `eacp_config_bases_de_integracion_miembros`\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`\n\t\t\t\tON `operaciones_mvtos`.`tipo_operacion` =\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`miembro`\n\t\t\tWHERE\n\t\t\t(`operaciones_mvtos`.`docto_afectado` =" . $cuenta . ") AND\n\t\t\t(`eacp_config_bases_de_integracion_miembros`.`codigo_de_base` = 3200)\n\n\t\t\tORDER BY\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`codigo_de_base`,\n\t\t\t\t`operaciones_mvtos`.`fecha_afectacion`,\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`afectacion` DESC\n\t\t\t";
$xHT->initRow();
$xHT->addTH("TR.Fecha");
 $li = $xUl->getO();
 $li->setT("ul");
 $li->setClass("tags blue");
 $li->add($xBtn->getBasic("TR.Guadar", "jsGuardarPropietario()", $xBtn->ic()->GUARDAR, "idguardar", false, true), "");
 $xTbl->initRow();
 $xTbl->addTD($xText->getDeNombreDePersona("idpersona1"));
 $xFRM->OHidden("idtipoderelacion1", PERSONAS_REL_PROP_REAL);
 $xTbl->addTD($xHSel->getListaDeTiposDeParentesco("idtipodeparentesco1")->get(""));
 $xTbl->addRaw("<td class='toolbar-24'>" . $xUl->get() . "</td>");
 $xTbl->endRow();
 $xFRM->addHElem($xTbl->get());
 //propietarios reales
 $xFRM->endSeccion();
 $xFRM->addSeccion("idprovs", "TR.Proveedores de recursos");
 //proveedor de recursos.
 $xTbl = new cHTabla("idtblprov");
 $xHSel = new cHSelect();
 $xChk = new cHCheckBox();
 $xText = new cHText();
 $xText->setDivClass("");
 $xChk->setDivClass("");
 $xBtn = new cHButton();
 $xUl = new cHUl();
 $li = $xUl->getO();
 $li->setT("ul");
 $li->setClass("tags blue");
 $li->add($xBtn->getBasic("TR.Guadar", "jsGuardarProveedor()", $xBtn->ic()->GUARDAR, "idguardar", false, true), "");
 $xTbl->initRow();
 $xTbl->addTD($xText->getDeNombreDePersona("idpersona2"));
 $xFRM->OHidden("idtipoderelacion2", PERSONAS_REL_PROV_RECURSOS);
 $xTbl->addTD($xHSel->getListaDeTiposDeParentesco("idtipodeparentesco2")->get(""));