function jsaGetDatosEmpresa($idEmpresa) { $xEmp = new cEmpresas($idEmpresa); $xF = new cFecha(); $ql = new MQL(); $xl = new cSQLListas(); $observaciones = ""; $xEmp->init(); $persona = $xEmp->getClaveDePersona(); $xF = new cFecha(0); $opts = ""; $exT = ""; $periocidad = $xEmp->getPeriocidadPref(); $periodo = $periocidad == CREDITO_TIPO_PERIOCIDAD_SEMANAL ? $xF->semana() : $xF->quincena(); $periodo = intval($xEmp->getPeriodo()) < 1 ? $periodo : intval($xEmp->getPeriodo()); $data = $ql->getDataRecord($xl->getListadoDePeriodoPorEmpresa($idEmpresa)); $variacion = "0"; $fecha_inicial = $xF->getFechaMX(); $fecha_final = $xF->getFechaMX(); $control = 0; $ctrl = "<label for=\"idperiodo\">Periodo {$periodo}</label><input type=\"number\" id=\"idperiodo\" onchange=\"jsGetCobranza()\" onblur=\"jsGetCobranza()\" />"; $contar = 1; $max = 5; foreach ($data as $rw) { $idsel = ""; $idclave = $rw["codigo"]; $xPer = $xEmp->getOPeriodo(false, false, $idclave); if ($periodo == $xPer->periodo_marcado()->v() and $periocidad == $xPer->periocidad()->v()) { $control = $idclave; $periodo = $xPer->periodo_marcado()->v(); $periocidad = $xPer->periocidad()->v(); $fecha_final = $xPer->fecha_final()->v(); $fecha_inicial = $xPer->fecha_inicial()->v(); $idsel = " selected=\"true\" "; } if ($contar <= $max) { $opts .= "<option value=\"" . $idclave . " \"{$idsel}>" . $rw["nombre_periocidad"] . "[" . $xPer->periodo_marcado()->v() . "]"; $opts .= " - DEL: " . $xF->getFechaDDMM($rw["fecha_inicial"]) . " - " . $xF->getFechaDDMM($rw["fecha_final"]) . " SALDO " . getFMoney($rw["saldo"]) . "</option>"; } $contar++; } if ($opts != "") { $ctrl = "<label for='idperiodo'>Periodo</label><select id=\"idperiodo\" name=\"idperiodo\" onblur=\"jsGetCobranza()\" onchange=\"jsGetCobranza()\">{$opts}</select>"; } $ctrl .= "<input type=\"hidden\" id=\"idvariacion\" value=\"{$variacion}\" />"; $ctrl .= "<input type=\"hidden\" id=\"idperiodo\" value=\"{$periodo}\" />"; $ctrl .= "<input type=\"hidden\" id=\"idperiocidad\" value=\"{$periocidad}\" />"; $ctrl .= "<input type=\"hidden\" id=\"idclavedepersona\" value=\"{$periocidad}\" />"; return $ctrl; }
function jsaGetNumeroDeCredito($idsocio) { $xSoc = new cSocio($idsocio); $xSoc->init(); $solicitud = $xSoc->getIDNuevoDocto(iDE_CREDITO); $tab = new TinyAjaxBehavior(); $tab->add(TabSetValue::getBehavior('iidsolicitud', $solicitud)); //tipo de credito y preferencia e pago //Mayo/2014 $xEmp = new cEmpresas($xSoc->getClaveDeEmpresa()); $xEmp->init(); $tab->add(TabSetValue::getBehavior('idtipoconvenio', $xEmp->getProductoPref())); $tab->add(TabSetValue::getBehavior('idperiocidadpagos', $xEmp->getPeriocidadPref())); return $tab->getString(); }
function jsaGetPerfilDeProducto($producto, $persona) { $OConv = new cProductoDeCredito($producto); $OConv->init(); $tab = new TinyAjaxBehavior(); $xSoc = new cSocio($persona); $pagos = $OConv->getNumeroPagosPreferente(); $periocidad = $OConv->getPeriocidadPrefente(); if ($xSoc->init() == true) { if ($xSoc->getClaveDeEmpresa() != FALLBACK_CLAVE_EMPRESA) { $xEmp = new cEmpresas($xSoc->getClaveDeEmpresa()); $xEmp->init(); $tab->add(TabSetValue::getBehavior('idproducto', $xEmp->getProductoPref())); $periocidad = $xEmp->getPeriocidadPref(); } } $tab->add(TabSetValue::getBehavior('idnumerodepagos', $pagos)); $tab->add(TabSetValue::getBehavior('idperiocidad', $periocidad)); return $tab->getString(); }
function jsaInitPeriodo($empresa, $periocidad, $periodo) { $xF = new cFecha(); $xEmp = new cEmpresas($empresa); $xEmp->init(); $tab = new TinyAjaxBehavior(); $DPer = $xEmp->getOPeriodo($periocidad); $empPeriodo = $xEmp->getPeriodo(); if ($periodo > $empPeriodo) { $fechaInicial = $xEmp->getFechaDeAviso($periocidad, false, $periodo, $periodo + 1); } else { $dias_dif = setNoMenorQueCero($periodo - $empPeriodo); $starD = $periocidad * $dias_dif + 1; $fechaInicial = $xF->setSumarDias($starD, $DPer->fecha_final()->v()); } $fechaFinal = $xF->setSumarDias($xEmp->getPeriocidadPref(), $fechaInicial); $tab->add(TabSetvalue::getBehavior("idfecha-10", $xF->getFechaMX($fechaInicial, "-"))); $tab->add(TabSetvalue::getBehavior("idfecha-11", $xF->getFechaMX($fechaFinal, "-"))); return $tab->getString(); }
function addTransaccionalidadPorEmpresa($empresa, $monto, $fecha = false) { $xEmp = new cEmpresas($empresa); $monto = setNoMenorQueCero($monto); if ($xEmp->init() == true) { $pais = EACP_CLAVE_DE_PAIS; $numero = ceil(setNoMenorQueCero(365 / $xEmp->getPeriocidadPref() / 12)) + 1; //$xEmp->getOPersona(); if ($monto > 0 and $numero > 0) { $monto = $monto * 2; $numero = $numero * 2; $this->setGuardarPerfilTransaccional(AML_OPERACIONES_PAGOS_EFVO, $pais, $monto, $numero, "Generado de la Empresa {$empresa}", $fecha); //$this->setGuardarPerfilTransaccional(AML_OPERACIONES_PAGOS_EFVO, $pais, $monto, $numero, "Generado de la Empresa $empresa", $fecha); //deposito bancario } } }
$xOEmp->query()->update()->save($empresa); $xEmp = new cEmpresas($empresa); $xEmp->init(); $xEmp->setActualizarPorPersona(); $msg .= $xEmp->getMessages(); } if (setNoMenorQueCero($empresa) > 0) { $xEmp = new cEmpresas($empresa); $xEmp->init(); if ($xEmp->isInit() == true) { $alias = $xEmp->getNombreCorto(); //$iddirectivo= $iddirectivo = $xEmp->getClaveDeContacto(); $directivo = $xEmp->getNombreContacto(); $idsocio = $xEmp->getClaveDePersona(); $periocidad1 = $xEmp->getPeriocidadPref(); $lstPeriodos = $xEmp->getListaDePeriocidad(); $periocidad2 = isset($lstPeriodos[1]) ? $lstPeriodos[1] : $periocidad1; $producto = $xEmp->getProductoPref(); $mails = $xEmp->getEmailsDeEnvio(); $oficial = $xEmp->getClaveDeOficial(); $mail1 = isset($mails[0]) ? $mails[0] : ""; $mail2 = isset($mails[1]) ? $mails[1] : ""; $mail3 = isset($mails[2]) ? $mails[2] : ""; $diasaviso1 = $xEmp->getDiasDeAviso($periocidad1, MQL_STRING); $diasaviso2 = $xEmp->getDiasDeAviso($periocidad2, MQL_STRING); $diasnomina1 = $xEmp->getDiasDeNomina($periocidad1, MQL_STRING); $diasnomina2 = $xEmp->getDiasDeNomina($periocidad2, MQL_STRING); $diaspago1 = $xEmp->getDiasDePago($periocidad1, MQL_STRING); $diaspago2 = $xEmp->getDiasDePago($periocidad2, MQL_STRING); $step = MQL_MOD;