diff --git a/InvenTree/company/migrations/0009_auto_20191118_2323.py b/InvenTree/company/migrations/0009_auto_20191118_2323.py new file mode 100644 index 0000000000..0ad6c682f2 --- /dev/null +++ b/InvenTree/company/migrations/0009_auto_20191118_2323.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.5 on 2019-11-18 23:23 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('company', '0008_auto_20190913_1407'), + ] + + operations = [ + migrations.AlterField( + model_name='supplierpricebreak', + name='quantity', + field=models.DecimalField(decimal_places=5, default=1, max_digits=15, validators=[django.core.validators.MinValueValidator(1)]), + ), + ] diff --git a/InvenTree/company/models.py b/InvenTree/company/models.py index d1c340921a..f16902f783 100644 --- a/InvenTree/company/models.py +++ b/InvenTree/company/models.py @@ -379,7 +379,7 @@ class SupplierPriceBreak(models.Model): part = models.ForeignKey(SupplierPart, on_delete=models.CASCADE, related_name='pricebreaks') - quantity = models.PositiveIntegerField(default=1, validators=[MinValueValidator(1)]) + quantity = models.DecimalField(max_digits=15, decimal_places=5, default=1, validators=[MinValueValidator(1)]) cost = models.DecimalField(max_digits=10, decimal_places=5, validators=[MinValueValidator(0)]) diff --git a/InvenTree/locale/de/LC_MESSAGES/django.po b/InvenTree/locale/de/LC_MESSAGES/django.po index 551e1efe42..1fef1e40a9 100644 --- a/InvenTree/locale/de/LC_MESSAGES/django.po +++ b/InvenTree/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-18 23:21+0000\n" +"POT-Creation-Date: 2019-11-18 23:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -141,59 +141,59 @@ msgstr "" msgid "Confirm build completion" msgstr "" -#: build/models.py:52 +#: build/models.py:51 msgid "Brief description of the build" msgstr "" -#: build/models.py:61 +#: build/models.py:60 msgid "Select part to build" msgstr "" -#: build/models.py:67 +#: build/models.py:66 msgid "" "Select location to take stock from for this build (leave blank to take from " "any stock location)" msgstr "" -#: build/models.py:73 +#: build/models.py:72 msgid "Number of parts to build" msgstr "" -#: build/models.py:79 +#: build/models.py:78 msgid "Build status" msgstr "" -#: build/models.py:82 +#: build/models.py:81 msgid "Batch code for this build output" msgstr "" -#: build/models.py:94 +#: build/models.py:93 msgid "Link to external URL" msgstr "" -#: build/models.py:96 +#: build/models.py:95 msgid "Extra build notes" msgstr "" -#: build/models.py:381 +#: build/models.py:380 #, python-brace-format msgid "Selected stock item not found in BOM for part '{p}'" msgstr "" -#: build/models.py:384 +#: build/models.py:383 #, python-brace-format msgid "Allocated quantity ({n}) must not exceed available quantity ({q})" msgstr "" -#: build/models.py:402 +#: build/models.py:401 msgid "Build to allocate parts" msgstr "" -#: build/models.py:409 +#: build/models.py:408 msgid "Stock Item to allocate to build" msgstr "" -#: build/models.py:417 +#: build/models.py:416 msgid "Stock quantity to allocate to build" msgstr "" @@ -211,6 +211,7 @@ msgstr "" #: build/templates/build/allocate_edit.html:19 #: build/templates/build/allocate_view.html:17 +#: order/templates/order/purchase_order_detail.html:104 msgid "Part" msgstr "" @@ -237,6 +238,7 @@ msgid "Order Parts" msgstr "" #: build/templates/build/allocate_view.html:18 +#: order/templates/order/purchase_order_detail.html:105 #: part/templates/part/detail.html:33 msgid "Description" msgstr "" @@ -360,6 +362,60 @@ msgstr "" msgid "Number of items received" msgstr "" +#: order/templates/order/purchase_order_detail.html:60 +msgid "Purchase Order Details" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:63 +#: stock/templates/stock/item.html:125 +msgid "Supplier" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:67 +#: stock/templates/stock/item.html:146 +msgid "Status" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:71 +msgid "Created" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:76 +msgid "Issued" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:82 +#: order/templates/order/purchase_order_detail.html:110 +msgid "Received" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:103 +msgid "Line" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:106 +msgid "Order Code" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:107 +msgid "Reference" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:108 +#: stock/templates/stock/item.html:89 +#: stock/templates/stock/stock_adjust.html:20 +msgid "Quantity" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:112 +msgid "Note" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:165 +#: part/templates/part/detail.html:152 stock/templates/stock/item.html:151 +msgid "Notes" +msgstr "" + #: order/views.py:140 msgid "Confirm order cancellation" msgstr "" @@ -739,10 +795,6 @@ msgstr "" msgid "Part cannot be sold to customers" msgstr "" -#: part/templates/part/detail.html:152 stock/templates/stock/item.html:151 -msgid "Notes" -msgstr "" - #: part/templates/part/part_base.html:11 msgid "This part is not active" msgstr "" @@ -1017,11 +1069,6 @@ msgstr "" msgid "Serial Number" msgstr "" -#: stock/templates/stock/item.html:89 -#: stock/templates/stock/stock_adjust.html:20 -msgid "Quantity" -msgstr "" - #: stock/templates/stock/item.html:95 msgid "Batch" msgstr "" @@ -1030,10 +1077,6 @@ msgstr "" msgid "Customer" msgstr "" -#: stock/templates/stock/item.html:125 -msgid "Supplier" -msgstr "" - #: stock/templates/stock/item.html:129 msgid "Supplier Part" msgstr "" @@ -1050,10 +1093,6 @@ msgstr "" msgid "No stocktake performed" msgstr "" -#: stock/templates/stock/item.html:146 -msgid "Status" -msgstr "" - #: stock/templates/stock/item.html:160 msgid "Stock Tracking Information" msgstr "" diff --git a/InvenTree/locale/en/LC_MESSAGES/django.po b/InvenTree/locale/en/LC_MESSAGES/django.po index 551e1efe42..1fef1e40a9 100644 --- a/InvenTree/locale/en/LC_MESSAGES/django.po +++ b/InvenTree/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-18 23:21+0000\n" +"POT-Creation-Date: 2019-11-18 23:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -141,59 +141,59 @@ msgstr "" msgid "Confirm build completion" msgstr "" -#: build/models.py:52 +#: build/models.py:51 msgid "Brief description of the build" msgstr "" -#: build/models.py:61 +#: build/models.py:60 msgid "Select part to build" msgstr "" -#: build/models.py:67 +#: build/models.py:66 msgid "" "Select location to take stock from for this build (leave blank to take from " "any stock location)" msgstr "" -#: build/models.py:73 +#: build/models.py:72 msgid "Number of parts to build" msgstr "" -#: build/models.py:79 +#: build/models.py:78 msgid "Build status" msgstr "" -#: build/models.py:82 +#: build/models.py:81 msgid "Batch code for this build output" msgstr "" -#: build/models.py:94 +#: build/models.py:93 msgid "Link to external URL" msgstr "" -#: build/models.py:96 +#: build/models.py:95 msgid "Extra build notes" msgstr "" -#: build/models.py:381 +#: build/models.py:380 #, python-brace-format msgid "Selected stock item not found in BOM for part '{p}'" msgstr "" -#: build/models.py:384 +#: build/models.py:383 #, python-brace-format msgid "Allocated quantity ({n}) must not exceed available quantity ({q})" msgstr "" -#: build/models.py:402 +#: build/models.py:401 msgid "Build to allocate parts" msgstr "" -#: build/models.py:409 +#: build/models.py:408 msgid "Stock Item to allocate to build" msgstr "" -#: build/models.py:417 +#: build/models.py:416 msgid "Stock quantity to allocate to build" msgstr "" @@ -211,6 +211,7 @@ msgstr "" #: build/templates/build/allocate_edit.html:19 #: build/templates/build/allocate_view.html:17 +#: order/templates/order/purchase_order_detail.html:104 msgid "Part" msgstr "" @@ -237,6 +238,7 @@ msgid "Order Parts" msgstr "" #: build/templates/build/allocate_view.html:18 +#: order/templates/order/purchase_order_detail.html:105 #: part/templates/part/detail.html:33 msgid "Description" msgstr "" @@ -360,6 +362,60 @@ msgstr "" msgid "Number of items received" msgstr "" +#: order/templates/order/purchase_order_detail.html:60 +msgid "Purchase Order Details" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:63 +#: stock/templates/stock/item.html:125 +msgid "Supplier" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:67 +#: stock/templates/stock/item.html:146 +msgid "Status" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:71 +msgid "Created" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:76 +msgid "Issued" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:82 +#: order/templates/order/purchase_order_detail.html:110 +msgid "Received" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:103 +msgid "Line" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:106 +msgid "Order Code" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:107 +msgid "Reference" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:108 +#: stock/templates/stock/item.html:89 +#: stock/templates/stock/stock_adjust.html:20 +msgid "Quantity" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:112 +msgid "Note" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:165 +#: part/templates/part/detail.html:152 stock/templates/stock/item.html:151 +msgid "Notes" +msgstr "" + #: order/views.py:140 msgid "Confirm order cancellation" msgstr "" @@ -739,10 +795,6 @@ msgstr "" msgid "Part cannot be sold to customers" msgstr "" -#: part/templates/part/detail.html:152 stock/templates/stock/item.html:151 -msgid "Notes" -msgstr "" - #: part/templates/part/part_base.html:11 msgid "This part is not active" msgstr "" @@ -1017,11 +1069,6 @@ msgstr "" msgid "Serial Number" msgstr "" -#: stock/templates/stock/item.html:89 -#: stock/templates/stock/stock_adjust.html:20 -msgid "Quantity" -msgstr "" - #: stock/templates/stock/item.html:95 msgid "Batch" msgstr "" @@ -1030,10 +1077,6 @@ msgstr "" msgid "Customer" msgstr "" -#: stock/templates/stock/item.html:125 -msgid "Supplier" -msgstr "" - #: stock/templates/stock/item.html:129 msgid "Supplier Part" msgstr "" @@ -1050,10 +1093,6 @@ msgstr "" msgid "No stocktake performed" msgstr "" -#: stock/templates/stock/item.html:146 -msgid "Status" -msgstr "" - #: stock/templates/stock/item.html:160 msgid "Stock Tracking Information" msgstr "" diff --git a/InvenTree/locale/es/LC_MESSAGES/django.po b/InvenTree/locale/es/LC_MESSAGES/django.po index 551e1efe42..1fef1e40a9 100644 --- a/InvenTree/locale/es/LC_MESSAGES/django.po +++ b/InvenTree/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-18 23:21+0000\n" +"POT-Creation-Date: 2019-11-18 23:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -141,59 +141,59 @@ msgstr "" msgid "Confirm build completion" msgstr "" -#: build/models.py:52 +#: build/models.py:51 msgid "Brief description of the build" msgstr "" -#: build/models.py:61 +#: build/models.py:60 msgid "Select part to build" msgstr "" -#: build/models.py:67 +#: build/models.py:66 msgid "" "Select location to take stock from for this build (leave blank to take from " "any stock location)" msgstr "" -#: build/models.py:73 +#: build/models.py:72 msgid "Number of parts to build" msgstr "" -#: build/models.py:79 +#: build/models.py:78 msgid "Build status" msgstr "" -#: build/models.py:82 +#: build/models.py:81 msgid "Batch code for this build output" msgstr "" -#: build/models.py:94 +#: build/models.py:93 msgid "Link to external URL" msgstr "" -#: build/models.py:96 +#: build/models.py:95 msgid "Extra build notes" msgstr "" -#: build/models.py:381 +#: build/models.py:380 #, python-brace-format msgid "Selected stock item not found in BOM for part '{p}'" msgstr "" -#: build/models.py:384 +#: build/models.py:383 #, python-brace-format msgid "Allocated quantity ({n}) must not exceed available quantity ({q})" msgstr "" -#: build/models.py:402 +#: build/models.py:401 msgid "Build to allocate parts" msgstr "" -#: build/models.py:409 +#: build/models.py:408 msgid "Stock Item to allocate to build" msgstr "" -#: build/models.py:417 +#: build/models.py:416 msgid "Stock quantity to allocate to build" msgstr "" @@ -211,6 +211,7 @@ msgstr "" #: build/templates/build/allocate_edit.html:19 #: build/templates/build/allocate_view.html:17 +#: order/templates/order/purchase_order_detail.html:104 msgid "Part" msgstr "" @@ -237,6 +238,7 @@ msgid "Order Parts" msgstr "" #: build/templates/build/allocate_view.html:18 +#: order/templates/order/purchase_order_detail.html:105 #: part/templates/part/detail.html:33 msgid "Description" msgstr "" @@ -360,6 +362,60 @@ msgstr "" msgid "Number of items received" msgstr "" +#: order/templates/order/purchase_order_detail.html:60 +msgid "Purchase Order Details" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:63 +#: stock/templates/stock/item.html:125 +msgid "Supplier" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:67 +#: stock/templates/stock/item.html:146 +msgid "Status" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:71 +msgid "Created" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:76 +msgid "Issued" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:82 +#: order/templates/order/purchase_order_detail.html:110 +msgid "Received" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:103 +msgid "Line" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:106 +msgid "Order Code" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:107 +msgid "Reference" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:108 +#: stock/templates/stock/item.html:89 +#: stock/templates/stock/stock_adjust.html:20 +msgid "Quantity" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:112 +msgid "Note" +msgstr "" + +#: order/templates/order/purchase_order_detail.html:165 +#: part/templates/part/detail.html:152 stock/templates/stock/item.html:151 +msgid "Notes" +msgstr "" + #: order/views.py:140 msgid "Confirm order cancellation" msgstr "" @@ -739,10 +795,6 @@ msgstr "" msgid "Part cannot be sold to customers" msgstr "" -#: part/templates/part/detail.html:152 stock/templates/stock/item.html:151 -msgid "Notes" -msgstr "" - #: part/templates/part/part_base.html:11 msgid "This part is not active" msgstr "" @@ -1017,11 +1069,6 @@ msgstr "" msgid "Serial Number" msgstr "" -#: stock/templates/stock/item.html:89 -#: stock/templates/stock/stock_adjust.html:20 -msgid "Quantity" -msgstr "" - #: stock/templates/stock/item.html:95 msgid "Batch" msgstr "" @@ -1030,10 +1077,6 @@ msgstr "" msgid "Customer" msgstr "" -#: stock/templates/stock/item.html:125 -msgid "Supplier" -msgstr "" - #: stock/templates/stock/item.html:129 msgid "Supplier Part" msgstr "" @@ -1050,10 +1093,6 @@ msgstr "" msgid "No stocktake performed" msgstr "" -#: stock/templates/stock/item.html:146 -msgid "Status" -msgstr "" - #: stock/templates/stock/item.html:160 msgid "Stock Tracking Information" msgstr "" diff --git a/InvenTree/order/migrations/0013_auto_20191118_2323.py b/InvenTree/order/migrations/0013_auto_20191118_2323.py new file mode 100644 index 0000000000..33db8f9ebd --- /dev/null +++ b/InvenTree/order/migrations/0013_auto_20191118_2323.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.5 on 2019-11-18 23:23 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('order', '0012_auto_20190617_1943'), + ] + + operations = [ + migrations.AlterField( + model_name='purchaseorderlineitem', + name='quantity', + field=models.DecimalField(decimal_places=5, default=1, help_text='Item quantity', max_digits=15, validators=[django.core.validators.MinValueValidator(0)]), + ), + ] diff --git a/InvenTree/order/migrations/0014_auto_20191118_2328.py b/InvenTree/order/migrations/0014_auto_20191118_2328.py new file mode 100644 index 0000000000..6020fddd87 --- /dev/null +++ b/InvenTree/order/migrations/0014_auto_20191118_2328.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.5 on 2019-11-18 23:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('order', '0013_auto_20191118_2323'), + ] + + operations = [ + migrations.AlterField( + model_name='purchaseorderlineitem', + name='received', + field=models.DecimalField(decimal_places=5, default=0, help_text='Number of items received', max_digits=15), + ), + ] diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index de0ac86bad..f9f32c2f00 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -242,7 +242,7 @@ class OrderLineItem(models.Model): class Meta: abstract = True - quantity = models.PositiveIntegerField(validators=[MinValueValidator(0)], default=1, help_text=_('Item quantity')) + quantity = models.DecimalField(max_digits=15, decimal_places=5, validators=[MinValueValidator(0)], default=1, help_text=_('Item quantity')) reference = models.CharField(max_length=100, blank=True, help_text=_('Line item reference')) @@ -284,7 +284,7 @@ class PurchaseOrderLineItem(OrderLineItem): help_text=_("Supplier part"), ) - received = models.PositiveIntegerField(default=0, help_text=_('Number of items received')) + received = models.DecimalField(decimal_places=5, max_digits=15, default=0, help_text=_('Number of items received')) def remaining(self): """ Calculate the number of items remaining to be received """ diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index d988f20739..d0bd0e3f53 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -1,6 +1,8 @@ {% extends "base.html" %} +{% load i18n %} {% load static %} +{% load inventree_extras %} {% block page_title %} InvenTree | {{ order }} @@ -55,29 +57,29 @@ InvenTree | {{ order }}
-

