diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index d053b05e901..19b9409f431 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -1717,7 +1717,9 @@ class Commande extends CommonObject * \return int < 0 si erreur, > 0 si ok */ function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0) - { + { + global $conf; + dol_syslog("Commande::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $date_start, $date_end, $type"); include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php'); @@ -1784,6 +1786,13 @@ class Commande extends CommonObject // Mise a jour info denormalisees $this->update_price(); + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('LINEORDER_UPDATE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + $this->db->commit(); return $result; } diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index bfac3642630..14872ddf545 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -3045,7 +3045,9 @@ class FactureLigne */ function update() { - // Clean parameters + global $conf; + + // Clean parameters $this->desc=trim($this->desc); // Check parameters @@ -3082,6 +3084,15 @@ class FactureLigne $resql=$this->db->query($sql); if ($resql) { + if (! $notrigger) + { + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); + $interface=new Interfaces($this->db); + $result = $interface->run_triggers('LINEBILL_UPDATE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + } $this->db->commit(); return 1; } diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index b6838b4b28f..23663265c15 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -448,7 +448,20 @@ class Propal extends CommonObject if ($result > 0) { $this->update_price(); - $this->db->commit(); + + $this->fk_propal = $this->id; + $this->rowid = $rowid; + if (! $notrigger) + { + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); + $interface=new Interfaces($this->db); + $result = $interface->run_triggers('LINEPROPAL_UPDATE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + } + + $this->db->commit(); return $result; } else @@ -2167,7 +2180,9 @@ class PropaleLigne * \return int <0 si ko, >0 si ok */ function insert() - { + { + global $conf; + dol_syslog("PropaleLigne::insert rang=".$this->rang); $this->db->begin(); @@ -2232,6 +2247,18 @@ class PropaleLigne if ($resql) { $this->rang=$rangmax; + + $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet'); + if (! $notrigger) + { + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); + $interface=new Interfaces($this->db); + $result = $interface->run_triggers('LINEPROPAL_INSERT',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers + } + $this->db->commit(); return 1; }