Merge branch 'Aufinal/fix_stock_ws' into 'master'

K-Psul
- Fix: indicateur de stock bas

See merge request !201
This commit is contained in:
Aurélien Delobelle 2017-04-01 12:36:59 +02:00
commit c355316045

View file

@ -1340,11 +1340,19 @@ $(document).ready(function() {
}
}
for (var i=0; i<data['articles'].length; i++) {
article = data['articles'][i];
articles_container.find('#data-article-'+article['id'])
.addClass('low-stock');
articles_container.find('#data-article-'+article['id']+' .stock')
var article = data['articles'][i];
var article_line = articles_container.find('#data-article-'+article.id);
if (article.stock <= 5 && article.stock >= -5) {
article_line.addClass('low-stock');
} else {
article_line.removeClass('low-stock');
}
article_line.find('.stock')
.text(article['stock']);
var i = 0;
while (i < articlesList.length && articlesList[i][1] != article.id) i++ ;
articlesList[i][4] = article.stock ;
}
if (data['addcost']) {
settings['addcost_for'] = data['addcost']['for'];