function initPorCredito($idcredito, $dataCredito = false)
 {
     $xCred = new cCredito($idcredito);
     $xCred->init($dataCredito);
     $xF = new cFecha();
     if ($xCred->getTipoEnSistema() == CREDITO_PRODUCTO_NOMINA) {
         //cargar datos de la empresa
         $idemp = $xCred->getClaveDeEmpresa();
         $periocidad = $xCred->getPeriocidadDePago();
         $this->setPeriocidadDePago($periocidad);
         $this->mTipoCreditoSis = $xCred->getTipoEnSistema();
         $this->mClaveDePlan = setNoMenorQueCero($xCred->getNumeroDePlanDePagos());
         if ($this->mClaveDePlan > 0) {
             //TODO: validar fecha de primer pago en calculos automaticos
             $this->mFechaPrimerPago = $xCred->getFechaPrimeraParc();
         } else {
             $this->mFechaPrimerPago = $this->getFechaDePago($xCred->getFechaDeMinistracion(), 1);
         }
         if ($xCred->getFechaPrimeraParc() == $this->mFechaFail or $xF->getInt($xCred->getFechaPrimeraParc()) <= $xF->getInt($xCred->getFechaDeMinistracion())) {
             $this->mFechaPrimerPago = $this->getFechaDePago($xCred->getFechaDeMinistracion(), 1);
         }
         $xEmp = new cEmpresas($idemp);
         $xEmp->init();
         $DDias = $xEmp->getDiasDeNomina($periocidad);
         $this->mDiaDeAbono1 = isset($DDias[0]) ? setNoMenorQueCero($DDias[0]) : $this->mDiaDeAbono1;
         $this->mDiaDeAbono2 = isset($DDias[1]) ? setNoMenorQueCero($DDias[1]) : $this->mDiaDeAbono2;
         $this->mDiaDeAbono3 = isset($DDias[2]) ? setNoMenorQueCero($DDias[2]) : $this->mDiaDeAbono3;
     } else {
         $this->mFechaPrimerPago = $this->getFechaDePago($xCred->getFechaDeMinistracion(), 1);
     }
 }
        //$iddirectivo=
        $iddirectivo = $xEmp->getClaveDeContacto();
        $directivo = $xEmp->getNombreContacto();
        $idsocio = $xEmp->getClaveDePersona();
        $periocidad1 = $xEmp->getPeriocidadPref();
        $lstPeriodos = $xEmp->getListaDePeriocidad();
        $periocidad2 = isset($lstPeriodos[1]) ? $lstPeriodos[1] : $periocidad1;
        $producto = $xEmp->getProductoPref();
        $mails = $xEmp->getEmailsDeEnvio();
        $oficial = $xEmp->getClaveDeOficial();
        $mail1 = isset($mails[0]) ? $mails[0] : "";
        $mail2 = isset($mails[1]) ? $mails[1] : "";
        $mail3 = isset($mails[2]) ? $mails[2] : "";
        $diasaviso1 = $xEmp->getDiasDeAviso($periocidad1, MQL_STRING);
        $diasaviso2 = $xEmp->getDiasDeAviso($periocidad2, MQL_STRING);
        $diasnomina1 = $xEmp->getDiasDeNomina($periocidad1, MQL_STRING);
        $diasnomina2 = $xEmp->getDiasDeNomina($periocidad2, MQL_STRING);
        $diaspago1 = $xEmp->getDiasDePago($periocidad1, MQL_STRING);
        $diaspago2 = $xEmp->getDiasDePago($periocidad2, MQL_STRING);
        $step = MQL_MOD;
    }
}
function jsaGetNombreDirector($persona)
{
    $xSocio = new cSocio($persona);
    $xSocio->init();
    //idelmes0 idelanno0 ideldia0
    $tab = new TinyAjaxBehavior();
    //$tab -> add(TabSetvalue::getBehavior("idNumeroSocio", $socio));
    $tab->add(TabSetvalue::getBehavior("idnombredependencia", $xSocio->getNombreCompleto()));
    //$tab -> add(TabSetvalue::getBehavior('idObservaciones', $xSoc->getMessages() ));