2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 13:56:30 +00:00

Improve build base rendering

- Consolidate style
- Fix rendering of part pricing
This commit is contained in:
Oliver Walters
2020-04-12 00:31:59 +10:00
parent a65c80dbf3
commit fd8273e3e2
3 changed files with 71 additions and 52 deletions

View File

@ -781,6 +781,9 @@ class Part(models.Model):
if min_price == max_price:
return min_price
min_price = min_price.normalize()
max_price = max_price.normalize()
return "{a} - {b}".format(a=min_price, b=max_price)
def get_supplier_price_range(self, quantity=1):
@ -804,6 +807,9 @@ class Part(models.Model):
if min_price is None or max_price is None:
return None
min_price = min_price.normalize()
max_price = max_price.normalize()
return (min_price, max_price)
def get_bom_price_range(self, quantity=1):
@ -837,6 +843,9 @@ class Part(models.Model):
if min_price is None or max_price is None:
return None
min_price = min_price.normalize()
max_price = max_price.normalize()
return (min_price, max_price)
def get_price_range(self, quantity=1, buy=True, bom=True):

View File

@ -4,7 +4,7 @@
{% decimal part.total_stock %}
{% if part.total_stock == 0 %}
<span class='label label-danger'>{% trans "No Stock" %}</span>
<span class='label label-danger label-right'>{% trans "No Stock" %}</span>
{% elif part.total_stock < part.minimum_stock %}
<span class='label label-warning'>{% trans "Low Stock" %}</span>
<span class='label label-warning label-right'>{% trans "Low Stock" %}</span>
{% endif %}