diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 5f8b1d886c3..745955c7bcd 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -324,3 +324,5 @@ ALTER TABLE llx_actioncomm MODIFY COLUMN note mediumtext; DELETE FROM llx_boxes WHERE box_id IN (select rowid FROM llx_boxes_def WHERE file IN ('box_bom.php@bom', 'box_bom.php')); DELETE FROM llx_boxes_def WHERE file IN ('box_bom.php@bom', 'box_bom.php'); + +ALTER TABLE llx_takepos_floor_tables ADD UNIQUE(entity,label); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_takepos_floor_tables.key.sql b/htdocs/install/mysql/tables/llx_takepos_floor_tables.key.sql new file mode 100644 index 00000000000..e90cd67e889 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_takepos_floor_tables.key.sql @@ -0,0 +1,16 @@ +-- Copyright (C) 2018 SuperAdmin +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. + +ALTER TABLE llx_takepos_floor_tables ADD UNIQUE(entity,label); \ No newline at end of file diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 64040a24466..73e84109116 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -104,7 +104,7 @@ if ($action == "updatename") { if (strlen($newname) > 3) { $newname = substr($newname, 0, 3); // Only 3 chars } - $db->query("UPDATE ".MAIN_DB_PREFIX."takepos_floor_tables set label='".$db->escape($newname)."' WHERE rowid = ".((int) $place)); + $resql = $db->query("UPDATE ".MAIN_DB_PREFIX."takepos_floor_tables set label='".$db->escape($newname)."' WHERE rowid = ".((int) $place)); } if ($action == "add") {