From e841b7faf633d1a2c2e4ac31641014726fe5947a Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 11 Mar 2022 00:58:18 +0100 Subject: [PATCH] add HTML templates for PO --- .../order/templates/order/order_base.html | 6 +++ .../order/purchase_order_detail.html | 54 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/InvenTree/order/templates/order/order_base.html b/InvenTree/order/templates/order/order_base.html index c188e183d0..6be2cfad68 100644 --- a/InvenTree/order/templates/order/order_base.html +++ b/InvenTree/order/templates/order/order_base.html @@ -171,6 +171,12 @@ src="{% static 'img/blank_image.png' %}" {{ order.responsible }} {% endif %} + + + + {% trans "Total cost" %} + {{ order.get_total_price }} + {% endblock %} diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index 53f973ee20..9e9db92886 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -43,6 +43,29 @@
+ +
+
+

{% trans "Additional Order Items" %}

+ {% include "spacer.html" %} +
+ {% if roles.purchase_order.change and order.is_pending %} + + {% endif %} +
+
+
+
+
+
+ {% include "filter_list.html" with id="purchase-order-additional-lines" %} +
+
+ +
+
@@ -207,6 +230,37 @@ loadPurchaseOrderLineItemTable('#po-line-table', { {% endif %} }); +$("#new-po-additional-line").click(function() { + + var fields = poAdditionalLineItemFields({ + order: {{ order.pk }}, + }); + + constructForm('{% url "api-po-additional-line-list" %}', { + fields: fields, + method: 'POST', + title: '{% trans "Add Order Line" %}', + onSuccess: function() { + $("#po-additional-lines-table").bootstrapTable("refresh"); + }, + }); +}); + +loadPurchaseOrderAdditionalLineItemTable( + '#po-additional-lines-table', + { + order: {{ order.pk }}, + status: {{ order.status }}, + } +); + +loadOrderTotal( + '#poTotalPrice', + { + url: '{% url "api-po-detail" order.pk %}', + } +); + enableSidebar('purchaseorder'); {% endblock %} \ No newline at end of file