From cc70ffd1b36dc8b25398d7bfd9361570d1cb4ac8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Nov 2019 18:47:35 +0100 Subject: [PATCH] Update list.php --- htdocs/societe/list.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index a62dde1d79d..da5d4c268fd 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -232,9 +232,7 @@ if ($action == "change") // Change customer for TakePOS $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant // Check if draft invoice already exists, if not create it - $sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'facture - where ref=\'(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')\' - AND entity IN ('.getEntity('invoice').')'; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' AND entity IN (".getEntity('invoice').")"; $result = $db->query($sql); $num_lines = $db->num_rows($result); if ($num_lines==0)