$xGr = new cGrupo($idgrupo, true);
$xGr->init();
echo $xGr->getFicha(true);
//
$sqlgs = "SELECT codigo, nombrecompleto FROM socios_general WHERE grupo_solidario={$idgrupo} LIMIT 0,100 ";
$rsgs = mysql_query($sqlgs);
echo "<hr /><form name='myformls' action='clsgrupossolidarioscreditos.php?grupo={$idgrupo}' method='post'>\n\t<table   border='0'>\n\t<caption>Nivel de Ministracion {$nivel}<caption>\n\t<tr>\n\t<th>Clave de Persona</th>\n\t<th>Nombre Completo</th>\n\t<th>Monto que se le Autoriza</th>\n\t<th>Observaciones</th>\n\t</tr>";
$foliorec = folios(4);
// Folio de Recibo
$idrecibo = $foliorec;
// Numero de Recibo: user + tipooper + folio obtenido
$i = 0;
while ($rwgs = mysql_fetch_array($rsgs)) {
    $codigo = $rwgs[0];
    $nombre = getNombreSocio($codigo);
    $folioop = folios(2);
    $idoper = $folioop + $i;
    echo "<tr>\n\t\t\t<td>{$codigo}</td>\n\t\t\t<td>{$nombre}</td>\n\t\t\t<td><input type='text' name='monto{$i}' value='{$monto}' class='mny'>\n\t\t\t<input type='hidden' name='idsocio{$i}' value='{$codigo}'>\n\t\t\t<input type='hidden' name='operacion{$i}' value='{$idoper}'>\n\t\t\t<td><input type='text' name='observacion{$i}' value='' size='50'></td>\n\n\t\t</tr>";
    $i++;
}
echo "</table>\n\t<p class='aviso'>Este Grupo Solidario tiene el Nivel {$nivel} para Pasar al Nivel {$pnivel} <br />\n\tLa Planeacion Actual Eliminar&aacute; las anteriores <br />\n\tN&oacute; se Agrega&aacute; la Plenaci&oacute;n si el Credito ya Fue Autorizado</p>\n\t<input type='hidden' name='integrantes' value='{$i}' />\n\t<input type='hidden' name='idrecibo' value='{$idrecibo}' />\n\t<input type='button' name='btsend' value='ALMACENAR PLANEACION DE CREDITO'onClick='envCrypt();' />\n\t<input type='hidden' name='ordencompleta' value='' />\n\t\t</form>";
@mysql_free_result($rsgs);
//--------------------------------------- DATOS DEL RECIBO -----------------------------------------------
// PERIODOS
$percont = EACP_PER_CONTABLE;
// Periodo Contable
$percbza = EACP_PER_COBRANZA;
// Periodo Cobranza.
$perseg = EACP_PER_SEGUIMIENTO;
// Periodo de Seguimiento.
$permens = dnmes();
Exemplo n.º 2
0
         $table .= "<td {$style2}> " . $trd['nSubSerie'] . " </td>";
         $table .= "<td {$style2}> " . $trd['codSub'] . " </td>";
         $table .= "<td {$style2}> " . $trd['AG'] . " </td>";
         $table .= "<td {$style2}> " . $trd['AC'] . " </td>";
         $table .= "<td {$style2}> " . $trd['DISPOSICION'] . " </td>";
         $table .= "<td {$style2}> &thinsp; </td>";
         $table .= "</tr>";
         $vectoreCSV .= "{$consecutivo}," . $dependencias['PADRE'] . "," . $dependencias['HIJO'] . "," . $rs->fields["RADI_DEPE_RADI"] . "," . $rs->fields["SGD_EXP_TITULO"] . " - " . $rs->fields["SGD_EXP_NUMERO"] . ",X,,,," . $fechainifin['INI'] . "," . $fechainifin['FIN'] . "," . $radicados . "," . $resulT . "," . $carp . ",," . $rs->fields["SGD_EXP_ESTANTE"] . ",," . $trd['nSerie'] . "," . $trd['codSerie'] . "," . $trd['nSubSerie'] . "," . $trd['codSub'] . "," . $trd['AG'] . "," . $trd['AC'] . " ," . $trd['DISPOSICION'] . ",\n";
         $resulT = 0;
         $consecutivo++;
         $carp = $rs->fields["CARP"];
         $radicados = $rs->fields["RADI_NUME_RADI"] . " ";
         if ($consecutivo != $consecutivo2) {
             $dependencias = getdepe($db, $rs->fields["RADI_DEPE_RADI"]);
         }
         $suma = folios($db, $rs->fields["RADI_NUME_RADI"]);
         $fechaarray[0] = $rs->fields["SGD_EXP_FECH_ARCH"];
         $countfech = 1;
         $resulT = $rs->fields["RADI_NUME_HOJA"] + $suma;
     }
     $rs->MoveNext();
 }
 $fechainifin = fechaIniFin($fechaarray, $countfech);
 $trd = serie($db, $rs->fields["SGD_EXP_NUMERO"]);
 $table .= "<tr>";
 $table .= "<td {$style2}>" . $consecutivo . "</td>";
 $table .= "<td {$style2}>" . $dependencias["PADRE"] . " </td>";
 $table .= "<td {$style2}>" . $dependencias["HIJO"] . "  </td>";
 $table .= "<td {$style2}>" . $rs->fields["RADI_DEPE_RADI"] . "  </td>";
 $table .= "<td {$style2}>" . $rs->fields["SGD_EXP_TITULO"] . "- " . $rs->fields["SGD_EXP_NUMERO"] . "</td>";
 $table .= "<td {$style2}> X </td>";
 /**
  * @return integer Numero de Operacion
  **/
 function setNuevoMvto($fecha_operacion, $monto, $tipo_operacion, $periodo_de_socio, $observaciones, $signo_afectacion = 1, $mvto_contable = false, $socio = false, $documento = false, $fecha_afectacion = false, $fecha_vencimiento = false, $saldo_anterior = false, $saldo_nuevo = false)
 {
     $sucess = false;
     //inicializa el recibo
     if (!isset($this->mCodigoDeRecibo) or $this->mCodigoDeRecibo == false) {
         //
     }
     //Si no hay valores, obtenerlos del recibo
     if ($documento == false or !isset($documento)) {
         $documento = $this->mDocto;
     }
     if ($socio == false or !isset($socio)) {
         $socio = $this->mSocio;
     }
     //Verificar la Cuenta Bancaria
     if ($this->mCuentaBancaria == false) {
         $this->mCuentaBancaria = DEFAULT_CUENTA_BANCARIA;
     }
     $recibo = $this->mCodigoDeRecibo;
     $fecha_afectacion = $fecha_afectacion == false ? $fecha_operacion : $fecha_afectacion;
     // --------------------------------------- VALOR SQL DEL MVTO.-------------------------------------------------------
     // VALORES FIJOS
     $smf = "idusuario, codigo_eacp, socio_afectado, docto_afectado, recibo_afectado, fecha_operacion, ";
     // PERIODOS
     $smf .= "periodo_contable, periodo_cobranza, periodo_seguimiento, ";
     $smf .= "periodo_anual, periodo_mensual, periodo_semanal, ";
     // AFECTACIONES
     $smf .= "afectacion_cobranza, afectacion_contable, afectacion_estadistica, ";
     $smf .= "afectacion_real, valor_afectacion, ";
     // FECHAS Y TIPOS
     $smf .= "idoperaciones_mvtos, tipo_operacion, estatus_mvto, periodo_socio, ";
     $smf .= "fecha_afectacion, fecha_vcto, ";
     // SALDOS
     $smf .= "saldo_anterior, saldo_actual, detalles, sucursal, tasa_asociada, dias_asociados, grupo_asociado";
     //
     $iduser = $_SESSION["SN_b80bb7740288fda1f201890375a60c8f"];
     $eacp = EACP_CLAVE;
     // PERIODOS
     $percont = EACP_PER_CONTABLE;
     // Periodo Contable
     $percbza = EACP_PER_COBRANZA;
     // Periodo Cobranza.
     $perseg = EACP_PER_SEGUIMIENTO;
     // Period de Seguimiento.
     $permens = date("m", strtotime($fecha_operacion));
     // Periodo mes
     $persem = date("N", strtotime($fecha_operacion));
     // Periodo de dias en la semana.
     $peranual = date("Y", strtotime($fecha_operacion));
     // A�o Natural.
     $persoc = $periodo_de_socio;
     // periodo del Socio.
     $estatus_mvto = $this->mDefMvtoStatus;
     $fecha_vcto = $fecha_vencimiento == false ? $this->mFechaDeVcto : $fecha_vencimiento;
     $saldo_anterior = $saldo_anterior === false ? 0 : $saldo_anterior;
     $saldo_nuevo = $saldo_nuevo === false ? $monto : $saldo_nuevo;
     $sucursal = getSucursal();
     $afect_cbza = $monto;
     $afect_seg = $monto;
     $afect_cont = $monto;
     $afect_esta = $monto;
     $idoperacion = folios(2);
     $tasa = 0;
     $dias = 0;
     $grupo = $this->mGrupoAsociado;
     $viable = true;
     $xT = new cTipos(0);
     if ($this->mGrupoAsociado == false) {
         $grupo = DEFAULT_GRUPO;
     }
     $smv = "{$iduser}, '{$eacp}', {$socio}, {$documento}, {$recibo}, '{$fecha_operacion}',\n\t\t\t\t{$percont}, {$percbza}, {$perseg}, {$peranual}, {$permens}, {$persem},\n\t\t\t\t{$afect_cbza}, {$afect_cont}, {$afect_esta},\n\t\t\t\t{$monto}, {$signo_afectacion},\n\t\t\t\t{$idoperacion}, {$tipo_operacion}, {$estatus_mvto}, {$persoc},\n\t\t\t\t'{$fecha_afectacion}', '{$fecha_vcto}',\n\t\t\t\t{$saldo_anterior}, {$saldo_nuevo}, '{$observaciones}', '{$sucursal}', {$tasa}, {$dias}, {$grupo}\n\t\t\t\t";
     $arrD = array($socio, $documento, $recibo);
     $viable = $xT->getEvalNotNull($arrD);
     if ($viable == false) {
         $this->mMessages .= "ERROR\tVARS\tError al Evaluar alguno de estos Valores Socio {$socio}, Documento {$documento}, Recibo {$recibo}\r\n";
         $this->mMessages .= $xT->getMessages();
     }
     $SQl_comp = "INSERT INTO operaciones_mvtos({$smf}) VALUES ({$smv})\n\t\t\t\t\t\tON DUPLICATE KEY UPDATE idoperaciones_mvtos = " . folios(2) . "\n\t\t\t\t\t";
     if ($monto != 0 and isset($monto) and $this->mAfectar == true and $viable == true) {
         $exec = my_query($SQl_comp);
         if ($exec["stat"] == false) {
             $sucess = false;
             $this->mMessages .= "ERROR\t{$recibo}\tSe Fallo al Agregar la Operacion({$tipo_operacion}) por {$monto} con Numero {$idoperacion}\r\n";
         } else {
             $sucess = true;
             $this->mMessages .= "SUCESS\t{$recibo}\tSe agrego Exitosamente la Operacion({$tipo_operacion}) por {$monto} con Numero {$idoperacion} \r\n";
         }
     } else {
         $this->TxtLog .= "WARNING\tSe simula Agregar el Mvto {$idoperacion} del tipo {$tipo_operacion} por un monto de {$monto} \r\n";
     }
     //Sumar al Recibo el Monto
     $this->mSumaDeRecibo += $monto;
     $this->mNumeroDeMvtos++;
     //
     return $idoperacion;
 }
