function jsaGetDatosCuenta($cuenta, $socio, $dias)
{
    $xInv = new cCuentaInversionPlazoFijo($cuenta, $socio);
    $tasa = $xInv->getTasaAplicable($dias) * 100;
    $xSoc = new cSocio($socio);
    $xSoc->init();
    $cuentainteres = $xSoc->getCuentaDeCaptacionPrimaria(CAPTACION_TIPO_VISTA, CAPTACION_PRODUCTO_INTERESES);
    $tab = new TinyAjaxBehavior();
    $tab->add(TabSetValue::getBehavior("idtasa", $tasa));
    $tab->add(TabSetValue::getBehavior("idcuentainteres", $cuentainteres));
    return $tab->getString();
}
/**
 * Funcion que Retorna la Cuenta Primaria
 * @param $idchar
 */
function Common_82d8036ee2608f6745d1dbd2f808866f($idchar)
{
    $xT = new cTipos(0);
    $datos = explode("|", $idchar);
    $idsocio = $xT->cInt($datos[0]);
    $tipo = $xT->cInt($datos[1]);
    $sub = $xT->cInt($datos[2]);
    if ($datos[2] == "all") {
        $sub = false;
    }
    if ($idsocio != 0 and $tipo != 0) {
        $cSoc = new cSocio($idsocio);
        return $cSoc->getCuentaDeCaptacionPrimaria($tipo, $sub);
    }
}
function jsaGetValidacion($persona, $producto, $origen)
{
    $html = "";
    $xPd = new cCaptacionProducto($producto);
    if ($xPd->getClase() == CAPTACION_TIPO_PLAZO) {
        $html .= $xPd->getListaDeDias();
    }
    if ($xPd->getDestinoInteres() == CAPTACION_DESTINO_CTA_INTERES) {
        $xTxt2 = new cHText();
        $xSoc = new cSocio($persona);
        $xSoc->init();
        $html .= $xTxt2->getDeCuentaCaptacionInteres("", $xSoc->getCuentaDeCaptacionPrimaria(CAPTACION_TIPO_VISTA, CAPTACION_PRODUCTO_INTERESES));
    }
    //
    return $html;
}
     //Dar de Alta
     $persona = setNoMenorQueCero($persona) > 0 ? $persona : false;
     $xSoc = new cSocio($persona);
     if ($aml == true) {
         $xSoc->setOmitirAML();
     }
     $xSoc->add($nombre, $apellido1, $apellido2, $rfc, $curp);
     if ($xSoc->init() == true) {
         $persona = $xSoc->getCodigo();
         $sucess = true;
     }
 }
 //verificar cuenta de captacion
 if ($sucess == true) {
     if ($cuenta == false) {
         $cuenta = $xSoc->getCuentaDeCaptacionPrimaria(CAPTACION_TIPO_VISTA, $producto_destino);
         $cuenta = $cuenta == 0 ? false : $cuenta;
     } else {
         if ($xSoc->existeCuenta($cuenta) == false) {
             $msg .= "WARN\tLa cuenta {$cuenta} NO EXISTE. Se genera una NUEVA\r\n";
             $cuenta = false;
         }
     }
 }
 //Verifica que solo haya un tipo de operacion
 if ($sucess == true) {
     if ($deposito > 0 and $retiro > 0) {
         $sucess = false;
         $msg .= "ERROR\tSolo se admite un tipo de operacion por LINEA\r\n";
     }
 }
 /*
  * TODO: Agregar enviar PP a Ahorro
  * activar configuracion
  * activar cuenta por defecto
  * verificar cuenta
  * agregar cuenta
  * agregar deposito
  */
 //$cRec->setGenerarBancos();
 $cRec->setGenerarPoliza();
 $cRec->setGenerarTesoreria();
 $sucess = true;
 $msg = "";
 if (CAPITAL_SOCIAL_EN_CAPTACION == true) {
     $xSoc = new cSocio($persona);
     $cuenta = $xSoc->getCuentaDeCaptacionPrimaria(CAPTACION_TIPO_VISTA, CAPTACION_PRODUCTO_CAPITALSOCIAL);
     $xCta = new cCuentaALaVista($cuenta);
     if ($cuenta == 0) {
         //Aperturar nueva cuenta
         $cuenta = $xCta->setNuevaCuenta(DEFAULT_CAPTACION_ORIGEN, CAPTACION_PRODUCTO_CAPITALSOCIAL, $persona);
         $xCta->set($cuenta);
     }
     if ($xCta->init() == true) {
         $idrecibo = $cRec->setNuevoRecibo($persona, $xCta->getNumeroDeCuenta(), $fecha, 1, RECIBOS_TIPO_DEPOSITO_VISTA, $observaciones, $cheque, $comopago, $foliofiscal);
         $cRec->init();
         if ($tipo1 != false and $monto1 > 0) {
             $xCta->setDeposito($monto1, $cheque, $comopago, $foliofiscal, "Origen {$tipo1}:" . $observaciones, DEFAULT_GRUPO, $fecha, $cRec->getCodigoDeRecibo());
         }
         if ($tipo2 != false and $monto2 > 0) {
             $xCta->setDeposito($monto2, $cheque, $comopago, $foliofiscal, "Origen {$tipo2}:" . $observaciones, DEFAULT_GRUPO, $fecha, $cRec->getCodigoDeRecibo());
         }
function prioricta($idchar)
{
    $xT = new cTipos(0);
    $datos = explode("|", $idchar);
    $idsocio = $xT->cInt($datos[0]);
    $tipo = $xT->cInt($datos[1]);
    if ($idsocio != 0 and $tipo != 0) {
        $cSoc = new cSocio($idsocio);
        return $cSoc->getCuentaDeCaptacionPrimaria($tipo);
    }
}