Commit cc101100 by François C.

Fix eslint warning

parent 5b119348
Pipeline #1888 passed with stage
in 1 minute 32 seconds
...@@ -68,8 +68,7 @@ function prepare_server_data(data) { ...@@ -68,8 +68,7 @@ function prepare_server_data(data) {
if (history_item.associate_registered == false || history_item.associate_registered == undefined) { if (history_item.associate_registered == false || history_item.associate_registered == undefined) {
history_item.associate_registered = ""; history_item.associate_registered = "";
} } else {
else {
if (partner_data.associated_partner_id != "False") { if (partner_data.associated_partner_id != "False") {
if (history_item.associate_registered==="partner") { if (history_item.associate_registered==="partner") {
history_item.associate_registered = partner_data.name; history_item.associate_registered = partner_data.name;
......
...@@ -36,7 +36,7 @@ function add_or_change_shift(new_shift_id) { ...@@ -36,7 +36,7 @@ function add_or_change_shift(new_shift_id) {
+'&idPartner=' + partner_data.partner_id +'&idPartner=' + partner_data.partner_id
+ '&shift_type=' + partner_data.shift_type + '&shift_type=' + partner_data.shift_type
+ '&verif_token=' + partner_data.verif_token; + '&verif_token=' + partner_data.verif_token;
} else if(partner_data.is_associated_people === "True" && block_actions_for_attached_people === "False") { } else if (partner_data.is_associated_people === "True" && block_actions_for_attached_people === "False") {
tData = 'idNewShift=' + new_shift_id tData = 'idNewShift=' + new_shift_id
+'&idPartner=' + partner_data.parent_id +'&idPartner=' + partner_data.parent_id
+ '&shift_type=' + partner_data.shift_type + '&shift_type=' + partner_data.shift_type
......
...@@ -196,6 +196,7 @@ var process_new_product_qty = function(input) { ...@@ -196,6 +196,7 @@ var process_new_product_qty = function(input) {
* *
* @returns -1 if validation failed, 0 otherwise * @returns -1 if validation failed, 0 otherwise
*/ */
function add_product() { function add_product() {
const user_input = $("#product_input").val(); const user_input = $("#product_input").val();
...@@ -258,6 +259,7 @@ function add_product() { ...@@ -258,6 +259,7 @@ function add_product() {
} }
function compute_purchase_qty_for_coverage(product, coeff, stock, incoming_qty, daily_conso, days) { function compute_purchase_qty_for_coverage(product, coeff, stock, incoming_qty, daily_conso, days) {
let purchase_qty_for_coverage = null; let purchase_qty_for_coverage = null;
purchase_qty_for_coverage = days * daily_conso - stock - incoming_qty + product.minimal_stock; purchase_qty_for_coverage = days * daily_conso - stock - incoming_qty + product.minimal_stock;
purchase_qty_for_coverage = (purchase_qty_for_coverage < 0) ? 0 : purchase_qty_for_coverage; purchase_qty_for_coverage = (purchase_qty_for_coverage < 0) ? 0 : purchase_qty_for_coverage;
...@@ -283,6 +285,7 @@ function compute_and_affect_product_supplier_quantities(coeff, days) { ...@@ -283,6 +285,7 @@ function compute_and_affect_product_supplier_quantities(coeff, days) {
const stock = product.qty_available; const stock = product.qty_available;
const incoming_qty = product.incoming_qty; const incoming_qty = product.incoming_qty;
const daily_conso = product.daily_conso; const daily_conso = product.daily_conso;
purchase_package_qty_for_coverage = compute_purchase_qty_for_coverage(product, coeff, stock, incoming_qty, daily_conso, days); purchase_package_qty_for_coverage = compute_purchase_qty_for_coverage(product, coeff, stock, incoming_qty, daily_conso, days);
// Set qty to purchase for first supplier only // Set qty to purchase for first supplier only
products[key].suppliersinfo[0].qty = purchase_package_qty_for_coverage; products[key].suppliersinfo[0].qty = purchase_package_qty_for_coverage;
...@@ -300,6 +303,7 @@ function compute_products_coverage_qties() { ...@@ -300,6 +303,7 @@ function compute_products_coverage_qties() {
return new Promise((resolve) => { return new Promise((resolve) => {
const pc_adjust = $('#percent_adjust_input').val(); const pc_adjust = $('#percent_adjust_input').val();
let coeff = 1; let coeff = 1;
if (!isNaN(parseFloat(pc_adjust))) { if (!isNaN(parseFloat(pc_adjust))) {
coeff = (1 + parseFloat(pc_adjust) /100); coeff = (1 + parseFloat(pc_adjust) /100);
} }
...@@ -315,7 +319,7 @@ function compute_products_coverage_qties() { ...@@ -315,7 +319,7 @@ function compute_products_coverage_qties() {
step = 1; step = 1;
//Let's compute the nearst amount, by changing days quantity //Let's compute the nearst amount, by changing days quantity
while(go_on == true && iter < max_iter) { while (go_on == true && iter < max_iter) {
order_total_value = 0; order_total_value = 0;
compute_and_affect_product_supplier_quantities(coeff, days); compute_and_affect_product_supplier_quantities(coeff, days);
_compute_total_values_by_supplier(); _compute_total_values_by_supplier();
...@@ -2263,12 +2267,12 @@ $(document).ready(function() { ...@@ -2263,12 +2267,12 @@ $(document).ready(function() {
.then(() => { .then(() => {
debounceFunction(update_cdb_order); debounceFunction(update_cdb_order);
update_main_screen(); update_main_screen();
}) });
} else { } else {
$("#coverage_days_input").val(order_doc.coverage_days || ''); $("#coverage_days_input").val(order_doc.coverage_days || '');
$('#targeted_amount_input').val(order_doc.targeted_amount || ''); $('#targeted_amount_input').val(order_doc.targeted_amount || '');
alert("Ni le nombre de jours de couverture, ni le montant à atteindre sont correctement renseignés") alert("Ni le nombre de jours de couverture, ni le montant à atteindre sont correctement renseignés");
} }
} }
...@@ -2328,7 +2332,7 @@ $(document).ready(function() { ...@@ -2328,7 +2332,7 @@ $(document).ready(function() {
update_main_screen(); update_main_screen();
debounceFunction(update_cdb_order); debounceFunction(update_cdb_order);
closeModal(); closeModal();
}) });
}); });
} }
...@@ -2606,17 +2610,19 @@ $(document).ready(function() { ...@@ -2606,17 +2610,19 @@ $(document).ready(function() {
// Indeed, capturing click only remove the ability to click to have focus on the input to type a number. // Indeed, capturing click only remove the ability to click to have focus on the input to type a number.
$(document).on("mousedown", '[type="number"]', function() { $(document).on("mousedown", '[type="number"]', function() {
const clicked = this; const clicked = this;
qties_values[$(clicked).attr('id')] = $(clicked).val(); qties_values[$(clicked).attr('id')] = $(clicked).val();
}); });
$(document).on("mouseup", '[type="number"]', function() { $(document).on("mouseup", '[type="number"]', function() {
const clicked = this; const clicked = this;
try { try {
if ($(clicked).val() != qties_values[$(clicked).attr('id')]) { if ($(clicked).val() != qties_values[$(clicked).attr('id')]) {
process_new_product_qty(clicked); process_new_product_qty(clicked);
} }
} catch(err) { } catch (err) {
console.log(err) console.log(err);
} }
}); });
} }
......
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