Commit e111113b authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_production_planning: set to 0 for not integer value

parent 02686daf
......@@ -110,7 +110,8 @@ function listenToInputChange(matrixbox_container) {
td_index,
sum_span,
sum,
previous_value;
previous_value,
actual_value;
$('td input').bind('input', null, function (e) {
var input = $(this);
if (input[0].getAttribute('value') != input[0].value) {
......@@ -122,8 +123,9 @@ function listenToInputChange(matrixbox_container) {
sum_span = sum_line.find('td:eq(' + (td_index) + ') span');
sum = parseInt(sum_span.text());
previous_value = input[0].getAttribute('data-previous-value') || input[0].getAttribute('value');
sum = sum + ((parseInt(input[0].value || 0)) - parseInt(previous_value));
input[0].setAttribute('data-previous-value', input[0].value || 0);
actual_value = parseInt(input[0].value) || 0;
sum = sum + (actual_value - parseInt(previous_value));
input[0].setAttribute('data-previous-value', actual_value);
sum_span.text(format(sum));
});
}
......
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