Commit 870ff1e2 by Damien Moulard

INV: save new qty only when validate pressed, not when cancel pressed

parent 4f963d49
...@@ -355,36 +355,37 @@ var is_product_in_shelf_adding_queue_list = function(testing_pid) { ...@@ -355,36 +355,37 @@ var is_product_in_shelf_adding_queue_list = function(testing_pid) {
}; };
var printProduct = function () { var printProduct = function () {
let clicked = $(this); let clicked = $(this);
let tr_to_print = clicked.closest('tr'); let tr_to_print = clicked.closest('tr');
let barcode = tr_to_print.data('bc') let barcode = tr_to_print.data('bc');
openModal(); openModal();
try { try {
$.ajax({
url: '/products/get_product_data',
data: {'barcode': barcode}
})
.done(function(res) {
var product = res.product
var product_tmpl_id = product.product_tmpl_id[0]
$.ajax({ $.ajax({
url: '/products/label_print/' + product_tmpl_id url: '/products/get_product_data',
}) data: {'barcode': barcode}
.done(function(res_print) {
closeModal();
if ("error" in res_print.res) {
console.log(res_print.res);
alert('Une erreur est survenue...');
} else {
alert('Impression lancée');
}
}) })
}) .done(function(res) {
} catch(e) { var product = res.product;
closeModal(); var product_tmpl_id = product.product_tmpl_id[0];
alert('Une erreur est survenue...');
} $.ajax({
url: '/products/label_print/' + product_tmpl_id
})
.done(function(res_print) {
closeModal();
if ("error" in res_print.res) {
console.log(res_print.res);
alert('Une erreur est survenue...');
} else {
alert('Impression lancée');
}
});
});
} catch (e) {
closeModal();
alert('Une erreur est survenue...');
}
}; };
......
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