Fix filter

This commit is contained in:
Laurent Destailleur 2021-09-27 11:38:34 +02:00
parent 9b825df158
commit b77cadf39a
3 changed files with 5 additions and 5 deletions

View File

@ -570,13 +570,13 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
} }
$param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall); $param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
$param .= '&type='.urlencode($type).'&view='.urlencode($view); $param .= '&type='.urlencode($type).'&view='.urlencode($view);
if (!empty($search_categ)) { if (!empty($search_categ) && $search_categ != '-1') {
$param .= '&search_categ='.urlencode($search_categ); $param .= '&search_categ='.urlencode($search_categ);
} }
if (!empty($search_categ_thirdparty)) { if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') {
$param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty); $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
} }
if (!empty($search_categ_supplier)) { if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') {
$param .= '&search_categ_supplier='.urlencode($search_categ_supplier); $param .= '&search_categ_supplier='.urlencode($search_categ_supplier);
} }
if ($sall != '') { if ($sall != '') {

View File

@ -441,7 +441,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
if (!empty($search_categ_sup)) { if (!empty($search_categ_sup) && $search_categ_supplier != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc";
} }

View File

@ -497,7 +497,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_regio
if (!empty($search_categ_cus) && $search_categ_cus != '-1') { if (!empty($search_categ_cus) && $search_categ_cus != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
} }
if (!empty($search_categ_sup) && $search_categ_sup!=-1) { if (!empty($search_categ_sup) && $search_categ_sup != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ
} }
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id";