Skip to content
Snippets Groups Projects
Commit 967c20e3 authored by Cédric Salvador's avatar Cédric Salvador
Browse files

Improved error message

parent c62c7c0b
No related branches found
No related tags found
No related merge requests found
......@@ -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') . "&nbsp;:&nbsp;";
$msg .= $order->error;
setEventMessage($msg, 'errors');
}
$i++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment