Merge pull request #33170 from jyhere/patch-23
NEW: add hooks to modify select_produits_fournisseurs_list sql query
This commit is contained in:
commit
ca0c8e44da
1 changed files with 12 additions and 0 deletions
|
|
@ -3779,7 +3779,19 @@ class Form
|
|||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
|
||||
}
|
||||
|
||||
// Add select from hooks
|
||||
$parameters = [];
|
||||
$reshook = $hookmanager->executeHooks('selectSuppliersProductsListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " FROM " . $this->db->prefix() . "product as p";
|
||||
|
||||
// Add join from hooks
|
||||
$parameters = [];
|
||||
$reshook = $hookmanager->executeHooks('selectSuppliersProductsListFrom', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND pfp.fk_soc = " . ((int) $socid);
|
||||
|
|
|
|||
Loading…
Reference in a new issue