FIX : Call to trigger on chargesociale create
This commit is contained in:
parent
4d6f87e544
commit
d762226a70
@ -155,6 +155,7 @@ class ChargeSociales extends CommonObject
|
|||||||
function create($user)
|
function create($user)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
$error=0;
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
@ -190,8 +191,17 @@ class ChargeSociales extends CommonObject
|
|||||||
$this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."chargesociales");
|
$this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."chargesociales");
|
||||||
|
|
||||||
//dol_syslog("ChargesSociales::create this->id=".$this->id);
|
//dol_syslog("ChargesSociales::create this->id=".$this->id);
|
||||||
$this->db->commit();
|
$result=$this->call_trigger('PAYMENTSOCIALECONTRIBUTION_CREATE',$user);
|
||||||
return $this->id;
|
if ($result < 0) $error++;
|
||||||
|
|
||||||
|
if(empty($error)) {
|
||||||
|
$this->db->commit();
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1*$error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user