Don't allow adding deleted Items by item_id in Sales register and Receiving (#664)

This commit is contained in:
FrancescoUK
2016-06-18 12:52:58 +01:00
parent 936c74211f
commit bbbf24c2a5

View File

@@ -4,10 +4,11 @@ class Item extends CI_Model
/*
Determines if a given item_id is an item
*/
public function exists($item_id)
public function exists($item_id, $deleted = FALSE)
{
$this->db->from('items');
$this->db->where('item_id', $item_id);
$this->db->where('deleted', $deleted);
return ($this->db->get()->num_rows() == 1);
}