New: Add patch from Laurent Bouquet to support trigger events on line updates
This commit is contained in:
parent
9ce8d0d71c
commit
b3c83490f8
@ -1718,6 +1718,8 @@ class Commande extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0)
|
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");
|
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');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||||
|
|
||||||
@ -1784,6 +1786,13 @@ class Commande extends CommonObject
|
|||||||
// Mise a jour info denormalisees
|
// Mise a jour info denormalisees
|
||||||
$this->update_price();
|
$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();
|
$this->db->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3045,6 +3045,8 @@ class FactureLigne
|
|||||||
*/
|
*/
|
||||||
function update()
|
function update()
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->desc=trim($this->desc);
|
$this->desc=trim($this->desc);
|
||||||
|
|
||||||
@ -3082,6 +3084,15 @@ class FactureLigne
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
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();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -448,6 +448,19 @@ class Propal extends CommonObject
|
|||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$this->update_price();
|
$this->update_price();
|
||||||
|
|
||||||
|
$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();
|
$this->db->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -2168,6 +2181,8 @@ class PropaleLigne
|
|||||||
*/
|
*/
|
||||||
function insert()
|
function insert()
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
dol_syslog("PropaleLigne::insert rang=".$this->rang);
|
dol_syslog("PropaleLigne::insert rang=".$this->rang);
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -2232,6 +2247,18 @@ class PropaleLigne
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$this->rang=$rangmax;
|
$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();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user