FIX : on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref)
This commit is contained in:
parent
a983dc7506
commit
087e269103
@ -464,7 +464,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||
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;
|
||||
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
|
||||
$sql .= " ORDER BY l.rang, l.rowid";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user