Merge pull request #18392 from atm-gauthier/FIX_fetch_lines_cmd_fourn_with_same_supplier_price
FIX : on supplier order, JOIN with product fourn price table must be …
This commit is contained in:
commit
e637a1e59a
@ -464,7 +464,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".$this->socid;
|
||||||
$sql .= " WHERE l.fk_commande = ".$this->id;
|
$sql .= " WHERE l.fk_commande = ".$this->id;
|
||||||
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
|
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
|
||||||
$sql .= " ORDER BY l.rang, l.rowid";
|
$sql .= " ORDER BY l.rang, l.rowid";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user