mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Rendering of decimal value on stockitem page
This commit is contained in:
parent
4e1b9efe93
commit
20755a6dac
@ -4,10 +4,18 @@ over and above the built-in Django tags.
|
|||||||
|
|
||||||
from django import template
|
from django import template
|
||||||
from InvenTree import version
|
from InvenTree import version
|
||||||
|
from InvenTree.helpers import decimal2string
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag()
|
||||||
|
def decimal(x, *args, **kwargs):
|
||||||
|
""" Simplified rendering of a decimal number """
|
||||||
|
|
||||||
|
return decimal2string(x)
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
def inrange(n, *args, **kwargs):
|
def inrange(n, *args, **kwargs):
|
||||||
""" Return range(n) for iterating through a numeric quantity """
|
""" Return range(n) for iterating through a numeric quantity """
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{% extends "stock/stock_app_base.html" %}
|
{% extends "stock/stock_app_base.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load inventree_extras %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
@ -86,7 +87,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "Quantity" %}</td>
|
<td>{% trans "Quantity" %}</td>
|
||||||
<td>{{ item.quantity }}</td>
|
<td>{% decimal item.quantity %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.batch %}
|
{% if item.batch %}
|
||||||
|
Loading…
Reference in New Issue
Block a user