public function not_in_wh_pr_grid($wh_id)
 {
     $this->load->library('grid');
     $this->grid->keep_filter_data(TRUE);
     $this->grid->_init_grid('not_in_wh_' . $wh_id . '_pr_grid', array('sort' => 'A.' . self::ID_PR, 'desc' => 'DESC', 'url' => set_url('warehouse/warehouses_products/ajax_get_not_exists_pr/wh_id/' . $wh_id)));
     $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, A.`status`, B.`name`, C.`qty`")->from("`" . self::PR . "` AS A")->join("`" . self::PR_DESC . "` AS B", "B.`" . self::ID_PR . "` = A.`" . self::ID_PR . "` && B.`" . self::ID_LANGS . "` = '" . $this->id_langs . "'", "LEFT")->join("`" . self::WH_PR . "` AS C", "C.`" . self::ID_WH . "` = '" . $wh_id . "' && C.`" . self::ID_PR . "` = A.`" . self::ID_PR . "`", "LEFT")->where("A.`" . self::ID_USERS . "`", $this->id_users)->where("C.`qty` IS NULL", NULL, FALSE);
     $this->load->helper('warehouses_products');
     helper_not_in_wh_pr_grid_build($this->grid, $wh_id);
     $this->grid->create_grid_data();
     $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да'));
     return $this->grid->render_grid(TRUE);
 }
 public function not_in_wh_pr_grid($wh_id)
 {
     $this->load->library('grid');
     $this->grid->_init_grid('not_in_wh_pr_grid', array('url' => set_url('warehouse/warehouses_products/ajax_get_not_exists_pr/wh_id/' . $wh_id)), TRUE);
     $this->grid->db->select("A.`" . self::ID_PR . "` AS ID, A.`sku`, A.`status`, B.`name`")->from("`" . self::PR . "` AS A")->join("`" . self::PR_DESC . "` AS B", "B.`" . self::ID_PR . "` = A.`" . self::ID_PR . "` && B.`" . self::ID_LANGS . "` = '" . $this->id_langs . "'", "LEFT")->where("A.`" . self::ID_USERS . "`", $this->id_users)->where("A.`" . self::ID_PR . "` NOT IN(SELECT `" . self::ID_PR . "` FROM `" . self::WH_PR . "` WHERE `" . self::ID_WH . "` = '" . $wh_id . "')");
     $this->load->helper('warehouses/warehouses_products_helper');
     helper_not_in_wh_pr_grid_build($this->grid, $wh_id);
     $this->grid->create_grid_data();
     $this->grid->update_grid_data('status', array('0' => 'Нет', '1' => 'Да'));
     return $this->grid->render_grid(TRUE);
 }