From de3d328036895c8bab3e7bdd7751fa5f42ba66a0 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 6 May 2011 20:03:20 +0000 Subject: [PATCH] Cashdesk: Barcode search with barcode reader. --- htdocs/cashdesk/facturation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index f9cf9a09b9b..3fbe38868e8 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -37,7 +37,10 @@ if ( $_GET['filtre'] ) { 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.tosell = 1"; $sql.= " AND p.fk_product_type = 0"; - $sql.= " AND (p.ref LIKE '%".$_GET['filtre']."%' OR p.label LIKE '%".$_GET['filtre']."%' OR p.barcode='".$_GET['filtre']."')"; + $sql.= " AND (p.ref LIKE '%".$_GET['filtre']."%' OR p.label LIKE '%".$_GET['filtre']."%' "; + if ($conf->barcode->enabled) $sql.= " OR p.barcode='".$_GET['filtre']."')"; + else $sql.= ")"; + $sql.= " ORDER BY label"; dol_syslog("facturation.php sql=".$sql);