Add article stock management

This commit is contained in:
Ludovic Stephan 2017-04-03 20:14:45 -03:00
parent b91edc9c7d
commit 3ce4dc5c85
2 changed files with 3 additions and 1 deletions

View file

@ -376,6 +376,7 @@ class ArticleManager {
this._$container = $('#articles_data');
this._$input = $('#article_autocomplete');
this._$nb = $('#article_number');
this._$stock = $('#article_stock');
this.templates = {'category': '<div class="category"><span class="name"></span></div>',
'article' : '<div class="article"><span class="name"></span><span class="price"></span><span class="stock"></span></div>'}
@ -398,6 +399,7 @@ class ArticleManager {
this.selected.from(article) ;
this._$input.val(article.name);
this._$nb.val('1');
this._$stock.text('/'+article.stock);
this._$nb.focus().select();
}
@ -431,6 +433,7 @@ class ArticleManager {
reset() {
this.unset() ;
this._$stock.text('');
this._$nb.val('');
this._$input.val('');
this.autocomplete.showAll() ;

View file

@ -128,7 +128,6 @@
<input type="text" id="article_autocomplete" autocomplete="off">
<input type="number" id="article_number" step="1" min="1">
<span type="stock" id="article_stock"></span>
<input type="hidden" id="article_id" value="">
</div>
<div id="articles_data">
</div>