Improved error message

This commit is contained in:
Cédric Salvador 2013-09-16 14:31:56 +02:00
parent c62c7c0b1f
commit 967c20e3e9
2 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -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++;
}