function jsaHeredarDatos($idcuenta) { $tab = new TinyAjaxBehavior(); $xLog = new cCoreLog(); $xCta = new cCuentaContable($idcuenta); $cuenta = ""; $nombre = ""; $superior = ""; $nombresupe = ""; $tipo = ""; $nivel = ""; $centro = ""; $superiorf = ""; $operar = 0; $equivale = ""; if ($xCta->init() == true) { $cuenta = $xCta->get(); $nombre = $xCta->getNombre(); $superior = $xCta->getInmediatoSuperior(); $nivel = $xCta->getDigitoAgrupador(); $centro = $xCta->getCentroDeCosto(); $tipo = $xCta->getTipoDeCuenta(); $operar = 1; $xLog->add("OK\tModificar la cuenta {$idcuenta} - {$operar} - {$superior}\r\n"); $equivale = $xCta->getEquivalencia(); } else { $xEsq = new cCuentaContableEsquema($idcuenta); $cuenta = $xEsq->CUENTA; $superior = $xEsq->CUENTA_SUPERIOR; $nivel = $xEsq->NIVEL_ACTUAL; $xLog->add("OK\tAgregar Nueva cuenta {$idcuenta} ({$cuenta}) - {$superior}\r\n"); } $xLog->add($xCta->getMessages(), $xLog->DEVELOPER); //inicializar superior if ($nivel > 1) { $xSup = new cCuentaContable($superior); if ($xSup->init() == true) { $tipo = $tipo == "" ? $xSup->getTipoDeCuenta() : $tipo; $centro = $centro == "" ? $xSup->getCentroDeCosto() : $centro; $superiorf = $xSup->getCuentaCompleta($superior, true); $nombresupe = $xSup->getNombre(); if ($operar == 0) { $equivale = $xSup->getEquivalencia(); } } $xLog->add($xSup->getMessages(), $xLog->DEVELOPER); } $tab->add(TabSetvalue::getBehavior('idcuenta', $cuenta)); $tab->add(TabSetvalue::getBehavior('idnombrecuenta', $nombre)); $tab->add(TabSetvalue::getBehavior('idtipodecuentacontable', $tipo)); $tab->add(TabSetvalue::getBehavior('idcentrodecosto', $centro)); $tab->add(TabSetvalue::getBehavior('idcuentasuperior', $superiorf)); $tab->add(TabSetvalue::getBehavior('idnombresuperior', $nombresupe)); $tab->add(TabSetvalue::getBehavior('idoperacion', $operar)); $tab->add(TabSetvalue::getBehavior('idequivalencia', $equivale)); $tab->add(TabSetvalue::getBehavior('idmsg3', $xLog->getMessages())); return $tab->getString(); }
$xFi->setDataRow($rows); $cuenta = $xFi->getV($tmp->CUENTA, ""); $xCCont = new cCuentaContable($cuenta); $DetNivel = $xCCont->determineNivel($cuenta); $sucess = true; $naturaleza = $xFi->getV($tmp->NATURALEZA, false); $nivel = $xFi->getV($tmp->NIVEL, 0, MQL_INT); $nombre = ""; $nombre .= isset($rows[3]) ? $rows[3] : ""; $nombre .= isset($rows[4]) ? $rows[4] : ""; $nombre .= isset($rows[5]) ? $rows[5] : ""; $nombre .= isset($rows[6]) ? $rows[6] : ""; $nombre .= isset($rows[7]) ? $rows[7] : ""; $nombre .= isset($rows[8]) ? $rows[8] : ""; $nombre = trim($nombre); $superior = $xCCont->getInmediatoSuperior(); $cuenta = $xCCont->getCuentaCompleta($cuenta); //$nombre = trim( $rows[$tmp->CTA1] . $rows[$tmp->CTA2] . $rows[$tmp->CTA3] . $rows[$tmp->CTA4] . $rows[$tmp->CTA5] ); //$nombre = trim($xFi->getV($tmp->CTA1, "", MQL_RAW) . $xFi->getV($tmp->CTA2, "", MQL_RAW) . $xFi->getV($tmp->CTA3, "", MQL_RAW) . $xFi->getV($tmp->CTA4, "", MQL_RAW) . $xFi->getV($tmp->CTA5, "", MQL_RAW) ); $nombre = $xT->setNoAcentos($nombre); $nombre = str_replace("'", "", $nombre); $nombre = strtoupper($nombre); if ($DetNivel != $nivel) { $msg .= "ERROR\t{$conteo}\t[{$DetNivel}]\t({$nivel})\t{$cuenta}\t{$superior}\t{$nombre}\r\n"; $sucess = false; } else { $msg .= "OK\t{$conteo}\t[{$DetNivel}]\t({$nivel})\t{$cuenta}\t{$superior}\t{$nombre}\r\n"; $sucess = true; } if ($sucess == true and $action == MQL_ADD) { if (setNoMenorQueCero($cuenta) > 0) {