diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 52c69b16ec6..21bfad54f0e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -660,9 +660,16 @@ class MouvementStock extends CommonObject require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $origin = new FactureFournisseur($this->db); break; - + default: - return ''; + if ($origintype) + { + dol_include_once ('/'.$origintype.'/class/'.$origintype.'.class.php'); + $classname = ucfirst($origintype); + $origin = new $classname($this->db); + } + else + return ''; break; }