diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index bd853702c4..cddba74cd6 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -19,9 +19,13 @@
{% if roles.sales_order.change %}
- +
+ +
+
+
{% endif %} diff --git a/InvenTree/templates/js/translated/filters.js b/InvenTree/templates/js/translated/filters.js index 53429effea..6b109e2d18 100644 --- a/InvenTree/templates/js/translated/filters.js +++ b/InvenTree/templates/js/translated/filters.js @@ -283,6 +283,11 @@ function setupFilterList(tableKey, table, target) { element.append(``); + // Callback for reloading the table + element.find(`#reload-${tableKey}`).click(function() { + $(table).bootstrapTable('refresh'); + }); + // If there are no filters defined for this table, exit now if (jQuery.isEmptyObject(getAvailableTableFilters(tableKey))) { return; @@ -303,11 +308,6 @@ function setupFilterList(tableKey, table, target) { element.append(`
${title} = ${value}x
`); } - // Callback for reloading the table - element.find(`#reload-${tableKey}`).click(function() { - $(table).bootstrapTable('refresh'); - }); - // Add a callback for adding a new filter element.find(`#${add}`).click(function clicked() { diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js index 67fef0b853..75f71e3c4c 100644 --- a/InvenTree/templates/js/translated/order.js +++ b/InvenTree/templates/js/translated/order.js @@ -864,6 +864,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) { }, { sortable: true, + switchable: false, field: 'quantity', title: '{% trans "Quantity" %}', footerFormatter: function(data) { @@ -879,18 +880,29 @@ function loadPurchaseOrderLineItemTable(table, options={}) { field: 'purchase_price', title: '{% trans "Unit Price" %}', formatter: function(value, row) { - return row.purchase_price_string || row.purchase_price; + var formatter = new Intl.NumberFormat( + 'en-US', + { + style: 'currency', + currency: row.purchase_price_currency + } + ); + return formatter.format(row.purchase_price); } }, { field: 'total_price', sortable: true, - field: 'total_price', - title: '{% trans "Total price" %}', + title: '{% trans "Total Price" %}', formatter: function(value, row) { - var total = row.purchase_price * row.quantity; - var formatter = new Intl.NumberFormat('en-US', {style: 'currency', currency: row.purchase_price_currency}); - return formatter.format(total); + var formatter = new Intl.NumberFormat( + 'en-US', + { + style: 'currency', + currency: row.purchase_price_currency + } + ); + return formatter.format(row.purchase_price * row.quantity); }, footerFormatter: function(data) { var total = data.map(function(row) { @@ -1436,7 +1448,7 @@ function loadSalesOrderLineItemTable(table, options={}) { sortable: true, field: 'reference', title: '{% trans "Reference" %}', - switchable: false, + switchable: true, }, { sortable: true, @@ -1456,14 +1468,6 @@ function loadSalesOrderLineItemTable(table, options={}) { field: 'sale_price', title: '{% trans "Unit Price" %}', formatter: function(value, row) { - return row.sale_price_string || row.sale_price; - } - }, - { - sortable: true, - title: '{% trans "Total price" %}', - formatter: function(value, row) { - var total = row.sale_price * row.quantity; var formatter = new Intl.NumberFormat( 'en-US', { @@ -1472,7 +1476,23 @@ function loadSalesOrderLineItemTable(table, options={}) { } ); - return formatter.format(total); + return formatter.format(row.sale_price); + } + }, + { + field: 'total_price', + sortable: true, + title: '{% trans "Total Price" %}', + formatter: function(value, row) { + var formatter = new Intl.NumberFormat( + 'en-US', + { + style: 'currency', + currency: row.sale_price_currency + } + ); + + return formatter.format(row.sale_price * row.quantity); }, footerFormatter: function(data) { var total = data.map(function(row) { @@ -1544,6 +1564,7 @@ function loadSalesOrderLineItemTable(table, options={}) { if (pending) { columns.push({ field: 'buttons', + switchable: false, formatter: function(value, row, index, field) { var html = `
`;