Fix duplicate error message
This commit is contained in:
parent
6797c95164
commit
12409e944c
@ -442,7 +442,7 @@ if (empty($reshook))
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
setEventMessages($langs->trans($object->error), $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -757,7 +757,7 @@ class Expedition extends CommonObject
|
|||||||
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref));
|
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref));
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[]=$mouvS->error;
|
$this->error = $mouvS->error;
|
||||||
$this->errors = array_merge($this->errors, $mouvS->errors);
|
$this->errors = array_merge($this->errors, $mouvS->errors);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -771,7 +771,7 @@ class Expedition extends CommonObject
|
|||||||
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock);
|
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[]=$mouvS->error;
|
$this->error = $mouvS->error;
|
||||||
$this->errors = array_merge($this->errors, $mouvS->errors);
|
$this->errors = array_merge($this->errors, $mouvS->errors);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -851,11 +851,6 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach($this->errors as $errmsg)
|
|
||||||
{
|
|
||||||
dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR);
|
|
||||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
|
||||||
}
|
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1*$error;
|
return -1*$error;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user