Skip to content

Commit

Permalink
add in get_origin function generic origintype
Browse files Browse the repository at this point in the history
actually we have only internal module origintype 
propose to add feature to add stockmovement from other external module
  • Loading branch information
defrance committed Aug 21, 2015
1 parent 15ab9c0 commit 1b117d5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions htdocs/product/stock/class/mouvementstock.class.php
Expand Up @@ -660,9 +660,16 @@ function get_origin($fk_origin, $origintype)
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;
}

Expand Down

0 comments on commit 1b117d5

Please sign in to comment.