public function getcajasofertasAction() { try { $EntityManagerPlugin = $this->EntityManagerPlugin(); $SesionUsuarioPlugin = $this->SesionUsuarioPlugin(); $SesionUsuarioPlugin->isLoginClienteVendedor(); $DispoBO = new DispoBO(); $DispoBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $body = $this->getRequest()->getContent(); $json = json_decode($body, true); $oferta_tipo_caja_id = $json['oferta_tipo_caja_id']; $ofertas_producto_id = $json['oferta_producto_id']; $oferta_variedad_id = $json['oferta_variedad_id']; $oferta_grado_id = $json['oferta_grado_id']; $oferta_tallos_x_bunch = $json['oferta_tallos_x_bunch']; $oferta_nro_caja = $json['oferta_nro_caja']; //Se pregunta si se ha seleccionado una marcacion y una agencia, caso contrario lo rutea //para obligarlo a seleccionar $marcacion_id = $SesionUsuarioPlugin->getClienteSeleccionMarcacionSec(); $agencia_id = $SesionUsuarioPlugin->getClienteSeleccionAgenciaId(); //Se consulta la dispo, considerando los criterios de busqueda $cliente_id = $SesionUsuarioPlugin->getUserClienteId(); $cliente_usuario_id = $SesionUsuarioPlugin->getClienteUsuarioId(); $marcacion_sec = $SesionUsuarioPlugin->getClienteSeleccionMarcacionSec(); $result_hueso = $DispoBO->consultarPrecioOfertaPorClienteHueso($cliente_id, $cliente_usuario_id, $marcacion_sec, $ofertas_producto_id, $oferta_variedad_id, $oferta_grado_id, $oferta_tallos_x_bunch, $oferta_tipo_caja_id, $oferta_nro_caja); $response = new \stdClass(); $response->respuesta_code = 'OK'; $response->respuesta_mensaje = ''; //$result['respuesta_msg']; $response->respuesta_codex = 'OK'; //$result['respuesta_code']; $response->result = $result_hueso; $json = new JsonModel(get_object_vars($response)); return $json; } catch (\Exception $e) { $excepcion_msg = utf8_encode($this->ExcepcionPlugin()->getMessageFormat($e)); $response = $this->getResponse(); $response->setStatusCode(500); $response->setContent($excepcion_msg); return $response; } }