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
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$line->error;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2399,10 +2399,9 @@ class Commande extends CommonOrder
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->line->error;
|
||||||
$this->errors=array($this->db->lasterror());
|
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
dol_syslog(get_class($this)."::updateline Error=".$this->error, LOG_ERR);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -140,7 +140,7 @@ else if ($action == 'reopen' && $user->rights->commande->creer)
|
|||||||
}
|
}
|
||||||
else
|
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');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
setEventMessage($object->error, 'errors');
|
||||||
$mesg='<div class="error">'.$object->error.'</div>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +186,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
|
|||||||
}
|
}
|
||||||
else
|
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)
|
else if ($action == 'classifybilled' && $user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
$ret=$object->classifyBilled();
|
$ret=$object->classifyBilled();
|
||||||
|
|
||||||
|
if ($ret < 0) {
|
||||||
|
setEventMessage($object->error, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Positionne ref commande client
|
// 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)
|
else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer)
|
||||||
{
|
{
|
||||||
$result = $object->cloture($user);
|
$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)
|
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)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result = $object->cancel($idwarehouse);
|
$result = $object->cancel($idwarehouse);
|
||||||
|
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessage($object->error, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user