Commit ed8bb5be by Alexis Aoun

Changement comportement scan poids et changement arrondissement poids

- Lors d un scan d un produit quantifie au poids celui ci sera directement valider sans passer par
la ligne d edition
- Le poids en quantite est arrondi au millieme pres
parent dd9a4bf5
...@@ -131,8 +131,12 @@ function select_product_from_bc(barcode) { ...@@ -131,8 +131,12 @@ function select_product_from_bc(barcode) {
} }
if (found.data !== null && !qtyIsPriceToWeight) { if(found.data !== null && !qtyIsPriceToWeight){
setLineEdition(found.data); if(qtyIsWeight)
editProductInfo(found.data, found.data.product_qty);
else
setLineEdition(found.data);
if (found.place === 'to_process') { if (found.place === 'to_process') {
let row = table_to_process.row($('#'+found.data.product_id[0])); let row = table_to_process.row($('#'+found.data.product_id[0]));
...@@ -203,10 +207,10 @@ function price_to_weight_confirmed_callback (found, p){ ...@@ -203,10 +207,10 @@ function price_to_weight_confirmed_callback (found, p){
if(priceToWeightIsCorrect) if(priceToWeightIsCorrect)
found.data.product_qty = p.qty; found.data.product_qty = p.qty;
else else
found.data.product_qty = Number((p.value/document.getElementById("new_price_to_weight").value).toFixed(2)); found.data.product_qty = Number((p.value/document.getElementById("new_price_to_weight").value).toFixed(3));
if (found.data !== null) { if (found.data !== null) {
setLineEdition(found.data); editProductInfo(found.data, found.data.product_qty);
if (found.place === 'to_process') { if (found.place === 'to_process') {
let row = table_to_process.row($('#'+found.data.product_id[0])); let row = table_to_process.row($('#'+found.data.product_id[0]));
...@@ -942,7 +946,7 @@ function editProductInfo (productToEdit, value = null, batch = false) { ...@@ -942,7 +946,7 @@ function editProductInfo (productToEdit, value = null, batch = false) {
if (e.product_id[0] == productToEdit.product_id[0]) { if (e.product_id[0] == productToEdit.product_id[0]) {
addition = true; addition = true;
productToEdit = e; productToEdit = e;
newValue = Number((newValue + productToEdit.product_qty).toFixed(2)); newValue = Number((newValue + productToEdit.product_qty).toFixed(3));
} }
}); });
// If qty edition & Check if qty changed // If qty edition & Check if qty changed
......
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