change add_commercial signature
This commit is contained in:
parent
ab71be5d5b
commit
ae50a8b896
@ -1939,11 +1939,11 @@ class Societe extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param int $commid Id of user
|
* @param int $commid Id of user
|
||||||
* @return void
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function add_commercial(User $user, $commid)
|
public function add_commercial(User $user, $commid)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
|
||||||
@ -1961,14 +1961,18 @@ class Societe extends CommonObject
|
|||||||
if (! $this->db->query($sql) )
|
if (! $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::add_commercial Erreur");
|
dol_syslog(get_class($this)."::add_commercial Erreur");
|
||||||
|
return -2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->context=array('commercial_modified'=>$commid);
|
$this->context=array('commercial_modified'=>$commid);
|
||||||
|
|
||||||
$result=$this->call_trigger('COMPANY_LINK_SALE_REPRESENTATIVE', $user);
|
$result=$this->call_trigger('COMPANY_LINK_SALE_REPRESENTATIVE', $user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) return $result;
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user