Merge pull request #6593 from dolibarr95/patch-5
NEW : Create a trigger for company rib update
This commit is contained in:
commit
12375be14a
@ -131,6 +131,8 @@ class CompanyBankAccount extends Account
|
|||||||
function update(User $user = null, $notrigger = 0)
|
function update(User $user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
if (! $this->id)
|
if (! $this->id)
|
||||||
{
|
{
|
||||||
@ -166,13 +168,34 @@ class CompanyBankAccount extends Account
|
|||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Call trigger
|
||||||
|
$result=$this->call_trigger('COMPANY_RIB_MODIFY',$user);
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
if(! $error )
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user