From 1b117d5581b0ab20c16b7c5e3db47073dd6f023d Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 21 Aug 2015 14:10:55 +0200 Subject: [PATCH] add in get_origin function generic origintype actually we have only internal module origintype propose to add feature to add stockmovement from other external module --- htdocs/product/stock/class/mouvementstock.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 52c69b16ec6..1e72e151044 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) + { + require_once DOL_DOCUMENT_ROOT.'/'.$origintype.'/class/'.$origintype.'.class.php'; + $classname = ucfirst($origintype); + $origin = new $classname($this->db); + } + else + return ''; break; }