function grabarstockproveedorAction() { try { $SesionUsuarioPlugin = $this->SesionUsuarioPlugin(); $EntityManagerPlugin = $this->EntityManagerPlugin(); $usuario_id = $SesionUsuarioPlugin->getUsuarioId(); //$config = $this->getServiceLocator()->get('Config'); $DispoBO = new DispoBO(); $DispoBO->setEntityManager($EntityManagerPlugin->getEntityManager()); if ($SesionUsuarioPlugin->isLoginAdmin() == false && $SesionUsuarioPlugin->isPerfil(\Application\Constants\Perfil::ID_DISPO) == false) { return false; } //end if /* $respuesta = $SesionUsuarioPlugin->isLoginAdmin(); if ($respuesta==false) return false; */ $body = $this->getRequest()->getContent(); $json = json_decode($body, true); $inventario_id = $json['inventario_id']; $producto = 'ROS'; $clasifica_fox = $json['clasifica_fox']; $proveedor_id = $json['proveedor_id']; $variedad_id = $json['variedad_id']; $grado_id = $json['grado_id']; $tallos_x_bunch = $json['tallos_x_bunch']; $stock['AGR'] = $json['stock_agr']; $stock['HTC'] = $json['stock_htc']; $stock['LMA'] = $json['stock_lma']; $result = $DispoBO->actualizarStock($inventario_id, $producto, $clasifica_fox, $proveedor_id, $variedad_id, $grado_id, $tallos_x_bunch, $stock, $usuario_id); //Retorna la informacion resultante por JSON $response = new \stdClass(); $response->respuesta_code = 'OK'; $response->validacion_code = $result['validacion_code']; $response->respuesta_mensaje = $result['respuesta_mensaje']; $json = new JsonModel(get_object_vars($response)); return $json; //false } catch (\Exception $e) { $excepcion_msg = utf8_encode($this->ExcepcionPlugin()->getMessageFormat($e)); $response = $this->getResponse(); $response->setStatusCode(500); $response->setContent($excepcion_msg); return $response; } }