Improved error message
This commit is contained in:
parent
c62c7c0b1f
commit
967c20e3e9
@ -1200,7 +1200,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
if ($result == 0 || $result == -1)
|
||||
{
|
||||
$this->error="No price found for this quantity. Quantity may be too low ?";
|
||||
$langs->load("errors");
|
||||
$this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier");
|
||||
$this->db->rollback();
|
||||
dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG);
|
||||
return -1;
|
||||
|
||||
@ -137,7 +137,9 @@ if ($action == 'order' && isset($_POST['valid'])) {
|
||||
$id = $order->create($user);
|
||||
if ($id < 0) {
|
||||
$fail++;
|
||||
setEventMessage($langs->trans('OrderFail'), 'errors');
|
||||
$msg = $langs->trans('OrderFail') . " : ";
|
||||
$msg .= $order->error;
|
||||
setEventMessage($msg, 'errors');
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user