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 consultardataAction()
 {
     try {
         $SesionUsuarioPlugin = $this->SesionUsuarioPlugin();
         $EntityManagerPlugin = $this->EntityManagerPlugin();
         $VariedadBO = new VariedadBO();
         $ObtentorBO = new ObtentorBO();
         $ColoresBO = new ColoresBO();
         $CalidadVariedadBO = new CalidadVariedadBO();
         $GrupoColorBO = new GrupoColorBO();
         $TamanoBunchBO = new TamanoBunchBO();
         $ColorVentasBO = new ColorVentasBO();
         $VariedadBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $ColoresBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $CalidadVariedadBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $ObtentorBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $GrupoColorBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $TamanoBunchBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $ColorVentasBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $respuesta = $SesionUsuarioPlugin->isLoginAdmin();
         if ($respuesta == false) {
             return false;
         }
         $body = $this->getRequest()->getContent();
         $json = json_decode($body, true);
         $variedad_id = $json['variedad_id'];
         $row = $VariedadBO->consultar($variedad_id, \Application\Constants\ResultType::MATRIZ);
         $response = new \stdClass();
         $response->row = $row;
         $response->cbo_color_base = $ColoresBO->getCombo($row['colorbase'], "<Seleccione>");
         $response->cbo_color = $ColoresBO->getCombo($row['color'], "<Seleccione>");
         $response->cbo_color2 = $ColoresBO->getCombo($row['color2'], "<Seleccione>");
         $response->cbo_grupo_color_id = $GrupoColorBO->getComboId($row['grupo_color_id'], "<Seleccione>");
         $response->cbo_calidad_variedad_id = $CalidadVariedadBO->getComboCalidadVariedad($row['calidad_variedad_id'], "<Seleccione>");
         $response->cbo_solido = $VariedadBO->getComboSolido($row['solido'], "<Seleccione>");
         $response->cbo_es_real = $VariedadBO->getComboEsReal($row['es_real'], "<Seleccione>");
         $response->cbo_cultivada = $VariedadBO->getComboCultivada($row['cultivada'], "<Seleccione>");
         $response->cbo_obtentor_id = $ObtentorBO->getComboObtentor($row['obtentor_id'], "<Seleccione>");
         $response->cbo_color_ventas = $ColorVentasBO->getCombo($row['color_ventas_id'], "<Seleccione>");
         $response->cbo_tamano_bunch = $TamanoBunchBO->getCombo($row['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 initcontrolsAction()
 {
     try {
         $EntityManagerPlugin = $this->EntityManagerPlugin();
         $SesionUsuarioPlugin = $this->SesionUsuarioPlugin();
         if ($SesionUsuarioPlugin->isLoginAdmin() == false && $SesionUsuarioPlugin->isPerfil(\Application\Constants\Perfil::ID_DISPO) == false) {
             exit;
         }
         //end if
         $body = $this->getRequest()->getContent();
         $json = json_decode($body, true);
         $opcion = $json['opcion'];
         switch ($opcion) {
             case 'panel-grupo-clientes':
             case 'panel-control-disponibilidad':
                 $GrupoDispoCabBO = new GrupoDispoCabBO();
                 $ColorVentasBO = new ColorVentasBO();
                 $CalidadVariedadBO = new CalidadVariedadBO();
                 $GrupoDispoCabBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 $ColorVentasBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 $CalidadVariedadBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 $grupo_dispo_1er_elemento = $json['grupo_dispo_1er_elemento'];
                 $color_ventas_1er_elemento = $json['color_ventas_1er_elemento'];
                 $calidad_variedad_1er_elemento = $json['calidad_variedad_1er_elemento'];
                 $grupo_dispo_cab_id = null;
                 $color_ventas_id = null;
                 $calidad_variedad_id = null;
                 $grupo_dispo_opciones = $GrupoDispoCabBO->getComboGrupoDispo($grupo_dispo_cab_id, $grupo_dispo_1er_elemento);
                 $color_ventas_opciones = $ColorVentasBO->getCombo($color_ventas_id, $color_ventas_1er_elemento);
                 $calidad_variedad_opciones = $CalidadVariedadBO->getComboCalidadVariedad($calidad_variedad_id, $calidad_variedad_1er_elemento);
                 $response = new \stdClass();
                 $response->grupo_dispo_opciones = $grupo_dispo_opciones;
                 $response->color_ventas_opciones = $color_ventas_opciones;
                 $response->calidad_variedad_opciones = $calidad_variedad_opciones;
                 $response->respuesta_code = 'OK';
                 break;
                 /*				case 'panel-control-mantenimiento':
                 					$InventarioBO		= new InventarioBO();					
                 					$CalidadBO			= new CalidadBO();
                 					
                 					$InventarioBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 					$CalidadBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 					
                 					$inventario_1er_elemento	= $json['inventario_1er_elemento'];
                 					$inventario_id				= null;
                 					$calidad_1er_elemento	= $json['calidad_1er_elemento'];
                 					$calidad_id				= null;
                 					
                 					$inventario_opciones  	= $InventarioBO->getCombo($inventario_id, $inventario_1er_elemento);
                 					$calidad_opciones 	 	= $CalidadBO->getComboCalidad($calidad_id, $calidad_1er_elemento);
                 					
                 					$response = new \stdClass();
                 					$response->inventario_opciones		= $inventario_opciones;
                 					$response->calidad_opciones			= $calidad_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 initcontrolsAction()
 {
     try {
         $EntityManagerPlugin = $this->EntityManagerPlugin();
         $SesionUsuarioPlugin = $this->SesionUsuarioPlugin();
         $SesionUsuarioPlugin->isLoginAdmin();
         $body = $this->getRequest()->getContent();
         $json = json_decode($body, true);
         $opcion = $json['opcion'];
         switch ($opcion) {
             case 'panel-control-disponibilidad':
                 $InventarioBO = new InventarioBO();
                 $CalidadBO = new CalidadBO();
                 $ProveedorBO = new ProveedorBO();
                 $ColorVentasBO = new ColorVentasBO();
                 $CalidadVariedadBO = new CalidadVariedadBO();
                 $InventarioBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 $CalidadBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 $ProveedorBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 $ColorVentasBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 $CalidadVariedadBO->setEntityManager($EntityManagerPlugin->getEntityManager());
                 $inventario_1er_elemento = $json['inventario_1er_elemento'];
                 $calidad_1er_elemento = $json['calidad_1er_elemento'];
                 $proveedor_1er_elemento = $json['proveedor_1er_elemento'];
                 $color_ventas_1er_elemento = $json['color_ventas_1er_elemento'];
                 $inventario_id = $json['inventario_id'];
                 $calidad_variedad_1er_elemento = $json['calidad_variedad_1er_elemento'];
                 $nro_tallos_1er_elemento = $json['nro_tallos_1er_elemento'];
                 $buscar_proveedor_id = null;
                 if (array_key_exists('buscar_proveedor_id', $json)) {
                     $buscar_proveedor_id = $json['buscar_proveedor_id'];
                 }
                 //end if
                 $clasifica_fox = null;
                 $proveedor_id = null;
                 $color_ventas_id = null;
                 $calidad_variedad_id = null;
                 $nro_tallos = null;
                 $inventario_opciones = $InventarioBO->getCombo($inventario_id, $inventario_1er_elemento);
                 $calidad_opciones = $CalidadBO->getComboCalidadFox($clasifica_fox, $calidad_1er_elemento);
                 $proveedor_opciones = $ProveedorBO->getCombo($proveedor_id, $proveedor_1er_elemento, null, $buscar_proveedor_id);
                 $color_ventas_opciones = $ColorVentasBO->getCombo($color_ventas_id, $color_ventas_1er_elemento);
                 $calidad_variedad_opciones = $CalidadVariedadBO->getComboCalidadVariedad($calidad_variedad_id, $calidad_variedad_1er_elemento);
                 $nro_tallos_opciones = \Application\Classes\ComboGeneral::getComboNroTallos($nro_tallos, $nro_tallos_1er_elemento);
                 $response = new \stdClass();
                 $response->inventario_opciones = $inventario_opciones;
                 $response->calidad_opciones = $calidad_opciones;
                 $response->proveedor_opciones = $proveedor_opciones;
                 $response->color_ventas_opciones = $color_ventas_opciones;
                 $response->calidad_variedad_opciones = $calidad_variedad_opciones;
                 $response->nro_tallos_opciones = $nro_tallos_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;
     }
 }