change trigger position

This commit is contained in:
florian HENRY
2016-05-23 14:18:29 +02:00
parent 4e707af0fd
commit 37d366478f

View File

@@ -464,12 +464,6 @@ class Commande extends CommonOrder
}
}
if (!$error) {
// Call trigger
$result=$this->call_trigger('ORDER_SETDRAFT',$user);
if ($result < 0) $error++;
}
if (!$error)
{
$this->statut=self::STATUS_DRAFT;
@@ -484,9 +478,20 @@ class Commande extends CommonOrder
}
}
$this->statut=self::STATUS_DRAFT;
$this->db->commit();
return 1;
if (!$error) {
// Call trigger
$result=$this->call_trigger('ORDER_SETDRAFT',$user);
if ($result < 0) $error++;
}
if (!$error) {
$this->statut=self::STATUS_DRAFT;
$this->db->commit();
return 1;
}else {
$this->db->rollback();
return -1;
}
}
else
{