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
This commit is contained in:
BENKE Charlie 2015-08-21 14:10:55 +02:00
parent 15ab9c0ecd
commit 1b117d5581

View File

@ -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;
}