Skip to content
Snippets Groups Projects
Commit 46057271 authored by Jean Heimburger's avatar Jean Heimburger
Browse files

Add trigger on movement create

parent 58081796
No related branches found
No related tags found
No related merge requests found
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
*
* 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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment