mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-06 07:18:48 +00:00
140 lines
4.3 KiB
HTML
140 lines
4.3 KiB
HTML
{% extends "two_column.html" %}
|
|
|
|
{% load i18n %}
|
|
{% load static %}
|
|
{% load inventree_extras %}
|
|
{% load status_codes %}
|
|
|
|
{% block page_title %}
|
|
InvenTree | {% trans "Purchase Order" %}
|
|
{% endblock %}
|
|
|
|
{% block thumbnail %}
|
|
<img class='part-thumb'
|
|
{% if order.supplier.image %}
|
|
src="{{ order.supplier.image.url }}"
|
|
{% else %}
|
|
src="{% static 'img/blank_image.png' %}"
|
|
{% endif %}
|
|
/>
|
|
{% endblock %}
|
|
|
|
{% block page_data %}
|
|
<h3>{% trans "Purchase Order" %}</h3>
|
|
<hr>
|
|
<h4>{{ order }}</h4>
|
|
<p>{{ order.description }}</p>
|
|
<p>
|
|
<div class='btn-row'>
|
|
<div class='btn-group action-buttons'>
|
|
<button type='button' class='btn btn-default' id='edit-order' title='Edit order information'>
|
|
<span class='fas fa-edit'></span>
|
|
</button>
|
|
<button type='button' class='btn btn-default' id='export-order' title='Export order to file'>
|
|
<span class='fas fa-file-download'></span>
|
|
</button>
|
|
{% if order.status == OrderStatus.PENDING and order.lines.count > 0 %}
|
|
<button type='button' class='btn btn-default' id='place-order' title='Place order'>
|
|
<span class='fas fa-paper-plane'></span>
|
|
</button>
|
|
{% elif order.status == OrderStatus.PLACED %}
|
|
<button type='button' class='btn btn-default' id='receive-order' title='Receive items'>
|
|
<span class='fas fa-clipboard-check'></span>
|
|
</button>
|
|
<button type='button' class='btn btn-default' id='complete-order' title='Mark order as complete'>
|
|
<span class='fas fa-check-circle'></span>
|
|
</button>
|
|
{% endif %}
|
|
{% if order.status == OrderStatus.PENDING or order.status == OrderStatus.PLACED %}
|
|
<button type='button' class='btn btn-default' id='cancel-order' title='Cancel order'>
|
|
<span class='fas fa-times-circle'></span>
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</p>
|
|
{% endblock %}
|
|
|
|
{% block page_details %}
|
|
<h4>{% trans "Purchase Order Details" %}</h4>
|
|
<table class='table'>
|
|
<col width='25'>
|
|
<tr>
|
|
<td><span class='fas fa-hashtag'></span></td>
|
|
<td>{% trans "Order Reference" %}</td>
|
|
<td>{{ order.reference }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class='fas fa-info'></span></td>
|
|
<td>{% trans "Order Status" %}</td>
|
|
<td>{% order_status order.status %}</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class='fas fa-building'></span></td>
|
|
<td>{% trans "Supplier" %}</td>
|
|
<td><a href="{% url 'company-detail' order.supplier.id %}">{{ order.supplier.name }}</a></td>
|
|
</tr>
|
|
{% if order.supplier_reference %}
|
|
<tr>
|
|
<td><span class='fas fa-hashtag'></span></td>
|
|
<td>{% trans "Supplier Reference" %}</td>
|
|
<td>{{ order.supplier_reference }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if order.link %}
|
|
<tr>
|
|
<td><span class='fas fa-link'></span></td>
|
|
<td>External Link</td>
|
|
<td><a href="{{ order.link }}">{{ order.link }}</a></td>
|
|
</tr>
|
|
{% endif %}
|
|
<tr>
|
|
<td><span class='fas fa-calendar-alt'></span></td>
|
|
<td>{% trans "Created" %}</td>
|
|
<td>{{ order.creation_date }}<span class='badge'>{{ order.created_by }}</span></td>
|
|
</tr>
|
|
{% if order.issue_date %}
|
|
<tr>
|
|
<td><span class='fas fa-calendar-alt'></span></td>
|
|
<td>{% trans "Issued" %}</td>
|
|
<td>{{ order.issue_date }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if order.status == OrderStatus.COMPLETE %}
|
|
<tr>
|
|
<td><span class='fas fa-calendar-alt'></span></td>
|
|
<td>{% trans "Received" %}</td>
|
|
<td>{{ order.complete_date }}<span class='badge'>{{ order.received_by }}</span></td>
|
|
</tr>
|
|
{% endif %}
|
|
</table>
|
|
{% endblock %}
|
|
|
|
{% block js_ready %}
|
|
{{ block.super }}
|
|
|
|
{% if order.status == OrderStatus.PENDING and order.lines.count > 0 %}
|
|
$("#place-order").click(function() {
|
|
launchModalForm("{% url 'po-issue' order.id %}",
|
|
{
|
|
reload: true,
|
|
});
|
|
});
|
|
{% endif %}
|
|
|
|
$("#edit-order").click(function() {
|
|
launchModalForm("{% url 'po-edit' order.id %}",
|
|
{
|
|
reload: true,
|
|
}
|
|
);
|
|
});
|
|
|
|
$("#cancel-order").click(function() {
|
|
launchModalForm("{% url 'po-cancel' order.id %}", {
|
|
reload: true,
|
|
});
|
|
});
|
|
|
|
|
|
{% endblock %} |