Purchase Order Details

+

{% trans "Purchase Order Details" %}

- + - + - + {% if order.issue_date %} - + {% endif %} {% if order.status == OrderStatus.COMPLETE %} - + {% endif %} @@ -98,16 +100,16 @@ InvenTree | {{ order }}
Supplier{% trans "Supplier" %} {{ order.supplier }}
Status{% trans "Status" %} {% include "order/order_status.html" %}
Created{% trans "Created" %} {{ order.creation_date }}{{ order.created_by }}
Issued{% trans "Issued" %} {{ order.issue_date }}
Received{% trans "Received" %} {{ order.complete_date }}{{ order.received_by }}
- - - - - - + + + + + + {% if not order.status == OrderStatus.PENDING %} - + {% endif %} - + @@ -128,9 +130,9 @@ InvenTree | {{ order }} {% endif %} - + {% if not order.status == OrderStatus.PENDING %} - + {% endif %}
LinePartDescriptionOrder CodeReferenceQuantity{% trans "Line" %}{% trans "Part" %}{% trans "Description" %}{% trans "Order Code" %}{% trans "Reference" %}{% trans "Quantity" %}Received{% trans "Received" %}Note{% trans "Note" %}
Warning: Part has been deleted.{{ line.reference }}{{ line.quantity }}{% decimal line.quantity %}{{ line.received }}{% decimal line.received %} {{ line.notes }} @@ -160,7 +162,7 @@ InvenTree | {{ order }} {% if order.notes %}
-
Notes
+
{% trans "Notes" %}
{{ order.notes }}
{% endif %}