diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index f5ac2ebae7a..f0d8b8fd12f 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -73,6 +73,7 @@ $search_societe_alias = GETPOST('search_societe_alias', 'alpha');
$search_montant_ht = GETPOST('search_montant_ht', 'alpha');
$search_montant_vat = GETPOST('search_montant_vat', 'alpha');
$search_montant_ttc = GETPOST('search_montant_ttc', 'alpha');
+$search_warehouse = GETPOST('search_warehouse', 'alpha');
$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
@@ -253,6 +254,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_montant_ht = '';
$search_montant_vat = '';
$search_montant_ttc = '';
+ $search_warehouse = '';
$search_multicurrency_code = '';
$search_multicurrency_tx = '';
$search_multicurrency_montant_ht = '';
@@ -520,6 +522,9 @@ if ($search_montant_vat != '') {
if ($search_montant_ttc != '') {
$sql .= natural_search("p.total_ttc", $search_montant_ttc, 1);
}
+if ($search_warehouse != '' && $search_warehouse > 0) {
+ $sql .= natural_search("p.fk_warehouse", $search_warehouse, 1);
+}
if ($search_multicurrency_code != '') {
$sql .= ' AND p.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"';
}
@@ -870,6 +875,14 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle);
$moreforfilter .= '';
}
+ if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
+ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
+ $formproduct = new FormProduct($db);
+ $moreforfilter .= '
';
+ $tmptitle = $langs->trans('Warehouse');
+ $moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', $tmptitle, 0, 0, $tmptitle);
+ $moreforfilter .= '
';
+ }
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 6666e914c27..1df2e33caec 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -452,7 +452,7 @@ if ($search_total_vat != '') {
if ($search_total_ttc != '') {
$sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
}
-if ($search_warehouse != '' && $search_warehouse != '-1') {
+if ($search_warehouse != '' && $search_warehouse > 0) {
$sql .= natural_search('c.fk_warehouse', $search_warehouse, 1);
}
if ($search_multicurrency_code != '') {
@@ -838,7 +838,7 @@ if ($resql) {
$formproduct = new FormProduct($db);
$moreforfilter .= '';
$tmptitle = $langs->trans('Warehouse');
- $moreforfilter .= img_picto($tmptitle, 'warehouse', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, $tmptitle);
+ $moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, $tmptitle);
$moreforfilter .= '
';
}
$parameters = array();
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index b9dcdbb40a7..0e709f54f99 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -88,8 +88,7 @@ print load_fiche_titre($transAreaType, $linkback, 'product');
print '';
-if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be
- //is useless due to the global search combo
+if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo
// Search contract
if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) {
$listofsearchfields['search_product'] = array('text'=>'ProductOrService');