Update formatting of order pages

This commit is contained in:
Oliver Walters 2020-10-19 23:23:16 +11:00
parent b5d15aab08
commit 9b7a9a3ee0
5 changed files with 54 additions and 55 deletions

View File

@ -28,7 +28,6 @@ class EditBuildForm(HelperForm):
'reference': _('Build Order reference')
}
class Meta:
model = Build
fields = [

View File

@ -22,7 +22,7 @@ from markdownx.models import MarkdownxField
from mptt.models import MPTTModel, TreeForeignKey
from InvenTree.status_codes import BuildStatus
from InvenTree.helpers import decimal2string, increment
from InvenTree.helpers import increment
import InvenTree.fields
from stock import models as StockModels

View File

@ -5,18 +5,18 @@
{% load status_codes %}
{% block page_title %}
InvenTree | {% trans "Build" %} - {{ build }}
InvenTree | {% trans "Build Order" %} - {{ build }}
{% endblock %}
{% block pre_content %}
{% if build.sales_order %}
<div class='alert alert-block alert-info'>
{% trans "This build is allocated to Sales Order" %} <b><a href="{% url 'so-detail' build.sales_order.id %}">{{ build.sales_order }}</a></b>
{% trans "This Build Order is allocated to Sales Order" %} <b><a href="{% url 'so-detail' build.sales_order.id %}">{{ build.sales_order }}</a></b>
</div>
{% endif %}
{% if build.parent %}
<div class='alert alert-block alert-info'>
{% trans "This build is a child of Build" %} <b><a href="{% url 'build-detail' build.parent.id %}">{{ build.parent }}</a></b>
{% trans "This Build Order is a child of Build Order" %} <b><a href="{% url 'build-detail' build.parent.id %}">{{ build.parent }}</a></b>
</div>
{% endif %}
{% endblock %}
@ -31,14 +31,15 @@ src="{% static 'img/blank_image.png' %}"
{% endblock %}
{% block page_data %}
<h3>{% trans "Build" %} {% build_status_label build.status large=True %}</h3>
<hr>
<h4>
{{ build.quantity }} x {{ build.part.full_name }}
<h3>
{% trans "Build Order" %} {{ build }}
{% if user.is_staff and roles.build.change %}
<a href="{% url 'admin:build_build_change' build.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
{% endif %}
</h4>
{% endif %}
</h3>
<h3>{% build_status_label build.status large=True %}</h3>
<hr>
<p>{{ build.title }}</p>
<div class='btn-row'>
<div class='btn-group action-buttons'>
{% if roles.build.change %}
@ -68,9 +69,9 @@ src="{% static 'img/blank_image.png' %}"
<h4>{% trans "Build Details" %}</h4>
<table class='table table-striped table-condensed'>
<tr>
<td></td>
<td>{% trans "Build Title" %}</td>
<td>{{ build.title }}</td>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "Build Order Reference" %}</td>
<td>{{ build.reference }}</td>
</tr>
<tr>
<td><span class='fas fa-shapes'></span></td>

View File

@ -20,46 +20,44 @@ src="{% static 'img/blank_image.png' %}"
{% endblock %}
{% block page_data %}
<h3>{% trans "Purchase Order" %} {% purchase_order_status_label order.status large=True %}</h3>
<hr>
<h4>
{{ order }}
<h3>
{% trans "Purchase Order" %} {{ order.reference }}
{% if user.is_staff and roles.purchase_order.change %}
<a href="{% url 'admin:order_purchaseorder_change' order.pk %}"><span title='{% trans "Admin view" %}' class='fas fa-user-shield'></span></a>
{% endif %}
</h4>
</h3>
<h3>{% purchase_order_status_label order.status large=True %}</h3>
<hr>
<p>{{ order.description }}</p>
<p>
<div class='btn-row'>
<div class='btn-group action-buttons'>
{% if roles.purchase_order.change %}
<button type='button' class='btn btn-default' id='edit-order' title='{% trans "Edit order information" %}'>
<span class='fas fa-edit icon-green'></span>
</button>
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
<button type='button' class='btn btn-default' id='place-order' title='{% trans "Place order" %}'>
<span class='fas fa-paper-plane icon-blue'></span>
</button>
{% elif order.status == PurchaseOrderStatus.PLACED %}
<button type='button' class='btn btn-default' id='receive-order' title='{% trans "Receive items" %}'>
<span class='fas fa-clipboard-check'></span>
</button>
<button type='button' class='btn btn-default' id='complete-order' title='{% trans "Mark order as complete" %}'>
<span class='fas fa-check-circle'></span>
</button>
{% endif %}
{% if order.status == PurchaseOrderStatus.PENDING or order.status == PurchaseOrderStatus.PLACED %}
<button type='button' class='btn btn-default' id='cancel-order' title='{% trans "Cancel order" %}'>
<span class='fas fa-times-circle icon-red'></span>
</button>
{% endif %}
{% endif %}
<button type='button' class='btn btn-default' id='export-order' title='{% trans "Export order to file" %}'>
<span class='fas fa-file-download'></span>
</button>
</div>
<div class='btn-row'>
<div class='btn-group action-buttons'>
{% if roles.purchase_order.change %}
<button type='button' class='btn btn-default' id='edit-order' title='{% trans "Edit order information" %}'>
<span class='fas fa-edit icon-green'></span>
</button>
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
<button type='button' class='btn btn-default' id='place-order' title='{% trans "Place order" %}'>
<span class='fas fa-paper-plane icon-blue'></span>
</button>
{% elif order.status == PurchaseOrderStatus.PLACED %}
<button type='button' class='btn btn-default' id='receive-order' title='{% trans "Receive items" %}'>
<span class='fas fa-clipboard-check'></span>
</button>
<button type='button' class='btn btn-default' id='complete-order' title='{% trans "Mark order as complete" %}'>
<span class='fas fa-check-circle'></span>
</button>
{% endif %}
{% if order.status == PurchaseOrderStatus.PENDING or order.status == PurchaseOrderStatus.PLACED %}
<button type='button' class='btn btn-default' id='cancel-order' title='{% trans "Cancel order" %}'>
<span class='fas fa-times-circle icon-red'></span>
</button>
{% endif %}
{% endif %}
<button type='button' class='btn btn-default' id='export-order' title='{% trans "Export order to file" %}'>
<span class='fas fa-file-download'></span>
</button>
</div>
</p>
</div>
{% endblock %}
{% block page_details %}

View File

@ -27,17 +27,18 @@ src="{% static 'img/blank_image.png' %}"
/>
{% endblock %}
{% block page_data %}
<h3>{% trans "Sales Order" %} {% sales_order_status_label order.status large=True %}</h3>
<hr>
<h4>
{{ order }}
<h3>
{% trans "Sales Order" %} {{ order.reference }}
{% if user.is_staff and roles.sales_order.change %}
<a href="{% url 'admin:order_salesorder_change' order.pk %}"><span title='{% trans "Admin view" %}' class='fas fa-user-shield'></span></a>
{% endif %}
</h4>
</h3>
<h3>
{% sales_order_status_label order.status large=True %}
</h3>
<hr>
<p>{{ order.description }}</p>
<div class='btn-row'>
<div class='btn-group action-buttons'>