mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
javascript linting
This commit is contained in:
parent
1a21576f28
commit
a32a30de52
@ -20,6 +20,7 @@
|
||||
/* exported
|
||||
createSalesOrder,
|
||||
editPurchaseOrderLineItem,
|
||||
loadPurchaseOrderLineItemTable,
|
||||
loadPurchaseOrderTable,
|
||||
loadSalesOrderAllocationTable,
|
||||
loadSalesOrderTable,
|
||||
@ -435,7 +436,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
||||
field: 'location',
|
||||
label: '{% trans "New Location" %}',
|
||||
title: '{% trans "Create new stock location" %}',
|
||||
url: "{% url 'stock-location-create' %}",
|
||||
url: '{% url "stock-location-create" %}',
|
||||
},
|
||||
]
|
||||
});
|
||||
@ -454,7 +455,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
||||
order: options.order,
|
||||
part_detail: true
|
||||
},
|
||||
url: "{% url 'api-po-line-list' %}",
|
||||
url: '{% url "api-po-line-list" %}',
|
||||
showFooter: true,
|
||||
columns: [
|
||||
{
|
||||
@ -477,7 +478,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
||||
}
|
||||
},
|
||||
footerFormatter: function() {
|
||||
return '{% trans "Total" %}'
|
||||
return '{% trans "Total" %}';
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -506,7 +507,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
||||
if (row.supplier_part_detail && row.supplier_part_detail.manufacturer_part) {
|
||||
return renderLink(value, `/manufacturer-part/${row.supplier_part_detail.manufacturer_part}/`);
|
||||
} else {
|
||||
return "-";
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -520,11 +521,11 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
||||
field: 'quantity',
|
||||
title: '{% trans "Quantity" %}',
|
||||
footerFormatter: function(data) {
|
||||
return data.map(function (row) {
|
||||
return +row['quantity']
|
||||
}).reduce(function (sum, i) {
|
||||
return data.map(function(row) {
|
||||
return +row['quantity'];
|
||||
}).reduce(function(sum, i) {
|
||||
return sum + i
|
||||
}, 0)
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -543,17 +544,26 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
||||
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)
|
||||
return formatter.format(total);
|
||||
},
|
||||
footerFormatter: function(data) {
|
||||
var total = data.map(function (row) {
|
||||
return +row['purchase_price']*row['quantity']
|
||||
}).reduce(function (sum, i) {
|
||||
return sum + i
|
||||
}, 0)
|
||||
var total = data.map(function(row) {
|
||||
return +row['purchase_price']*row['quantity'];
|
||||
}).reduce(function(sum, i) {
|
||||
return sum + i;
|
||||
}, 0);
|
||||
|
||||
var currency = (data.slice(-1)[0] && data.slice(-1)[0].purchase_price_currency) || 'USD';
|
||||
var formatter = new Intl.NumberFormat('en-US', {style: 'currency', currency: currency});
|
||||
return formatter.format(total)
|
||||
|
||||
var formatter = new Intl.NumberFormat(
|
||||
'en-US',
|
||||
{
|
||||
style: 'currency',
|
||||
currency: currency
|
||||
}
|
||||
);
|
||||
|
||||
return formatter.format(total);
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user