Commit 9bad8548 by Yvon Kerdoncuff

improve again

parent d512ee74
Pipeline #3912 failed with stage
......@@ -707,17 +707,6 @@ function do_stock_movement() {
},
error: function(data) {
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.\">";
if(data.responseJSON.errors.length > 0
&& data.responseJSON.errors[0] == could_not_reserve_error)
{
closeModal();
reset_focus();
$.notify("Erreur lors de l'opération : échec de la réservation d'un produit.", {
globalPosition:"top right",
className: "error"
});
}
// server error
err = {msg: "erreur serveur lors de l'enregistrement du mouvement de stock", ctx: 'do_stock_movement'};
if (typeof data.responseJSON != 'undefined' && typeof data.responseJSON.error != 'undefined') {
......@@ -729,11 +718,20 @@ function do_stock_movement() {
closeModal();
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.\">";
if(data.responseJSON.errors.length > 0
&& data.responseJSON.errors[0] == could_not_reserve_error) {
$.notify("Erreur lors de l'opération : échec de la réservation d'un produit.", {
globalPosition:"top right",
className: "error"
});
} else {
$.notify("Erreur lors de l'opération.", {
globalPosition:"top right",
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