public function initcontrolsAction() { try { $EntityManagerPlugin = $this->EntityManagerPlugin(); $GrupoPrecioCabBO = new GrupoPrecioCabBO(); $ProductoBO = new ProductoBO(); $ColorVentasBO = new ColorVentasBO(); $GrupoPrecioCabBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $ProductoBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $ColorVentasBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $SesionUsuarioPlugin = $this->SesionUsuarioPlugin(); $SesionUsuarioPlugin->isLoginAdmin(); $body = $this->getRequest()->getContent(); $json = json_decode($body, true); $opcion = $json['opcion']; switch ($opcion) { case 'panel-precio': $grupo_dispo_1er_elemento = $json['grupo_dispo_1er_elemento']; $producto_1er_elemento = $json['producto_1er_elemento']; $color_ventas_1er_elemento = $json['color_ventas_1er_elemento']; $tipo_precio_1er_elemento = ''; $grupo_precio_cab_id = null; $producto_id = null; $variedad_id = null; $grado_id = null; $color_ventas_id = null; $grupo_precio_opciones = $GrupoPrecioCabBO->getComboGrupoPrecio($grupo_precio_cab_id, $grupo_dispo_1er_elemento); $producto_opciones = $ProductoBO->getComboProductoId($producto_id, $producto_1er_elemento); $tipo_precio_opciones = $GrupoPrecioCabBO->getComboTipoPrecio('', $tipo_precio_1er_elemento); $color_ventas_opciones = $ColorVentasBO->getCombo($color_ventas_id, $color_ventas_1er_elemento); //$variedad_opciones = $VariedadBO->getCombo($variedad_id); $response = new \stdClass(); $response->grupo_precio_opciones = $grupo_precio_opciones; $response->tipo_precio_opciones = $tipo_precio_opciones; $response->color_ventas_opciones = $color_ventas_opciones; $response->respuesta_code = 'OK'; break; } //end switch $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; } }
public function nuevodataAction() { try { $SesionUsuarioPlugin = $this->SesionUsuarioPlugin(); $EntityManagerPlugin = $this->EntityManagerPlugin(); $VariedadBO = new VariedadBO(); $ColoresBO = new ColoresBO(); $ProductoBO = new ProductoBO(); $GrupoColorBO = new GrupoColorBO(); $CalidadVariedadBO = new CalidadVariedadBO(); $ObtentorBO = new ObtentorBO(); $TamanoBunchBO = new TamanoBunchBO(); $ColorVentasBO = new ColorVentasBO(); $VariedadBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $ColoresBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $ProductoBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $GrupoColorBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $CalidadVariedadBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $ObtentorBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $TamanoBunchBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $ColorVentasBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $respuesta = $SesionUsuarioPlugin->isLoginAdmin(); if ($respuesta == false) { return false; } $colorbase = null; $calidad_variedad_id = null; $cultivada = null; $id = null; $solido = 'S'; $es_real = 'S'; $obtentor = null; $tamano_bunch_id = null; $color_ventas_id = null; $response = new \stdClass(); $response->cbo_color_base = $ColoresBO->getCombo($colorbase, "<Seleccione>"); $response->cbo_color = $ColoresBO->getCombo($colorbase, "<Seleccione>"); $response->cbo_color2 = $ColoresBO->getCombo($colorbase, "<Seleccione>"); $response->cbo_grupo_color_id = $GrupoColorBO->getComboId($id, "<Seleccione>"); $response->cbo_calidad_variedad_id = $CalidadVariedadBO->getComboCalidadVariedad($calidad_variedad_id, "<Seleccione>"); $response->cbo_solido = $VariedadBO->getComboSolido($solido, "<Seleccione>"); $response->cbo_es_real = $VariedadBO->getComboEsReal($es_real, "<Seleccione>"); $response->cbo_cultivada = $VariedadBO->getComboCultivada($cultivada, "<Seleccione>"); $response->cbo_obtentor_id = $ObtentorBO->getComboObtentor($obtentor, "<Seleccione>"); $response->cbo_color_ventas = $ColorVentasBO->getCombo($color_ventas_id, "<Seleccione>"); $response->cbo_producto_id = $ProductoBO->getComboProductoId($id, "<Seleccione>"); $response->cbo_tamano_bunch = $TamanoBunchBO->getCombo($tamano_bunch_id, "<Seleccione>"); $response->cbo_estado = \Application\Classes\ComboGeneral::getComboEstado("", ""); $response->respuesta_code = 'OK'; $response->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; } }
public function getcombosofertasAction() { try { $EntityManagerPlugin = $this->EntityManagerPlugin(); $config = $this->getServiceLocator()->get('Config'); $GrupoPrecioCabBO = new GrupoPrecioCabBO(); $ProductoBO = new ProductoBO(); $GradoBO = new GradoBO(); $SesionUsuarioPlugin = $this->SesionUsuarioPlugin(); $SesionUsuarioPlugin->isLoginAdmin(); $GrupoPrecioCabBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $ProductoBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $GradoBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $body = $this->getRequest()->getContent(); $json = json_decode($body, true); $grupo_precio_cab_id = $json['grupo_precio_cab_id']; $producto_combo_id = $json['producto_combo_id']; $variedad_id = null; $grado_id = null; $producto_combo_1er_elemento = $json['producto_combo_1er_elemento']; $producto_opciones = $ProductoBO->getComboProductoId($producto_combo_id, $producto_combo_1er_elemento); $variedad_opciones = $GrupoPrecioCabBO->getComboVariedad($producto_combo_id, $variedad_id, $grupo_precio_cab_id); $grado_opciones = $GradoBO->getCombo($grado_id); $response = new \stdClass(); $response->producto_opciones = $producto_opciones; $response->variedad_opciones = $variedad_opciones; $response->grado_opciones = $grado_opciones; $response->respuesta_code = 'OK'; $response->validacion_code = 'OK'; $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; } }