From 3ce4dc5c859407195bf0468239be0fa2fb75b793 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Mon, 3 Apr 2017 20:14:45 -0300 Subject: [PATCH] Add article stock management --- kfet/static/kfet/js/kpsul.js | 3 +++ kfet/templates/kfet/kpsul.html | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kfet/static/kfet/js/kpsul.js b/kfet/static/kfet/js/kpsul.js index 67af4e57..f8270855 100644 --- a/kfet/static/kfet/js/kpsul.js +++ b/kfet/static/kfet/js/kpsul.js @@ -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': '
', 'article' : '
'} @@ -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() ; diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html index 3feba529..493a9e97 100644 --- a/kfet/templates/kfet/kpsul.html +++ b/kfet/templates/kfet/kpsul.html @@ -128,7 +128,6 @@ -