forked from Wavyzz/dolibarr
FIX update extrafields
This commit is contained in:
@@ -1549,6 +1549,8 @@ class Facture extends CommonInvoice
|
||||
*/
|
||||
function update(User $user, $notrigger=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
@@ -1614,17 +1616,23 @@ class Facture extends CommonInvoice
|
||||
$error++; $this->errors[]="Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0)
|
||||
{
|
||||
if (! $notrigger)
|
||||
$result=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user