/**
  * Get count sql
  * 
  * @return Zend_DB_Select
  */
 public function getSelectCountSql()
 {
     if ($this->_isGroupSql) {
         $this->_renderFilters();
         $countSelect = clone $this->getSelect();
         $countSelect->reset(Zend_Db_Select::ORDER);
         $countSelect->reset(Zend_Db_Select::LIMIT_COUNT);
         $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET);
         $countSelect->reset(Zend_Db_Select::COLUMNS);
         if (count($this->getSelect()->getPart(Zend_Db_Select::GROUP)) > 0) {
             //$countSelect->reset(Zend_Db_Select::GROUP);
             if ($this->_resetHaving) {
                 $countSelect->reset(Zend_Db_Select::HAVING);
             }
             //$countSelect->distinct(true);
             $group = $this->getSelect()->getPart(Zend_Db_Select::GROUP);
             $countSelect->columns("COUNT(DISTINCT " . implode(", ", $group) . ")");
         } else {
             $countSelect->columns('COUNT(*)');
         }
         return $countSelect;
     }
     return parent::getSelectCountSql();
 }
 public function _construct()
 {
     parent::_construct();
     $this->_init('inventorysupplyneeds/draftpo_product');
 }
 public function _construct()
 {
     parent::_construct();
     $this->_init('inventoryplus/transaction_product');
 }
 public function _construct()
 {
     parent::_construct();
     $this->_init('inventorypurchasing/purchaseorder');
 }
 public function _construct()
 {
     parent::_construct();
     $this->_init('inventoryplus/warehouse_shipment');
 }
 public function _construct()
 {
     parent::_construct();
     $this->_init('inventorywarehouse/requeststock');
 }
 public function _construct()
 {
     parent::_construct();
     $this->_init('inventorywarehouse/transaction');
 }
 public function _construct()
 {
     parent::_construct();
     $this->_init('inventorypurchasing/supplier_product');
 }