interface for order_to_inventory

This commit is contained in:
Ludovic Stephan 2017-02-12 18:04:50 -02:00
parent db899a891b
commit 3dfd8bf616
2 changed files with 21 additions and 11 deletions

View file

@ -472,6 +472,7 @@ class InventoryArticleForm(forms.Form):
# ----- # -----
class OrderArticleForm(forms.Form): class OrderArticleForm(forms.Form):
article = forms.ModelChoiceField( article = forms.ModelChoiceField(
queryset=Article.objects.all(), queryset=Article.objects.all(),
@ -506,14 +507,18 @@ class OrderArticleToInventoryForm(forms.Form):
) )
price_HT = forms.DecimalField( price_HT = forms.DecimalField(
max_digits = 7, decimal_places = 4, max_digits = 7, decimal_places = 4,
required = False) required = False,
widget=forms.NumberInput(attrs={'class': 'form-control'}))
TVA = forms.DecimalField( TVA = forms.DecimalField(
max_digits = 7, decimal_places = 2, max_digits = 7, decimal_places = 2,
required = False) required = False,
widget=forms.NumberInput(attrs={'class': 'form-control'}))
rights = forms.DecimalField( rights = forms.DecimalField(
max_digits = 7, decimal_places = 4, max_digits = 7, decimal_places = 4,
required = False) required = False,
quantity_received = forms.IntegerField() widget=forms.NumberInput(attrs={'class': 'form-control'}))
quantity_received = forms.IntegerField(
widget=forms.NumberInput(attrs={'class': 'form-control'}))
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(OrderArticleToInventoryForm, self).__init__(*args, **kwargs) super(OrderArticleToInventoryForm, self).__init__(*args, **kwargs)

View file

@ -7,24 +7,27 @@
{% include 'kfet/base_messages.html' %} {% include 'kfet/base_messages.html' %}
<div class="content-right-block">
<div>
<form action="" method="post"> <form action="" method="post">
{% csrf_token %} {% csrf_token %}
<table> <table class='table table-condensed text-center'>
<thead> <thead>
<tr> <tr>
<td>Article</td> <td style="width:25%">Article</td>
<td>HT</td> <td>Prix HT</td>
<td>TVA</td> <td>TVA</td>
<td>Droits</td> <td>Droits</td>
<td>Com.</td> <td>Commandé</td>
<td>Reçu</td> <td>Reçu</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for form in formset %} {% for form in formset %}
{% ifchanged form.category %} {% ifchanged form.category %}
<tr> <tr class='section'>
<td colspan="6">{{ form.category_name }}</td> <td>{{ form.category_name }}</td>
<td colspan="5"></td>
</tr> </tr>
{% endifchanged %} {% endifchanged %}
<tr> <tr>
@ -42,7 +45,9 @@
<input type="password" name="KFETPASSWORD"> <input type="password" name="KFETPASSWORD">
{% endif %} {% endif %}
{{ formset.management_form }} {{ formset.management_form }}
<input type="submit" value="Enregistrer"> <input type="submit" class="btn btn-primary btn-lg btn-block" value="Enregistrer">
</form> </form>
</div>
</div>
{% endblock %} {% endblock %}