diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index 4c48ff4a08c..4655bb71cdd 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -18,7 +18,7 @@ */ /** - * This page is called each time we press a key in the code or description + * This page is called each time we press a key in the code * search form to show product combo list. */ @@ -50,7 +50,15 @@ if ( strlen ($_GET["code"]) >= 0 ) // If search criteria is on char length at le if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; $sql.= " WHERE p.envente = 1"; $sql.= " AND p.fk_product_type = 0"; - $sql.= " AND (p.ref LIKE '%".$_GET['code']."%' OR p.label LIKE '%".$_GET['code']."%')"; + // Add criteria on ref/label + if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) + { + $sql.= " AND (p.ref LIKE '".$_GET['code']."%' OR p.label LIKE '".$_GET['code']."%')"; + } + else + { + $sql.= " AND (p.ref LIKE '%".$_GET['code']."%' OR p.label LIKE '%".$_GET['code']."%')"; + } $sql.= " ORDER BY label"; dol_syslog("facturation_dhtml.php sql=".$sql); diff --git a/htdocs/includes/modules/modCashDesk.class.php b/htdocs/includes/modules/modCashDesk.class.php index 0256cf1bead..feaf4160ebc 100644 --- a/htdocs/includes/modules/modCashDesk.class.php +++ b/htdocs/includes/modules/modCashDesk.class.php @@ -101,7 +101,7 @@ class modCashDesk extends DolibarrModules 'langs'=>'@cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>100, 'perms'=>1, // Use 'perms'=>'1' if you want your menu with no permission rules - 'target'=>'', + 'target'=>'pointofsale', 'user'=>0); // 0=Menu for internal users, 1=external users, 2=both $r++; diff --git a/htdocs/lib/admin.lib.php b/htdocs/lib/admin.lib.php index c52a084a3be..1254f2f2f06 100644 --- a/htdocs/lib/admin.lib.php +++ b/htdocs/lib/admin.lib.php @@ -230,7 +230,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1) $result=$db->query($newsql,$usesavepoint); if ($result) { - print ''."\n"; + if (! $silent) print ''."\n"; if (preg_replace('/insert into ([^\s]+)/i',$newsql,$reg)) { @@ -247,7 +247,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1) else { $errno=$db->errno(); - print ''."\n"; + if (! $silent) print ''."\n"; $okerror=array( 'DB_ERROR_TABLE_ALREADY_EXISTS', 'DB_ERROR_COLUMN_ALREADY_EXISTS',