From 17af973da3550977f226c32c2dc9cf915fb6365c Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 18 Aug 2022 18:50:05 +0200 Subject: [PATCH] FIX erreur --- htdocs/mrp/js/lib_dispatch.js.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/js/lib_dispatch.js.php b/htdocs/mrp/js/lib_dispatch.js.php index ac2b9bacf15..18e7d073fac 100644 --- a/htdocs/mrp/js/lib_dispatch.js.php +++ b/htdocs/mrp/js/lib_dispatch.js.php @@ -95,14 +95,15 @@ function addDispatchLine(index, type, mode) // If user did not reduced the qty to dispatch on old line, we keep only 1 on old line and the rest on new line if (qtyDispatched == qtyOrdered && qtyDispatched > 1) { qtyDispatched = parseFloat($("#qty_dispatched_" + index).val()) + 1; - if (mode != 'allmissingconsume' || mode != 'alltoproduce') mode = 'lessone'; } if(mode == 'allmissingconsume' || mode == 'alltoproduce') { var qtymax = parseFloat($($row).data('max-qty')); + if(qtymax === 'undefined') qtymax = 1; } } + if(mode == 'allmissingconsume' || mode == 'alltoproduce') { var count = 0; var qtyalreadyused = 0; @@ -110,7 +111,6 @@ function addDispatchLine(index, type, mode) while (count < qty) { //If remaining qty needed is inferior to qtymax, qtymax = remaining qty needed if ((qtyalreadyused + qtymax) > qtyOrdered) qtymax = qtyOrdered - qtyalreadyused; - //If first line, we replace value, not add line if(count === 0){ $("#"+inputId+"-"+index+"-"+nbrTrs).val(qtymax);