forked from DGNum/gestioCOF
Fix ws stock update
This commit is contained in:
parent
f063c3470c
commit
ca6e120a38
1 changed files with 11 additions and 2 deletions
|
@ -1350,10 +1350,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];
|
article = data['articles'][i];
|
||||||
|
if (article.stock <= 5 && article.stock >= -5) {
|
||||||
articles_container.find('#data-article-'+article['id'])
|
articles_container.find('#data-article-'+article['id'])
|
||||||
.addClass('low-stock');
|
.addClass('low-stock');
|
||||||
|
} else {
|
||||||
|
articles_container.find('#data-article-'+article['id'])
|
||||||
|
.removeClass('low-stock');
|
||||||
|
}
|
||||||
articles_container.find('#data-article-'+article['id']+' .stock')
|
articles_container.find('#data-article-'+article['id']+' .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…
Add table
Reference in a new issue