function jsaSetFecha($recibo, $fecha, $nuevoperiodo) { $xRec = new cReciboDeOperacion(false, true, $recibo); $xF = new cFecha(); $fecha = $xF->getFechaISO($fecha); $xRec->init(); if ($xF->getInt($fecha) != $xF->getInt($xRec->getFechaDeRecibo())) { $xRec->setFecha($fecha, true); } if ($xRec->getPeriodo() != $nuevoperiodo) { $xRec->setPeriodo($nuevoperiodo, true); } return $xRec->getMessages(OUT_HTML); }
function setCambiarFechaMinistracion($fecha) { $xF = new cFecha(0); $solicitud = $this->mNumeroCredito; $reciboMin = $this->getNumeroReciboDeMinistracion(); if ($reciboMin > 0) { $xRec = new cReciboDeOperacion(false, true, $reciboMin); $xRec->init(); $xRec->setFecha($fecha, true); } //eliminar plan de pagos $idPlan = $this->getNumeroDePlanDePagos(); if ($idPlan > 0) { $xPlan = new cPlanDePagos($idPlan); $xPlan->setEliminar(); $this->mMessages .= $xPlan->getMessages(); } //cambiar fecha ministracion if ($xF->getInt($this->mFechaDeAutorizacion) > $xF->getInt($fecha)) { $this->mFechaDeAutorizacion = $fecha; } if ($xF->getInt($this->mFechaDeSolictud) > $xF->getInt($this->mFechaDeAutorizacion)) { $this->mFechaDeSolictud = $this->mFechaDeAutorizacion; } if ($xF->getInt($this->mFechaUltimoMvtoCapital) > $xF->getInt($fecha)) { $this->mFechaUltimoMvtoCapital = $fecha; } //Modificar operaciones de pago con fecha Menor a la fecha de Ministracion my_query("UPDATE operaciones_mvtos SET fecha_afectacion='{$fecha}', fecha_operacion='{$fecha}' WHERE docto_afectado={$solicitud} AND fecha_operacion < '{$fecha}' "); my_query("UPDATE operaciones_recibos SET fecha_operacion='{$fecha}' WHERE docto_afectado={$solicitud} AND fecha_operacion < '{$fecha}'"); // $fecha_corte = fechasys(); //actualizar credito $this->setUpdate(array("fecha_ministracion" => $fecha, "ultimo_periodo_afectado" => 0, "fecha_autorizacion" => $this->mFechaDeAutorizacion, "fecha_solicitud" => $this->mFechaDeSolictud, "fecha_ultimo_mvto" => $this->mFechaUltimoMvtoCapital)); //reestructurar SDPM $msg = $this->setReestructurarIntereses(); $this->setDetermineDatosDeEstatus($fecha_corte); return $msg; }