Merge pull request #10211 from atm-john/fix_error_message_details

Add détails to error message
This commit is contained in:
Laurent Destailleur 2018-12-14 14:26:38 +01:00 committed by GitHub
commit 78cdade1a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,8 +322,8 @@ class MouvementStock extends CommonObject
if (! $foundforbatch || $qtyisnotenough)
{
$langs->load("stocks");
$this->error = $langs->trans('qtyToTranferLotIsNotEnough');
$this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough');
$this->error = $langs->trans('qtyToTranferLotIsNotEnough').' : '.$product->ref;
$this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough').' : '.$product->ref;
$this->db->rollback();
return -8;
}
@ -333,8 +333,8 @@ class MouvementStock extends CommonObject
if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty))
{
$langs->load("stocks");
$this->error = $langs->trans('qtyToTranferIsNotEnough');
$this->errors[] = $langs->trans('qtyToTranferIsNotEnough');
$this->error = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
$this->errors[] = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
$this->db->rollback();
return -8;
}