$permiso = getSIPAKALPermissions($theFile);
if ($permiso === false) {
    header("location:../404.php?i=999");
}
$_SESSION["current_file"] = addslashes($theFile);
//=====================================================================================================
$xHP = new cHPage("Propiedades Contables de Creditos", HP_GRID);
$xHP->setIncludes();
$parent = isset($_POST["c"]) ? $_POST["c"] : false;
$filtro1 = "";
$filtro2 = "";
//HTML Object Init
$xHP->addJsFile(GRID_SOURCE . "javascript/javascript.js");
$xHP->addCSS("../css/grid.css");
$xHP->addJsFile(GRID_SOURCE . "server.php?client=all");
$xHP->addHSnip("<script> HTML_AJAX.defaultServerUrl = '" . GRID_SOURCE . "server.php';\t</script>");
$xHP->setNoDefaultCSS();
echo $xHP->getHeader(true);
//HTML Object END
echo '<body onmouseup="SetMouseDown(false);" ><div id="onGrid">';
// Define your grid
$_SESSION["grid"]->SetDatabaseConnection(MY_DB_IN, USR_DB, PWD_DB);
//Propiedades del GRID
$mGridTitulo = "Creditos.- Propiedades Contables";
$mGridKeyField = "idcreditos_tipoconvenio";
//Nombre del Campo Unico
$mGridKeyEdit = false;
//Es editable el Campo
$mGridTable = "creditos_tipoconvenio";
//Nombre de la tabla
$mGridSQL = "idcreditos_tipoconvenio, descripcion_tipoconvenio, capital_vencido_renovado, capital_vencido_reestructurado, capital_vencido_normal, capital_vigente_renovado, capital_vigente_reestructurado, capital_vigente_normal, interes_vencido_renovado, interes_vencido_reestructurado, interes_vencido_normal, interes_vigente_renovado, interes_vigente_reestructurado, interes_vigente_normal, interes_cobrado, moratorio_cobrado";
}
if (isset($_REQUEST["fecha"])) {
    $_SESSION[FECHA_OPERATIVA] = $_REQUEST["fecha"];
    $Fecha = $_SESSION[FECHA_OPERATIVA];
}
$xCred = new cCredito($solicitud);
$xCred->init();
$socio = $xCred->getClaveDePersona();
$FechaInicial = $xCred->getFechaDeMinistracion();
if (CREDITO_GENERAR_DEVENGADOS_ONFLY == true) {
    $msg .= $xCred->setReestructurarIntereses(false, $Fecha, true);
}
//$dcreds 			= $xCred->getDatosDeCredito() ;
$periocidad = $xCred->getPeriocidadDePago();
$xJsBasic = new jsBasicForm("frmProcesarPago");
$xHP->addHSnip($xJsBasic->setIncludeJQuery());
echo $xHP->setBodyinit();
if ($xCred->isPagable() == false) {
    exit($jsNoValido);
} else {
    $oFrm = new cHForm("frmProcesarPago", "./", "frmProcesarPago");
    //selector de Cobros
    $xHCob = new cHCobros();
    $xSelP = new cHSelect();
    $xhBtn = new cHButton();
    $btns = "";
    $defaultPago = OPERACION_PAGO_COMPLETO;
    switch ($periocidad) {
        case CREDITO_TIPO_PERIOCIDAD_FINAL_DE_PLAZO:
            $oFrm->addToolbar($xhBtn->getBasic("TR.ABONO ORDINARIO", "jsGetPago('ao')", "dinero", "pc2", false));
            $oFrm->addToolbar($xhBtn->getBasic("TR.PAGO COMPLETO", "jsGetPago('pc')", "dinero", "pc1", false));