コード例 #1
0
 public function getcomboDispoAction()
 {
     try {
         $EntityManagerPlugin = $this->EntityManagerPlugin();
         $GrupoDispoCabBO = new GrupoDispoCabBO();
         $GrupoDispoCabBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $SesionUsuarioPlugin = $this->SesionUsuarioPlugin();
         $SesionUsuarioPlugin->isLoginVentas();
         //Solo el Vendedor Puede hacer este procedimiento
         $body = $this->getRequest()->getContent();
         $json = json_decode($body, true);
         //var_dump($json); exit;
         //$texto_primer_elemento		= null;
         $grupo_dispo_cab_id = null;
         $inventario_id = $json['inventario_id'];
         $calidad_id = $json['calidad_id'];
         $opciones_dispo = $GrupoDispoCabBO->getComboPorInventario($grupo_dispo_cab_id, $inventario_id, $calidad_id);
         $response = new \stdClass();
         $response->opciones_dispo = $opciones_dispo;
         $response->respuesta_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;
     }
 }
コード例 #2
0
 function exportaExcelInternoCajasDispoGrupoAction()
 {
     try {
         $viewModel = new ViewModel();
         $EntityManagerPlugin = $this->EntityManagerPlugin();
         $GrupoDispoCabBO = new GrupoDispoCabBO();
         $GrupoDispoCabBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $SesionUsuarioPlugin = $this->SesionUsuarioPlugin();
         $SesionUsuarioPlugin->isLoginAdmin();
         $request = $this->getRequest();
         $inventario_id = $request->getQuery('inventario_id', "");
         $grupo_dispo_cab_id = $request->getQuery('grupo_dispo_cab_id', "");
         //$color_ventas_id  		= $request->getQuery('color_ventas_id', "");
         //$calidad_variedad_id	= $request->getQuery('calidad_variedad_id', "");
         $color_ventas_id = "";
         $calidad_variedad_id = "";
         //$grupo_dispo_cab_id = 1;
         $condiciones = array("inventario_id" => $inventario_id, "grupo_dispo_cab_id" => $grupo_dispo_cab_id, "color_ventas_id" => $color_ventas_id, "calidad_variedad_id" => $calidad_variedad_id);
         $result = $GrupoDispoCabBO->generarExcelInternoCajas($condiciones);
         exit;
     } catch (\Exception $e) {
         $excepcion_msg = utf8_encode($this->ExcepcionPlugin()->getMessageFormat($e));
         $response = $this->getResponse();
         $response->setStatusCode(500);
         $response->setContent($excepcion_msg);
         return $response;
     }
 }