diff --git a/kfet/forms.py b/kfet/forms.py index 0fc02dd3..67103de6 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -463,7 +463,7 @@ class InventoryArticleForm(forms.Form): queryset = Article.objects.all(), widget = forms.HiddenInput(), ) - stock_new = forms.IntegerField(required = False) + stock_new = forms.IntegerField(required=False) def __init__(self, *args, **kwargs): super(InventoryArticleForm, self).__init__(*args, **kwargs) @@ -472,6 +472,7 @@ class InventoryArticleForm(forms.Form): self.stock_old = kwargs['initial']['stock_old'] self.category = kwargs['initial']['category'] self.category_name = kwargs['initial']['category__name'] + self.box_capacity = kwargs['initial']['box_capacity'] # ----- # Order forms diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index 563d3839..5a82b5cf 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -32,6 +32,7 @@ textarea { .table { margin-bottom:0; + border-bottom:1px solid #ddd; } .table { @@ -230,6 +231,9 @@ textarea { height:28px; margin:3px 0px; } + .content-center .auth-form { + margin:15px; +} /* * Pages formulaires seuls @@ -549,3 +553,18 @@ thead .tooltip { .help-block { padding-top: 15px; } + +/* Inventaires */ + +.inventory_modified { + background:rgba(236,100,0,0.15); +} + +.stock_diff { + padding-left: 5px; + color:#C8102E; +} + +.inventory_update { + display:none; +} diff --git a/kfet/static/kfet/css/jconfirm-kfet.css b/kfet/static/kfet/css/jconfirm-kfet.css index 0bd53ab7..1aee70f1 100644 --- a/kfet/static/kfet/css/jconfirm-kfet.css +++ b/kfet/static/kfet/css/jconfirm-kfet.css @@ -28,6 +28,7 @@ .jconfirm .jconfirm-box .content { border-bottom:1px solid #ddd; + padding:5px 10px; } .jconfirm .jconfirm-box input { diff --git a/kfet/templates/kfet/inventory_create.html b/kfet/templates/kfet/inventory_create.html index d4f53c3c..d8109f8e 100644 --- a/kfet/templates/kfet/inventory_create.html +++ b/kfet/templates/kfet/inventory_create.html @@ -1,4 +1,11 @@ {% extends 'kfet/base.html' %} +{% load staticfiles %} +{% load widget_tweaks %} + +{% block extra_head %} + + +{% endblock %} {% block title %}Nouvel inventaire{% endblock %} {% block content-header-title %}Nouvel inventaire{% endblock %} @@ -6,38 +13,194 @@ {% block content %} {% include 'kfet/base_messages.html' %} - -
- - - - - - - - - - {% for form in formset %} - {% ifchanged form.category %} +
+
+ +
ArticleThéo.Réel
+ - + + + + + + + + - {% endifchanged %} - - {{ form.article }} - - - - - {% endfor %} - -
{{ form.category_name }}ArticleQuantité par caisseStock ThéoriqueCaisses en réserveCaisses en arrièreVracStock totalCompte terminé
{{ form.name }}{{ form.stock_old }}{{ form.stock_new }}
- {% if not perms.kfet.add_inventory %} - - {% endif %} - {% csrf_token %} - {{ formset.management_form }} - -
+ + + {% for form in formset %} + {% ifchanged form.category %} + + {{ form.category_name }} + + + {% endifchanged %} + + {{ form.article }} + {{ form.name }} + {{ form.box_capacity }} + {{ form.stock_old }} + +
+
+ +
+ + +
+ + +
+ + +
{{ form.stock_new | attr:"readonly"| add_class:"form-control" }}
+
+ + + + {% endfor %} + + + {{ formset.management_form }} + {% if not perms.kfet.add_inventory %} +
+ {% include "kfet/form_authentication_snippet.html" %} +
+ {% endif %} + + {% csrf_token %} + + + + + + {% endblock %} diff --git a/kfet/templates/kfet/order_create.html b/kfet/templates/kfet/order_create.html index 1bd6d54f..c2d07f76 100644 --- a/kfet/templates/kfet/order_create.html +++ b/kfet/templates/kfet/order_create.html @@ -66,11 +66,13 @@ {% endfor %} - {% if not perms.kfet.add_order %} - - {% endif %} {{ formset.management_form }} - + {% if not perms.kfet.add_inventory %} +
+ {% include "kfet/form_authentication_snippet.html" %} +
+ {% endif %} + diff --git a/kfet/templates/kfet/order_to_inventory.html b/kfet/templates/kfet/order_to_inventory.html index 5fe920e9..321b8b92 100644 --- a/kfet/templates/kfet/order_to_inventory.html +++ b/kfet/templates/kfet/order_to_inventory.html @@ -42,11 +42,13 @@ {% endfor %} - {% if not perms.kfet.order_to_inventory %} - - {% endif %} {{ formset.management_form }} - + {% if not perms.kfet.add_inventory %} +
+ {% include "kfet/form_authentication_snippet.html" %} +
+ {% endif %} + diff --git a/kfet/views.py b/kfet/views.py index b4d1328b..78c65002 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -1654,7 +1654,8 @@ def inventory_create(request): 'stock_old': article.stock, 'name' : article.name, 'category' : article.category_id, - 'category__name': article.category.name + 'category__name': article.category.name, + 'box_capacity': article.box_capacity or 0, }) cls_formset = formset_factory(