if (isset($_SESSION['cuenta_auxiliar'])) { $cuenta_auxiliar = unserialize($_SESSION['cuenta_auxiliar']); if ($get->subcuenta != "" && $get->id != "" && $get->nombre != "" && $get->descripcion != "" && $get->ajuste != "" && $get->reqta != "" && $get->estado != "") { $get->subcuenta = strtoupper(base64_decode($get->subcuenta)); $get->id = strtoupper(base64_decode($get->id)); $get->nombre = strtoupper(base64_decode($get->nombre)); $get->descripcion = base64_decode($get->descripcion); $get->ajuste = base64_decode($get->ajuste); $get->reqta = base64_decode($get->reqta); $get->estado = base64_decode($get->estado); $gbd = new Conexion(); $operation = $cuenta_auxiliar->actualizar($get->nombre, $get->descripcion, $get->ajuste, $get->reqta, $get->estado, $get->subcuenta, $get->id, $gbd); if ($operation['ejecution'] && $operation['result']) { $operation['message'] = "Se modifico correctamente la información."; $log = Log::registro($usuario->getID(), "info", "Modificación de información. - Cuenta Auxiliar. {" . $get->nombre . ", " . $get->descripcion . ", " . $get->ajuste . ", " . $get->reqta . ", " . $get->estado . ", " . $get->subcuenta . ", " . $get->id . "}", $gbd); $cuenta_auxiliar = new PUCCuentaAuxiliar($get->id, $gbd); $cuenta_auxiliar->cargarSubcuenta($gbd); $subcuenta = $cuenta_auxiliar->getSubcuenta(); $subcuenta->cargarCuenta($gbd); $cuenta = $subcuenta->getCuenta(); $cuenta->cargarGrupo($gbd); $grupo = $cuenta->getGrupo(); $grupo->cargarClase($gbd); $_SESSION['cuenta_auxiliar'] = serialize($cuenta_auxiliar); } elseif (!$operation['ejecution']) { $log = Log::registro($usuario->getID(), "error", "Modificación de información. - Cuenta Auxiliar. {" . $get->nombre . ", " . $get->descripcion . ", " . $get->ajuste . ", " . $get->reqta . ", " . $get->estado . ", " . $get->subcuenta . ", " . $get->id . "} - {" . $operation['error'] . "}", $gbd); } } else { $operation['ejecution'] = true; $operation['result'] = false; $operation['message'] = "Por favor diligencie los todos los campos del formulario.";
$resultado[$i]['tipo'] = "subcuenta"; } $suboperation = PUCCuentaAuxiliar::listar($resultado[$i]['id'], $gbd); if ($suboperation['result']) { $resultado[$i]['subentity'] = "cuenta_auxiliar"; } $i++; } $operation['result'] = $resultado; } } echo json_encode($operation); } if ($get->entity == "cuenta_auxiliar") { $gbd = new Conexion(); $operation = PUCCuentaAuxiliar::listar($get->id, $gbd); if ($operation['ejecution']) { if ($operation['result']) { $i = 0; foreach ($operation['result'] as $fila) { $resultado[$i]['id'] = $fila['cntaux_id']; $resultado[$i]['nombre'] = $fila['nombre']; $resultado[$i]['descripcion'] = $fila['descripcion']; $resultado[$i]['nativa'] = false; if (!$resultado[$i]['nativa']) { $resultado[$i]['tipo'] = "cuenta_auxiliar"; } $i++; } $operation['result'] = $resultado; }