Commit 9c74eac6 by Alexis Aoun

adaptation de la detection price to weight à couchdb

parent 54954ebe
......@@ -176,23 +176,26 @@ function update_distant_orders() {
function price_to_weight_confirmed_callback (foundProduct, scannedProduct) {
return function price_to_weight_confirmed() {
let newQty = null;
if (priceToWeightIsCorrect) {
foundProduct.data.product_qty = scannedProduct.qty;
newQty = scannedProduct.qty;
} else {
var tmp = Number((scannedProduct.value/document.getElementById("new_price_to_weight").value).toFixed(3));
let tmp = Number((scannedProduct.value/document.getElementById("new_price_to_weight").value).toFixed(3));
if (isFinite(tmp)) {
foundProduct.data.product_qty = tmp;
newQty = tmp;
}
}
if (foundProduct.data !== null && isFinite(tmp)) {
editProductInfo(foundProduct.data, foundProduct.data.product_qty);
if (foundProduct.data !== null && newQty != null) {
if (foundProduct.place === 'to_process') {
let row = table_to_process.row($('#'+foundProduct.data.product_id[0]));
remove_from_toProcess(row, foundProduct.data);
}
editing_product = foundProduct.data;
editProductInfo(foundProduct.data, newQty);
editing_product = null;
resetPopUpButtons();
}
};
......
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