From c6e0a4cc87486091ab4521643af09d698870f3ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Feb 2017 12:39:45 +0100 Subject: [PATCH] Fix column label --- htdocs/product/stock/replenish.php | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index c050acc7663..437361b5cf5 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -289,12 +289,7 @@ if(!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrep $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.$fk_entrepot.')'; } $sql.= ' WHERE p.entity IN (' . getEntity("product", 1) . ')'; -if ($sall) { - $sql .= ' AND (p.ref LIKE "%'.$db->escape($sall).'%" '; - $sql .= 'OR p.label LIKE "%'.$db->escape($sall).'%" '; - $sql .= 'OR p.description LIKE "%'.$db->escape($sall).'%" '; - $sql .= 'OR p.note LIKE "%'.$db->escape($sall).'%")'; -} +if ($sall) $sql .= natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall); // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type)) { if ($type == 1) { @@ -303,20 +298,8 @@ if (dol_strlen($type)) { $sql .= ' AND p.fk_product_type <> 1'; } } -if ($sref) { - //natural search - $scrit = explode(' ', $sref); - foreach ($scrit as $crit) { - $sql .= ' AND p.ref LIKE "%' . $crit . '%"'; - } -} -if ($snom) { - //natural search - $scrit = explode(' ', $snom); - foreach ($scrit as $crit) { - $sql .= ' AND p.label LIKE "%' . $db->escape($crit) . '%"'; - } -} +if ($sref) $sql.=natural_search('p.ref', $sref); +if ($snom) $sql.=natural_search('p.label', $snom); $sql.= ' AND p.tobuy = 1'; if (!empty($canvas)) $sql .= ' AND p.canvas = "' . $db->escape($canvas) . '"'; $sql.= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price'; @@ -522,7 +505,7 @@ print_liste_field_titre($langs->trans('StockLimitShort'), $_SERVER["PHP_SELF"], print_liste_field_titre($stocklabel, $_SERVER["PHP_SELF"], 'stock_physique', $param, '', 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Ordered'), $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans('StockToBuy'), $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('Supplier'), $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); +print_liste_field_titre($langs->trans('SupplierRef'), $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); print "\n"; // Lignes des champs de filtre