diff --git a/htdocs/product/list.php b/htdocs/product/list.php index b2f7489cbfe..017a2cf8200 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -43,6 +43,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; if (!empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +if (!empty($conf->accounting->enabled)) + require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'suppliers', 'companies', 'margins')); @@ -410,12 +412,12 @@ if ($fourn_id > 0) $sql .= " AND pfp.fk_soc = ".((int) $fourn_id); if ($search_country) $sql .= " AND p.fk_country = ".$search_country; if ($search_state) $sql .= " AND p.fk_state = ".$search_state; if ($search_finished >= 0 && $search_finished !== '') $sql .= " AND p.finished = ".$search_finished; -if ($search_accountancy_code_sell) $sql .= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell); -if ($search_accountancy_code_sell_intra) $sql .= natural_search('p.accountancy_code_sell_intra', $search_accountancy_code_sell_intra); -if ($search_accountancy_code_sell_export) $sql .= natural_search('p.accountancy_code_sell_export', $search_accountancy_code_sell_export); -if ($search_accountancy_code_buy) $sql .= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); -if ($search_accountancy_code_buy_intra) $sql .= natural_search('p.accountancy_code_buy_intra', $search_accountancy_code_buy_intra); -if ($search_accountancy_code_buy_export) $sql .= natural_search('p.accountancy_code_buy_export', $search_accountancy_code_buy_export); +if ($search_accountancy_code_sell) $sql .= natural_search('p.accountancy_code_sell', clean_account($search_accountancy_code_sell)); +if ($search_accountancy_code_sell_intra) $sql .= natural_search('p.accountancy_code_sell_intra', clean_account($search_accountancy_code_sell_intra)); +if ($search_accountancy_code_sell_export) $sql .= natural_search('p.accountancy_code_sell_export', clean_account($search_accountancy_code_sell_export)); +if ($search_accountancy_code_buy) $sql .= natural_search('p.accountancy_code_buy', clean_account($search_accountancy_code_buy)); +if ($search_accountancy_code_buy_intra) $sql .= natural_search('p.accountancy_code_buy_intra', clean_account($search_accountancy_code_buy_intra)); +if ($search_accountancy_code_buy_export) $sql .= natural_search('p.accountancy_code_buy_export', clean_account($search_accountancy_code_buy_export)); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -1481,33 +1483,33 @@ if ($resql) // Accountancy code sell if (!empty($arrayfields['p.accountancy_code_sell']['checked'])) { - print '