diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3427e38d99e..b74d458ba3a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2264,8 +2264,8 @@ class Commande extends CommonOrder } $sql .= ' ed.fk_origin_line = cd.rowid'; $sql .= ' AND cd.fk_commande = '.((int) $this->id); - if ($this->fk_product > 0) { - $sql .= ' AND cd.fk_product = '.((int) $this->fk_product); + if ($fk_product > 0) { + $sql .= ' AND cd.fk_product = '.((int) $fk_product); } if ($filtre_statut >= 0) { $sql .= ' AND e.fk_statut >= '.((int) $filtre_statut);