mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-16 18:02:44 -04:00
#132 Make sure we don't show multiple times the same item given a range
This commit is contained in:
@@ -39,7 +39,7 @@ class Item extends CI_Model
|
||||
*/
|
||||
function get_found_rows($search, $filters)
|
||||
{
|
||||
$this->db->from("items");
|
||||
$this->db->from('items');
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
$this->db->join('inventory', 'inventory.trans_items = items.item_id');
|
||||
|
||||
@@ -97,6 +97,8 @@ class Item extends CI_Model
|
||||
$this->db->where('items.description', '');
|
||||
}
|
||||
|
||||
$this->db->group_by('items.name');
|
||||
|
||||
return $this->db->get()->num_rows();
|
||||
}
|
||||
|
||||
@@ -105,7 +107,7 @@ class Item extends CI_Model
|
||||
*/
|
||||
function search($search, $filters, $rows=0, $limit_from=0)
|
||||
{
|
||||
$this->db->from("items");
|
||||
$this->db->from('items');
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
$this->db->join('inventory', 'inventory.trans_items = items.item_id');
|
||||
|
||||
@@ -163,6 +165,7 @@ class Item extends CI_Model
|
||||
$this->db->where('items.description', '');
|
||||
}
|
||||
|
||||
$this->db->group_by('items.name');
|
||||
$this->db->order_by('items.name', 'asc');
|
||||
|
||||
if ($rows > 0)
|
||||
|
||||
Reference in New Issue
Block a user