Commit 12b7e7e9 by Yvon Kerdoncuff

stock movement : simply show exception error on page

parent 26f9cbd8
...@@ -718,20 +718,16 @@ function do_stock_movement() { ...@@ -718,20 +718,16 @@ function do_stock_movement() {
closeModal(); closeModal();
reset_focus(); reset_focus();
let could_not_reserve_error = "Failed api execute : <Fault 2: \"Could not reserve all requested products. Please use the 'Mark as Todo' button to handle the reservation manually.\">"; let error_text_displayed = "Erreur lors de l'opération";
if(data.responseJSON.errors.length > 0 if(data.responseJSON.errors.length > 0) {
&& data.responseJSON.errors[0] == could_not_reserve_error) { error_text_displayed += " : " + data.responseJSON.errors[0]
$.notify("Erreur lors de l'opération : échec de la réservation d'un produit.", { }
globalPosition:"top right", error_text_displayed += ".";
className: "error" $.notify(error_text_displayed, {
});
} else {
$.notify("Erreur lors de l'opération.", {
globalPosition:"top right", globalPosition:"top right",
className: "error" className: "error"
}); });
} }
}
}); });
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment