From bbbf24c2a5ba3e70f337410a2ef3b0a20bd3b2ab Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 18 Jun 2016 12:52:58 +0100 Subject: [PATCH] Don't allow adding deleted Items by item_id in Sales register and Receiving (#664) --- application/models/Item.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index eca147fa5..b23c4b3ed 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -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); }