mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 21:15:41 +00:00
Refactor admin button for:
- build order - part detail - stock item - stock location - company detail - manufacturer-part - purchase order - sales order
This commit is contained in:
@ -14,6 +14,53 @@
|
||||
<li class="breadcrumb-item active" aria-current="page"><a href='{% url "po-detail" order.id %}'>{{ order }}</a></li>
|
||||
{% endblock %}
|
||||
|
||||
{% block heading %}
|
||||
{% trans "Purchase Order" %}: {{ order.reference }}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions %}
|
||||
{% if user.is_staff and roles.purchase_order.change %}
|
||||
{% url 'admin:order_purchaseorder_change' order.pk as url %}
|
||||
{% include "admin_button.html" with url=url %}
|
||||
{% endif %}
|
||||
<!-- Printing options -->
|
||||
<div class='btn-group' role='group'>
|
||||
<button id='print-options' title='{% trans "Print actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||
<span class='fas fa-print'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print purchase order report" %}</a></li>
|
||||
<li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if roles.purchase_order.change %}
|
||||
<!-- order actions -->
|
||||
<div class='btn-group'>
|
||||
<button id='order-options' title='{% trans "Order actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||
<span class='fas fa-tools'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a class='dropdown-item' href='#' id='edit-order'><span class='fas fa-edit icon-green'></span> {% trans "Edit order" %}</a></li>
|
||||
{% if order.can_cancel %}
|
||||
<li><a class='dropdown-item' href='#' id='cancel-order'><span class='fas fa-times-circle icon-red'></span> {% trans "Cancel order" %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='place-order' title='{% trans "Place order" %}'>
|
||||
<span class='fas fa-shopping-cart icon-blue'></span>
|
||||
</button>
|
||||
{% elif order.status == PurchaseOrderStatus.PLACED %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='receive-order' title='{% trans "Receive items" %}'>
|
||||
<span class='fas fa-sign-in-alt icon-blue'></span>
|
||||
</button>
|
||||
<button type='button' class='btn btn-outline-secondary' id='complete-order' title='{% trans "Mark order as complete" %}'>
|
||||
<span class='fas fa-check-circle icon-green'></span>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block thumbnail %}
|
||||
<img class='part-thumb'
|
||||
{% if order.supplier.image %}
|
||||
@ -25,12 +72,7 @@ src="{% static 'img/blank_image.png' %}"
|
||||
{% endblock %}
|
||||
|
||||
{% block details %}
|
||||
<h4>
|
||||
{% 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>
|
||||
|
||||
<h4>
|
||||
{% purchase_order_status_label order.status large=True %}
|
||||
{% if order.is_overdue %}
|
||||
@ -38,44 +80,7 @@ src="{% static 'img/blank_image.png' %}"
|
||||
{% endif %}
|
||||
</h4>
|
||||
<p>{{ order.description }}{% include "clip.html"%}</p>
|
||||
<div class='btn-group' role='group'>
|
||||
<!-- Printing options -->
|
||||
<div class='btn-group' role='group'>
|
||||
<button id='print-options' title='{% trans "Print actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||
<span class='fas fa-print'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print purchase order report" %}</a></li>
|
||||
<li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if roles.purchase_order.change %}
|
||||
<!-- order actions -->
|
||||
<div class='btn-group'>
|
||||
<button id='order-options' title='{% trans "Order actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||
<span class='fas fa-tools'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a class='dropdown-item' href='#' id='edit-order'><span class='fas fa-edit icon-green'></span> {% trans "Edit order" %}</a></li>
|
||||
{% if order.can_cancel %}
|
||||
<li><a class='dropdown-item' href='#' id='cancel-order'><span class='fas fa-times-circle icon-red'></span> {% trans "Cancel order" %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='place-order' title='{% trans "Place order" %}'>
|
||||
<span class='fas fa-shopping-cart icon-blue'></span>
|
||||
</button>
|
||||
{% elif order.status == PurchaseOrderStatus.PLACED %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='receive-order' title='{% trans "Receive items" %}'>
|
||||
<span class='fas fa-sign-in-alt icon-blue'></span>
|
||||
</button>
|
||||
<button type='button' class='btn btn-outline-secondary' id='complete-order' title='{% trans "Mark order as complete" %}'>
|
||||
<span class='fas fa-check-circle icon-green'></span>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block details_right %}
|
||||
|
@ -24,14 +24,52 @@ src="{% static 'img/blank_image.png' %}"
|
||||
/>
|
||||
{% endblock %}
|
||||
|
||||
{% block heading %}
|
||||
{% trans "Sales Order" %} {{ order.reference }}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions %}
|
||||
{% if user.is_staff and roles.sales_order.change %}
|
||||
{% url 'admin:order_salesorder_change' order.pk as url %}
|
||||
{% include "admin_button.html" with url=url %}
|
||||
{% endif %}
|
||||
<!-- Printing actions -->
|
||||
<div class='btn-group' role='group'>
|
||||
<button id='print-options' title='{% trans "Print actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||
<span class='fas fa-print'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print sales order report" %}</a></li>
|
||||
<li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li>
|
||||
<!--
|
||||
<li><a href='#' id='print-packing-list'><span class='fas fa-clipboard-list'></span>{% trans "Print packing list" %}</a></li>
|
||||
-->
|
||||
</ul>
|
||||
</div>
|
||||
{% if roles.sales_order.change %}
|
||||
<!-- Order actions -->
|
||||
<div class='btn-group' role='group'>
|
||||
<button id='order-options' title='{% trans "Order actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||
<span class='fas fa-tools'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a class='dropdown-item' href='#' id='edit-order'><span class='fas fa-edit icon-green'></span> {% trans "Edit order" %}</a></li>
|
||||
{% if order.status == SalesOrderStatus.PENDING %}
|
||||
<li><a class='dropdown-item' href='#' id='cancel-order'><span class='fas fa-times-circle icon-red'></span> {% trans "Cancel order" %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
{% if order.status == SalesOrderStatus.PENDING %}
|
||||
<button type='button' class='btn btn-success' id='ship-order' title='{% trans "Ship Order" %}'>
|
||||
<span class='fas fa-truck'></span> {% trans "Ship Order" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block details %}
|
||||
|
||||
<h4>
|
||||
{% 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>
|
||||
<h4>
|
||||
{% sales_order_status_label order.status large=True %}
|
||||
{% if order.is_overdue %}
|
||||
@ -39,42 +77,7 @@ src="{% static 'img/blank_image.png' %}"
|
||||
{% endif %}
|
||||
</h4>
|
||||
<p>{{ order.description }}{% include "clip.html"%}</p>
|
||||
<div class='btn-group' role='group'>
|
||||
<!-- Printing actions -->
|
||||
<div class='btn-group' role='group'>
|
||||
<button id='print-options' title='{% trans "Print actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||
<span class='fas fa-print'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print sales order report" %}</a></li>
|
||||
<li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li>
|
||||
<!--
|
||||
<li><a href='#' id='print-packing-list'><span class='fas fa-clipboard-list'></span>{% trans "Print packing list" %}</a></li>
|
||||
-->
|
||||
</ul>
|
||||
</div>
|
||||
{% if roles.sales_order.change %}
|
||||
<!-- Order actions -->
|
||||
<div class='btn-group' role='group'>
|
||||
<button id='order-options' title='{% trans "Order actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
|
||||
<span class='fas fa-tools'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a class='dropdown-item' href='#' id='edit-order'><span class='fas fa-edit icon-green'></span> {% trans "Edit order" %}</a></li>
|
||||
{% if order.status == SalesOrderStatus.PENDING %}
|
||||
<li><a class='dropdown-item' href='#' id='cancel-order'><span class='fas fa-times-circle icon-red'></span> {% trans "Cancel order" %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
{% if order.status == SalesOrderStatus.PENDING %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='ship-order' title='{% trans "Ship order" %}'>
|
||||
<span class='fas fa-truck icon-blue'></span>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% block below_thumbnail %}
|
||||
<div class='info-messages'>
|
||||
{% if order.status == SalesOrderStatus.PENDING and not order.is_fully_allocated %}
|
||||
<div class='alert alert-block alert-danger'>
|
||||
@ -82,7 +85,7 @@ src="{% static 'img/blank_image.png' %}"
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block details_right %}
|
||||
|
Reference in New Issue
Block a user