{% extends "order/sales_order_base.html" %} {% load inventree_extras %} {% load status_codes %} {% load i18n %} {% load static %} {% load markdownify %} {% block sidebar %} {% include "order/so_sidebar.html" %} {% endblock %} {% block page_content %}

{% trans "Sales Order Items" %}

{% include "spacer.html" %}
{% if roles.sales_order.change and order.is_pending %} {% endif %}
{% include "filter_list.html" with id="sales-order-lines" %}
{% if order.is_pending %}

{% trans "Pending Shipments" %}

{% include "spacer.html" %}
{% if 0 %} {% endif %} {% if roles.sales_order.change %} {% endif %}
{% if roles.sales_order.change %}
{% include "filter_list.html" with id="pending-shipments" %}
{% endif %}
{% endif %}

{% trans "Completed Shipments" %}

{% include "filter_list.html" with id="completed-shipments" %}

{% trans "Build Orders" %}

{% include "filter_list.html" with id='build' %}

{% trans "Attachments" %}

{% include "spacer.html" %}
{% include "attachment_button.html" %}
{% include "attachment_table.html" %}

{% trans "Order Notes" %}

{% if order.notes %} {{ order.notes | markdownify }} {% endif %}
{% endblock %} {% 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, filter_target: '#filter-list-pending-shipments', }); $('#new-shipment').click(function() { createSalesOrderShipment({ order: {{ order.pk }}, reference: '{{ order.reference }}', onSuccess: function(data) { $('#pending-shipments-table').bootstrapTable('refresh'); } }); }); {% endif %} }); onPanelLoad('order-shipments-complete', function() { loadSalesOrderShipmentTable('#completed-shipments-table', { order: {{ order.pk }}, shipped: true, filter_target: '#filter-list-completed-shipments', }); }); $('#edit-notes').click(function() { constructForm('{% url "api-so-detail" order.pk %}', { fields: { notes: { multiline: true, } }, title: '{% trans "Edit Notes" %}', reload: true, }); }); enableDragAndDrop( '#attachment-dropzone', '{% url "api-so-attachment-list" %}', { data: { order: {{ order.id }}, }, label: 'attachment', success: function(data, status, xhr) { reloadAttachmentTable(); } } ); loadAttachmentTable('{% url "api-so-attachment-list" %}', { filters: { order: {{ order.pk }}, }, fields: { order: { value: {{ order.pk }}, hidden: true, }, } }); loadBuildTable($("#builds-table"), { url: "{% url 'api-build-list' %}", params: { sales_order: {{ order.id }}, }, }); function reloadTable() { $("#so-lines-table").bootstrapTable("refresh"); } $("#new-so-line").click(function() { constructForm('{% url "api-so-line-list" %}', { fields: { order: { value: {{ order.pk }}, hidden: true, }, part: {}, quantity: {}, reference: {}, sale_price: {}, sale_price_currency: {}, notes: {}, }, method: 'POST', title: '{% trans "Add Line Item" %}', onSuccess: reloadTable, }); }); loadSalesOrderLineItemTable( '#so-lines-table', { order: {{ order.pk }}, status: {{ order.status }}, } ); enableSidebar('salesorder'); {% endblock %}