diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index d3a647adfcf..b909a9f2e9d 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -367,7 +367,7 @@ if ($usevirtualstock) $sqlExpeditionsCli .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON (c.rowid = cd.fk_commande)"; $sqlExpeditionsCli .= " WHERE e.entity IN (".getEntity('expedition').")"; $sqlExpeditionsCli .= " AND cd.fk_product = p.rowid"; - $sqlExpeditionsCli .= " AND c.fk_statut IN (1,2))"; + $sqlExpeditionsCli .= " AND e.fk_statut IN (1,2))"; $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd.qty) IS NULL", "0", "SUM(cd.qty)")." as qty"; $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd";