From 361f4498df0cdd05810344841589a9c113b34977 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 30 Oct 2021 23:51:59 +1100 Subject: [PATCH] Fix broken tables removed by conflict --- .../templates/order/sales_order_detail.html | 56 +++++++++++++++++++ .../order/templates/order/so_navbar.html | 47 ---------------- .../order/templates/order/so_sidebar.html | 1 + 3 files changed, 57 insertions(+), 47 deletions(-) delete mode 100644 InvenTree/order/templates/order/so_navbar.html diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index 5d4db70a34..109811452a 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -38,6 +38,35 @@ +
+ {% if order.is_pending %} +
+
+

{% trans "Pending Shipments" %}

+ {% include "spacer.html" %} +
+ +
+
+
+
+ {% if roles.sales_order.change %} +
+
+ {% endif %} +
+
+ {% endif %} +
+

{% trans "Completed Shipments" %}

+
+
+
+
+
+

{% trans "Build Orders" %}

@@ -90,6 +119,33 @@ {% block js_ready %} {{ block.super }} + // Callback when the "shipments" panel is first loaded + onPanelLoad('order-shipments', function() { + + {% if order.is_pending %} + loadSalesOrderShipmentTable('#pending-shipments-table', { + order: {{ order.pk }}, + shipped: false, + }); + + $('#new-shipment').click(function() { + createSalesOrderShipment({ + order: {{ order.pk }}, + onSuccess: function(data) { + $('#pending-shipments-table').bootstrapTable('refresh'); + } + }); + }); + + {% endif %} + + loadSalesOrderShipmentTable('#completed-shipments-table', { + order: {{ order.pk }}, + shipped: true, + }); + + }); + $('#edit-notes').click(function() { constructForm('{% url "api-so-detail" order.pk %}', { fields: { diff --git a/InvenTree/order/templates/order/so_navbar.html b/InvenTree/order/templates/order/so_navbar.html deleted file mode 100644 index 814df0fca6..0000000000 --- a/InvenTree/order/templates/order/so_navbar.html +++ /dev/null @@ -1,47 +0,0 @@ -{% load i18n %} -{% load static %} -{% load inventree_extras %} - - \ No newline at end of file diff --git a/InvenTree/order/templates/order/so_sidebar.html b/InvenTree/order/templates/order/so_sidebar.html index be924eb37b..6ee68949ee 100644 --- a/InvenTree/order/templates/order/so_sidebar.html +++ b/InvenTree/order/templates/order/so_sidebar.html @@ -3,6 +3,7 @@ {% load inventree_extras %} {% include "sidebar_item.html" with label='order-items' text="Line Items" icon="fa-list-ol" %} +{% include "sidebar_item.html" with label='order-shipments' text="Shipments" icon="fa-truck" %} {% include "sidebar_item.html" with label='order-builds' text="Build Orders" icon="fa-tools" %} {% include "sidebar_item.html" with label='order-attachments' text="Attachments" icon="fa-paperclip" %} {% include "sidebar_item.html" with label='order-notes' text="Notes" icon="fa-clipboard" %}