function setValidarCuentas($ForzarCorreccion = false) { $msg = ""; $msg .= "============== VALIDANDO CUENTAS DE CAPTACION\t==========\r\n"; $msg .= "============== FECHA: " . fechasys() . " ==========\r\n"; /** * Valida si la Cuenta de captacion por defecto existe * @since 2010-12-31 */ $xPCta = new cCuentaALaVista(CTA_GLOBAL_CORRIENTE, DEFAULT_SOCIO); if ($xPCta->setContarCuenta() == 0) { $msg .= "LA Cuenta por DEFECTO no EXISTE\r\n"; $xPCta->setNuevaCuenta(99, 1, DEFAULT_SOCIO, "", DEFAULT_CREDITO, "", "", DEFAULT_GRUPO, false, 10); $msg .= $xPCta->getMessages("txt"); } $xTb = new cSAFETabla(TCAPTACION_CUENTAS); $SqlCta = $xTb->getQueryInicial() . "\n\t\t\t\tFROM\n\t\t\t\t\t`captacion_cuentas` `captacion_cuentas`\n\t\t\t\t\t\tINNER JOIN `captacion_cuentastipos` `captacion_cuentastipos`\n\t\t\t\t\t\tON `captacion_cuentas`.`tipo_cuenta` = `captacion_cuentastipos`.\n\t\t\t\t\t\t`idcaptacion_cuentastipos`\n\t\t\t\t\t\t\tINNER JOIN `captacion_subproductos` `captacion_subproductos`\n\t\t\t\t\t\t\tON `captacion_cuentas`.`tipo_subproducto` = `captacion_subproductos`\n\t\t\t\t\t\t\t.`idcaptacion_subproductos` "; $rs = getRecordset($SqlCta); while ($rw = mysql_fetch_array($rs)) { $xCta = new cCuentaDeCaptacion($rw["numero_cuenta"], $rw["numero_socio"]); $xCta->init($rw); $msg .= $xCta->setValidar($ForzarCorreccion); //$msg .= $xCta->getMessages("txt"); } return $msg; }
$fechaApertura = $cT->cFecha($datos[2]); $Producto = $cT->cInt($datos[3]); $importe = $cT->cFloat($datos[4]); $observaciones = $cT->cChar($datos[5]); if ($NumCuenta == 0 or $NumCuenta == "") { $NumCuenta = false; } //$ClaveCuenta = false; //Iniciar el Socio //$msg .= "$iReg\t$socio\tERROR_SOCIO\t$socio -- $importe -- $fechaApertura -- $plazo -- $tasa -- $observaciones\r\n"; $xCL = new cCajaLocal(99); if ($xCL->getExistenciaSocio($socio) <= 0) { $msg .= "{$iReg}\t{$socio}\tERROR_SOCIO\tLa Linea({$iReg}) no se leyo por que no existe el socio. (" . substr($bufer, 0, 20) . ")\r\n"; } else { $xCta = new cCuentaALaVista($NumCuenta, $socio, 0, false, $fechaApertura); if ($xCta->setContarCuenta() <= 0) { $xCta = new cCuentaALaVista(false, $socio, 0, false, $fechaApertura); $NumCuenta = $xCta->setNuevaCuenta(99, $Producto, $socio, $observaciones, DEFAULT_CREDITO, "", "", DEFAULT_GRUPO, $fechaApertura, 10); $msg .= "{$iReg}\t{$socio}\tCUENTA\tSe Agrego Exitosamente la cuenta {$NumCuenta} \r\n"; } if ($NumCuenta != false) { if ($importe > 0) { $xCta->init(); $RDeposito = $xCta->setDeposito($importe, DEFAULT_CHEQUE, DEFAULT_TIPO_PAGO, DEFAULT_RECIBO_FISCAL, $observaciones, DEFAULT_GRUPO, $fechaApertura); $msg .= "{$iReg}\t{$socio}\tRECIBO_DEPOSITO\tSe Efectua un Deposito de {$importe} al Recibo {$RDeposito}\r\n"; $msg .= $xCta->getMessages("txt"); } } else { $msg .= "{$iReg}\t{$socio}\tERROR\tSe Fallo al Agregar la Cuenta\r\n"; } }