forked from DGNum/gestioCOF
Merge branch 'Aufinal/fix_stock_ws' into 'master'
K-Psul - Fix: indicateur de stock bas See merge request !201
This commit is contained in:
commit
c355316045
1 changed files with 12 additions and 4 deletions
|
@ -1340,11 +1340,19 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (var i=0; i<data['articles'].length; i++) {
|
for (var i=0; i<data['articles'].length; i++) {
|
||||||
article = data['articles'][i];
|
var article = data['articles'][i];
|
||||||
articles_container.find('#data-article-'+article['id'])
|
var article_line = articles_container.find('#data-article-'+article.id);
|
||||||
.addClass('low-stock');
|
if (article.stock <= 5 && article.stock >= -5) {
|
||||||
articles_container.find('#data-article-'+article['id']+' .stock')
|
article_line.addClass('low-stock');
|
||||||
|
} else {
|
||||||
|
article_line.removeClass('low-stock');
|
||||||
|
}
|
||||||
|
article_line.find('.stock')
|
||||||
.text(article['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']) {
|
if (data['addcost']) {
|
||||||
settings['addcost_for'] = data['addcost']['for'];
|
settings['addcost_for'] = data['addcost']['for'];
|
||||||
|
|
Loading…
Reference in a new issue