function setNuevoMvto($socio, $solicitud, $recibo, $fecha_operacion, $monto, $tipo_operacion, $parcialidad, $observaciones, $signo_afectacion = 1)
{
    $sucess = false;
    // --------------------------------------- VALOR SQL DEL MVTO.-------------------------------------------------------
    // VALORES FIJOS
    $smf = "idusuario, codigo_eacp, socio_afectado, docto_afectado, recibo_afectado, fecha_operacion, ";
    // PERIODOS
    $smf .= "periodo_contable, periodo_cobranza, periodo_seguimiento, ";
    $smf .= "periodo_anual, periodo_mensual, periodo_semanal, ";
    // AFECTACIONES
    $smf .= "afectacion_cobranza, afectacion_contable, afectacion_estadistica, ";
    $smf .= "afectacion_real, valor_afectacion, ";
    // FECHAS Y TIPOS
    $smf .= "idoperaciones_mvtos, tipo_operacion, estatus_mvto, periodo_socio, ";
    $smf .= "fecha_afectacion, fecha_vcto, ";
    // SALDOS
    $smf .= "saldo_anterior, saldo_actual, detalles, sucursal, tasa_asociada, dias_asociados";
    //
    $iduser = $_SESSION["SN_b80bb7740288fda1f201890375a60c8f"];
    $eacp = EACP_CLAVE;
    // PERIODOS
    $percont = EACP_PER_CONTABLE;
    // Periodo Contable
    $percbza = EACP_PER_COBRANZA;
    // Periodo Cobranza.
    $perseg = EACP_PER_SEGUIMIENTO;
    // Period de Seguimiento.
    $permens = date("m", strtotime($fecha_operacion));
    // Periodo mes
    $persem = date("W", strtotime($fecha_operacion));
    // Periodo de dias en la semana.
    $peranual = date("Y", strtotime($fecha_operacion));
    // A�o Natural.
    $persoc = $parcialidad;
    // periodo del Socio.
    $estatus_mvto = 30;
    //$signo_afectacion = 1;
    //Obtiene la Afectacion por la afectacion el recibo
    //$sqlTMvto 	= "SELECT afectacion_en_recibo FROM operaciones_tipos WHERE idoperaciones_tipos=$tipo_operacion LIMIT 0,1";
    //$dFils		= obten_filas($sqlTMvto);
    //$signo_afectacion = $dFils["afectacion_en_recibo"];
    if (!$signo_afectacion) {
        $signo_afectacion = 1;
    }
    $fecha_vcto = sumardias($fecha_operacion, DIAS_PAGO_VARIOS);
    $sucursal = getSucursal();
    if ($monto < 0) {
        //$signo_afectacion = -1;
        //$monto = $monto  * -1;
    }
    $afect_cbza = $monto;
    $afect_seg = $monto;
    $afect_cont = $monto;
    $afect_esta = $monto;
    $idoperacion = folios(2);
    $smv = "{$iduser}, '{$eacp}', {$socio}, {$solicitud}, {$recibo}, '{$fecha_operacion}',\r\n\t\t\t\t\t{$percont}, {$percbza}, {$perseg}, {$peranual}, {$permens}, {$persem},\r\n\t\t\t\t\t{$afect_cbza}, {$afect_cont}, {$afect_esta},\r\n\t\t\t\t\t{$monto}, {$signo_afectacion},\r\n\t\t\t\t\t{$idoperacion}, {$tipo_operacion}, {$estatus_mvto}, {$persoc},\r\n\t\t\t\t\t'{$fecha_operacion}', '{$fecha_vcto}',\r\n\t\t\t\t\t0, {$monto}, '{$observaciones}', '{$sucursal}', 0, 0\r\n\t\t\t\t\t";
    $SQl_comp = "INSERT INTO operaciones_mvtos({$smf}) VALUES ({$smv})";
    if ($monto != 0) {
        $exec = my_query($SQl_comp);
        if ($exec["stat"] == false) {
            $sucess = false;
        } else {
            $sucess = true;
        }
    }
    return $sucess;
}