function jsaGetLetras($idcredito) { $idcred = setNoMenorQueCero($idcredito); $xF = new cFecha(); if ($idcred > DEFAULT_CREDITO) { $xCred = new cCredito($idcred); $xCred->init(); if ($xCred->getEsAfectable() == false or $xCred->getSaldoActual() <= 0) { if (MODO_CORRECION == true) { $xTxt = new cHText(); $xTxt->setDivClass(""); return $xTxt->getNumero("idparcialidad", $xCred->getPeriodoActual() + 1, "TR.Numero de Parcialidad"); } else { return $xCred->getMessages(); } } else { if ($xCred->getPeriocidadDePago() == CREDITO_TIPO_PERIOCIDAD_FINAL_DE_PLAZO) { // $xTxt = new cHText(); $xTxt->setDivClass(""); return $xTxt->getNumero("idparcialidad", $xCred->getPeriodoActual() + 1, "TR.Numero de Parcialidad"); } else { $plan = $xCred->getNumeroDePlanDePagos(); if ($plan != false) { $xPlan = new cPlanDePagos($plan); $xPlan->init(); $parcs = $xPlan->getParcsPendientes(); //$txt = ""; $arrD = array(); foreach ($parcs as $p) { //setLog( $p[SYS_NUMERO]. " " . $xF->getFechaDDMM($p[SYS_FECHA]) . " ". getFMoney($p[SYS_TOTAL])); if (setNoMenorQueCero($p[SYS_TOTAL]) > 0) { $arrD[$p[SYS_NUMERO]] = $p[SYS_NUMERO] . " " . $xF->getFechaDDMM($p[SYS_FECHA]) . " " . getFMoney($p[SYS_TOTAL]); } } $xSel = new cHSelect(); $xSel->addOptions($arrD); $xSel->setEnclose(false); return $xSel->get("idparcialidad", "TR.Numero de Parcialidad", $xCred->getPeriodoActual() + 1); } else { if (MODO_CORRECION == true) { $xTxt = new cHText(); $xTxt->setDivClass(""); return $xTxt->getNumero("idparcialidad", $xCred->getPeriodoActual() + 1, "TR.Numero de Parcialidad"); } } } } } }
$xFRM->addFootElement('<input type="hidden" name="MAX_FILE_SIZE" value="1024000">'); echo $xFRM->get(); } else { $doc1 = isset($_FILES["f1"]) ? $_FILES["f1"] : false; $observaciones = isset($DDATA["idobservaciones"]) ? $DDATA["idobservaciones"] : ""; $xFil = new cFileImporter(); //var_dump($_FILES["f1"]); if ($xFil->processFile($doc1) == true) { $data = $xFil->getData(); $xPlan = new cPlanDePagos(); //eliminar credito $xCred = new cCredito($credito); $xCred->init(); $fecha_operacion = $xCred->getFechaDeMinistracion(); if ($xCred->getNumeroDePlanDePagos() != false) { $xPlan->init($xCred->getNumeroDePlanDePagos()); $xPlan->setEliminar(); } $xPlan->initByCredito($credito); $xPlan->setClaveDeCredito($credito); $xPlan->setClaveDePersona($xCred->getClaveDePersona()); $idrecibo = $xPlan->add($observaciones, $fecha_operacion); $xPlan->init($idrecibo); foreach ($data as $valores => $cont) { //periodo fecha saldo_inicial intereses impuesto capital pago_total saldo_final //0 1 2 3 4 5 6 7 //Periodo,Fecha de Pago,Saldo inicial,Intereses,Impuesto,Pago a Capital,Pago Total,Saldo final if ($xT->cInt($cont[0]) > 0) { $interes = $xT->cFloat($cont[3], 2); $fecha = $xF->getFechaISO($cont[1]); $periodo = $xT->cInt($cont[0]);
$sucess = false; } //Si los dias entre la Ministracion y la fecha de Primer abono superan a la periocidad mas la tolerancia: Salir if (restarfechas($fecha_primer_abono, $fecha_ministracion) > $dias_tolerancia_no_pago + $PERIOCIDAD_DE_PAGO and $tipo_de_plan == 99) { $msgAlertas .= "ERROR\tLOS DIAS DEL PRIMER ABONO NO DEBEN SER MAYORES A {$dias_tolerancia_no_pago} MAS LA PERIOCIDAD DE {$PERIOCIDAD_DE_PAGO}\r\n"; $sucess = false; } //--------------------------------- END ELIMINACION if (date("Y-m-d", strtotime($fecha_primer_abono)) <= date("Y-m-d", strtotime($fecha_ministracion))) { $msgAlertas .= "ERROR\tLA FECHA DEL PRIMER ABONO({$fecha_primer_abono}) NO PUEDE SER LA MISMA O MENOR QUE LA FECHA DE MINISTRACION({$fecha_ministracion})\r\n"; $sucess = false; } //---------------------------------- ELIMINAR EL PLAN DE PAGOS ANTERIOR $xPlan = new cPlanDePagos(); if ($xCred->getNumeroDePlanDePagos() != false) { $xPlan->init($xCred->getNumeroDePlanDePagos()); $xPlan->setEliminar(); } if (MODO_CORRECION == true) { //my_query("DELETE FROM operaciones_mvtos WHERE socio_afectado=$socio AND docto_afectado=$solicitud AND (tipo_operacion=410 OR tipo_operacion=412 OR tipo_operacion=413)"); } if ($sucess == true) { $FInteres_normal = new cFormula("interes_normal"); $factor_interes = $xPlan->getFactorIVA($iva_incluido); $DatosDePagos = array(); if ($xCred->initPagosEfectuados() == true) { $DatosDePagos = $xCred->getListadoDePagos(); } //=========================== Corrige el Monto extra de bonificaciones ================================================================ $bonificaciones = 0; $xB = new cBases(7022);
header("location:../404.php?i=999"); } $_SESSION["current_file"] = addslashes($theFile); //<===== FIN_H //===================================================================================================== $xInit = new cHPage("", HP_SERVICE); $txt = ""; $ql = new MQL(); $lis = new cSQLListas(); $xF = new cFecha(); //$persona = parametro("persona", DEFAULT_SOCIO, MQL_INT); $credito = parametro("credito", DEFAULT_CREDITO, MQL_INT); $letra = parametro("letra", false, MQL_INT); //$tipo = parametro("tipo", false, MQL_INT); $rs = array(); if ($credito != DEFAULT_CREDITO) { //$xSoc = new cSocio($persona); $xSoc->init(); $xCred = new cCredito($credito); $xCred->init(); $plan = $xCred->getNumeroDePlanDePagos(); //letra //monto $xPlan = new cPlanDePagos($plan); $xPlan->init(); //$D = $xPlan->getDatosDeParcialidad($letra); $D = $xPlan->getOLetra($letra); $rs[SYS_MONTO] = $D->getMonto(); } //header('Content-type: application/json'); //echo json_encode($rs); //setLog(json_encode($rs)); //setLog($sql);