mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-24 16:28:40 -04:00
Disables unique check and fixes return
- If allow duplicate barcodes is enabled then this function automatically returns FALSE allowing item imports and new items to no longer balk. - Modified the code to return TRUE not only when there is 1 row but when there are one or more rows. This will fix problems with users that allow duplicate barcodes and who upgraded from older versions before unique barcode was required.
This commit is contained in:
committed by
FrancescoUK
parent
27e9f3ff1a
commit
372c3ab6bf
@@ -44,6 +44,11 @@ class Item extends CI_Model
|
||||
*/
|
||||
public function item_number_exists($item_number, $item_id = '')
|
||||
{
|
||||
if($this->config->item('allow_duplicate_barcodes') != FALSE)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$this->db->from('items');
|
||||
$this->db->where('item_number', (string) $item_number);
|
||||
if(ctype_digit($item_id))
|
||||
@@ -51,7 +56,7 @@ class Item extends CI_Model
|
||||
$this->db->where('item_id !=', (int) $item_id);
|
||||
}
|
||||
|
||||
return ($this->db->get()->num_rows() == 1);
|
||||
return ($this->db->get()->num_rows() >= 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user