Commit 94eefeab by François C.

Lintjs

parent 2e70b732
Pipeline #1260 passed with stage
in 1 minute 25 seconds
......@@ -716,7 +716,7 @@ function generate_inventory() {
"Inventaire créé !",
{
elementPosition:"bottom center",
className: "success",
className: "success"
}
);
}, 200);
......@@ -878,7 +878,7 @@ function delete_cdb_order() {
alert("Erreur lors de la suppression de la commande... Si l'erreur persiste contactez un administrateur svp.");
console.log(err);
reject();
reject(new Error("Error while deleting order"));
}
});
});
......@@ -1755,6 +1755,7 @@ function update_order_selection_screen() {
let order_id = $(order_name_container).text();
let modal_remove_order = $('#templates #modal_remove_order');
modal_remove_order.find(".remove_order_name").text(order_id);
openModal(
......@@ -1985,6 +1986,7 @@ $(document).ready(function() {
$("#delete_order_button").on("click", function(e) {
if (is_time_to('press_delete_order_button', 1000)) {
let modal_remove_order = $('#templates #modal_remove_order');
modal_remove_order.find(".remove_order_name").text(order_doc._id);
openModal(
......
......@@ -355,7 +355,7 @@ function display_orders_table() {
$('#orders').empty();
}
for (let j in orders) {
console.log(orders[j].id)
console.log(orders[j].id);
}
table_orders = $('#orders').DataTable({
data: orders,
......
......@@ -166,6 +166,7 @@ function init_datatable() {
let data = row.data();
let validated_data = qty_validation(qty, data.uom.id);
if (validated_data >= 0) {
data.qty = validated_data;
row.remove().draw();
......@@ -425,26 +426,31 @@ function qty_validation(qty, uom_id) {
$.notify("Il n'y a pas de quantité indiquée, ou ce n'est pas un nombre", {
globalPosition:"top right",
className: "error"});
return -1;
}
if (uom_id == 1) {
if (qty/parseInt(qty) != 1 && qty != 0){
if (qty/parseInt(qty) != 1 && qty != 0) {
$.notify("Une quantité avec décimale est indiquée alors que c'est un article à l'unité", {
globalPosition:"top right",
className: "error"});
return -2;}
return -2;
}
qty = parseInt(qty); // product by unit
} else {
qty = parseFloat(qty).toFixed(2);
}
if (isNaN(qty)){
if (isNaN(qty)) {
$.notify("Une quantité n'est pas un nombre", {
globalPosition:"top right",
className: "error"});
return -3;}
return -3;
}
return qty;
}
......
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