Merge pull request #33170 from jyhere/patch-23

NEW: add hooks to modify select_produits_fournisseurs_list sql query
This commit is contained in:
Laurent Destailleur 2025-02-21 11:37:58 +01:00 committed by GitHub
commit ca0c8e44da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);