diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 2258ec6fc26..6ec830d58a9 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Laurent Destailleur + * Copyright (C) 2011 Jean Heimburger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -206,6 +207,21 @@ class MouvementStock $error = $this->_createProductComposition($user, $fk_product, $entrepot_id, $qty, $type, 0, $label); // pmp is not change for subproduct } + if (! $error) + { + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + $interface=new Interfaces($this->db); + + $this->product_id = $fk_product; + $this->entrepot_id = $entrepot_id; + $this->qty = $qty; + + $result=$interface->run_triggers('STOCK_MOVEMENT',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + } + if (! $error) { $this->db->commit();