{% extends "order/sales_order_base.html" %} {% load inventree_extras %} {% load status_codes %} {% load i18n %} {% load static %} {% block details %} {% include 'order/so_tabs.html' with tab='details' %}

{% trans "Sales Order Items" %}

{% endblock %} {% block js_ready %} {{ block.super }} $("#new-so-line").click(function() { launchModalForm("{% url 'so-line-item-create' %}", { reload: true, data: { order: {{ order.id }}, }, secondary: [ ] }); }); $("#so-lines-table").inventreeTable({ formatNoMatches: function() { return "No matching line items"; }, queryParams: { order: {{ order.id }}, part_detail: true, }, url: "{% url 'api-so-line-list' %}", columns: [ { field: 'pk', title: 'ID', visible: false, }, { sortable: true, field: 'part', title: 'Part', formatter: function(value, row, index, field) { if (row.part) { return imageHoverIcon(row.part_detail.thumbnail) + renderLink(row.part_detail.full_name, `/part/${value}/`); } else { return '-'; } } }, { sortable: true, field: 'reference', title: 'Reference' }, { sortable: true, field: 'quantity', title: 'Quantity', formatter: function(value, row, index, field) { return +parseFloat(value).toFixed(5); } }, { field: 'notes', title: 'Notes', }, ], }); {% endblock %}