mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Improve rendering of pricing in sale order table
This commit is contained in:
parent
5f6e67086f
commit
bc596c1f20
@ -885,8 +885,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
|||||||
{
|
{
|
||||||
field: 'total_price',
|
field: 'total_price',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'total_price',
|
title: '{% trans "Total Price" %}',
|
||||||
title: '{% trans "Total price" %}',
|
|
||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
var total = row.purchase_price * row.quantity;
|
var total = row.purchase_price * row.quantity;
|
||||||
var formatter = new Intl.NumberFormat('en-US', {style: 'currency', currency: row.purchase_price_currency});
|
var formatter = new Intl.NumberFormat('en-US', {style: 'currency', currency: row.purchase_price_currency});
|
||||||
@ -1436,7 +1435,7 @@ function loadSalesOrderLineItemTable(table, options={}) {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'reference',
|
field: 'reference',
|
||||||
title: '{% trans "Reference" %}',
|
title: '{% trans "Reference" %}',
|
||||||
switchable: false,
|
switchable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
@ -1456,14 +1455,6 @@ function loadSalesOrderLineItemTable(table, options={}) {
|
|||||||
field: 'sale_price',
|
field: 'sale_price',
|
||||||
title: '{% trans "Unit Price" %}',
|
title: '{% trans "Unit Price" %}',
|
||||||
formatter: function(value, row) {
|
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(
|
var formatter = new Intl.NumberFormat(
|
||||||
'en-US',
|
'en-US',
|
||||||
{
|
{
|
||||||
@ -1472,7 +1463,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) {
|
footerFormatter: function(data) {
|
||||||
var total = data.map(function(row) {
|
var total = data.map(function(row) {
|
||||||
@ -1544,6 +1551,7 @@ function loadSalesOrderLineItemTable(table, options={}) {
|
|||||||
if (pending) {
|
if (pending) {
|
||||||
columns.push({
|
columns.push({
|
||||||
field: 'buttons',
|
field: 'buttons',
|
||||||
|
switchable: false,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
|
|
||||||
var html = `<div class='btn-group float-right' role='group'>`;
|
var html = `<div class='btn-group float-right' role='group'>`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user