diff --git a/InvenTree/InvenTree/static/script/inventree/build.js b/InvenTree/InvenTree/static/script/inventree/build.js
index aa938ecd53..8ec872bbcb 100644
--- a/InvenTree/InvenTree/static/script/inventree/build.js
+++ b/InvenTree/InvenTree/static/script/inventree/build.js
@@ -71,7 +71,7 @@ function loadAllocationTable(table, part_id, part, url, required, button) {
var count = 0;
for (var i = 0; i < results.length; i++) {
- count += results[i].quantity;
+ count += parseFloat(results[i].quantity);
}
updateAllocationTotal(part_id, count, required);
diff --git a/InvenTree/build/templates/build/allocation_item.html b/InvenTree/build/templates/build/allocation_item.html
index 87b6ba1340..0492e44280 100644
--- a/InvenTree/build/templates/build/allocation_item.html
+++ b/InvenTree/build/templates/build/allocation_item.html
@@ -18,7 +18,7 @@
{% decimal item.sub_part.total_stock %}
- {% multiply build.quantity item.quantity %}
+ {% multiply build.quantity item.quantity %}{% if item.overage %} (+ {{ item.overage }}){% endif %}
{% part_allocation_count build item.sub_part %}
diff --git a/InvenTree/company/templates/company/supplier_part_base.html b/InvenTree/company/templates/company/supplier_part_base.html
index f7e6ce88cc..76f75094f7 100644
--- a/InvenTree/company/templates/company/supplier_part_base.html
+++ b/InvenTree/company/templates/company/supplier_part_base.html
@@ -21,19 +21,49 @@ InvenTree | {% trans "Supplier Part" %}
-
-
+
+
{% trans "Supplier Part Details" %}
+
+
+ {% trans "Internal Part" %} |
+
+ {% if part.part %}
+ {{ part.part.full_name }}
+ {% endif %}
+ |
+
+ {% trans "Supplier" %} | {{ part.supplier.name }} |
+ {% trans "SKU" %} | {{ part.SKU }} |
+ {% if part.URL %}
+ {% trans "URL" %} | {{ part.URL }} |
+ {% endif %}
+ {% if part.description %}
+ {% trans "Description" %} | {{ part.description }} |
+ {% endif %}
+ {% if part.manufacturer %}
+ {% trans "Manufacturer" %} | {{ part.manufacturer }} |
+ {% trans "MPN" %} | {{ part.MPN }} |
+ {% endif %}
+ {% if part.note %}
+ {% trans "Note" %} | {{ part.note }} |
+ {% endif %}
+
+
+
+
+
+
diff --git a/InvenTree/company/templates/company/supplier_part_tabs.html b/InvenTree/company/templates/company/supplier_part_tabs.html
index 0bcd8aa4fa..b3a4389bbd 100644
--- a/InvenTree/company/templates/company/supplier_part_tabs.html
+++ b/InvenTree/company/templates/company/supplier_part_tabs.html
@@ -1,9 +1,6 @@
{% load i18n %}
- -
- {% trans "Details" %}
-
-
{% trans "Pricing" %}
diff --git a/InvenTree/company/urls.py b/InvenTree/company/urls.py
index 66cc0b9cd8..65eba73f84 100644
--- a/InvenTree/company/urls.py
+++ b/InvenTree/company/urls.py
@@ -53,7 +53,7 @@ supplier_part_detail_urls = [
url(r'^orders/', views.SupplierPartDetail.as_view(template_name='company/supplier_part_orders.html'), name='supplier-part-orders'),
url(r'^stock/', views.SupplierPartDetail.as_view(template_name='company/supplier_part_stock.html'), name='supplier-part-stock'),
- url('^.*$', views.SupplierPartDetail.as_view(), name='supplier-part-detail'),
+ url('^.*$', views.SupplierPartDetail.as_view(template_name='company/supplier_part_pricing.html'), name='supplier-part-detail'),
]
supplier_part_urls = [
diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py
index 39c61079ea..d8cb8b07e0 100644
--- a/InvenTree/part/models.py
+++ b/InvenTree/part/models.py
@@ -1198,9 +1198,9 @@ class BomItem(models.Model):
overage = str(self.overage).strip()
- # Is the overage an integer value?
+ # Is the overage a numerical value?
try:
- ovg = int(overage)
+ ovg = float(overage)
if ovg < 0:
ovg = 0
@@ -1223,7 +1223,7 @@ class BomItem(models.Model):
# Must be represented as a decimal
percent = Decimal(percent)
- return int(percent * quantity)
+ return float(percent * quantity)
except ValueError:
pass
@@ -1245,7 +1245,12 @@ class BomItem(models.Model):
# Base quantity requirement
base_quantity = self.quantity * build_quantity
- return base_quantity + self.get_overage_quantity(base_quantity)
+ # Overage requiremet
+ ovrg_quantity = self.get_overage_quantity(base_quantity)
+
+ required = float(base_quantity) + float(ovrg_quantity)
+
+ return required
@property
def price_range(self):
diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py
index c7a1b959fa..1752607d2a 100644
--- a/InvenTree/part/views.py
+++ b/InvenTree/part/views.py
@@ -38,7 +38,7 @@ from InvenTree.views import AjaxView, AjaxCreateView, AjaxUpdateView, AjaxDelete
from InvenTree.views import QRCodeView
from InvenTree.helpers import DownloadFile, str2bool
-from InvenTree.status_codes import OrderStatus
+from InvenTree.status_codes import OrderStatus, BuildStatus
class PartIndex(ListView):
@@ -593,6 +593,7 @@ class PartDetail(DetailView):
context['disabled'] = not part.active
context['OrderStatus'] = OrderStatus
+ context['BuildStatus'] = BuildStatus
return context