Merge pull request #9857 from atm-john/add_combo_seach_by_fourn_ref
NEW hidden conf to search product by supplier ref
This commit is contained in:
commit
f8ea9e7099
@ -2071,6 +2071,12 @@ class Form
|
|||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// include search in supplier ref
|
||||||
|
if(!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF))
|
||||||
|
{
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||||
|
}
|
||||||
|
|
||||||
//Price by customer
|
//Price by customer
|
||||||
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
||||||
@ -2124,6 +2130,7 @@ class Form
|
|||||||
if ($i > 0) $sql.=" AND ";
|
if ($i > 0) $sql.=" AND ";
|
||||||
$sql.="(p.ref LIKE '".$db->escape($prefix.$crit)."%' OR p.label LIKE '".$db->escape($prefix.$crit)."%'";
|
$sql.="(p.ref LIKE '".$db->escape($prefix.$crit)."%' OR p.label LIKE '".$db->escape($prefix.$crit)."%'";
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$db->escape($prefix.$crit)."%'";
|
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$db->escape($prefix.$crit)."%'";
|
||||||
|
if (! empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) $sql.=" OR pfp.ref_fourn LIKE '".$db->escape($prefix.$crit)."%'";
|
||||||
$sql.=")";
|
$sql.=")";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user