diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 5ef50f798d0..55270e0cd10 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -73,9 +73,14 @@ class MouvementStock extends CommonObject public $fk_origin; public $origintype; + public $inventorycode; public $batch; + /** + * @var Object Object set as origin before calling livraison() or reception() + */ + public $origin; public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1), @@ -378,6 +383,7 @@ class MouvementStock extends CommonObject if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after { + // Set $origintype, fk_origin, fk_project $fk_project = 0; if (!empty($this->origin)) { // This is set by caller for tracking reason $origintype = empty($this->origin->origin_type) ? $this->origin->element : $this->origin->origin_type;