Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler
This commit is contained in:
parent
f3807c754c
commit
5a3fc00b4c
@ -1792,7 +1792,7 @@ class Commande extends CommonOrder
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->error=$line->error;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -2399,11 +2399,10 @@ class Commande extends CommonOrder
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->errors=array($this->db->lasterror());
|
||||
$this->db->rollback();
|
||||
dol_syslog(get_class($this)."::updateline Error=".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
$this->error=$this->line->error;
|
||||
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -140,7 +140,7 @@ else if ($action == 'reopen' && $user->rights->commande->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -154,9 +154,8 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->comm
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,7 +186,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -445,6 +444,10 @@ else if ($action == 'add' && $user->rights->commande->creer)
|
||||
else if ($action == 'classifybilled' && $user->rights->commande->creer)
|
||||
{
|
||||
$ret=$object->classifyBilled();
|
||||
|
||||
if ($ret < 0) {
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Positionne ref commande client
|
||||
@ -1076,7 +1079,9 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer)
|
||||
else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer)
|
||||
{
|
||||
$result = $object->cloture($user);
|
||||
if ($result < 0) $mesgs=$object->errors;
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->commande->valider)
|
||||
@ -1097,6 +1102,10 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->comm
|
||||
if (! $error)
|
||||
{
|
||||
$result = $object->cancel($idwarehouse);
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user