mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Improve pricing rendering for purchase order table
This commit is contained in:
parent
bc596c1f20
commit
65b673b2bb
@ -864,6 +864,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
switchable: false,
|
||||||
field: 'quantity',
|
field: 'quantity',
|
||||||
title: '{% trans "Quantity" %}',
|
title: '{% trans "Quantity" %}',
|
||||||
footerFormatter: function(data) {
|
footerFormatter: function(data) {
|
||||||
@ -879,7 +880,14 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
|||||||
field: 'purchase_price',
|
field: 'purchase_price',
|
||||||
title: '{% trans "Unit Price" %}',
|
title: '{% trans "Unit Price" %}',
|
||||||
formatter: function(value, row) {
|
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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -887,9 +895,14 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
title: '{% trans "Total Price" %}',
|
title: '{% trans "Total Price" %}',
|
||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
var total = row.purchase_price * row.quantity;
|
var formatter = new Intl.NumberFormat(
|
||||||
var formatter = new Intl.NumberFormat('en-US', {style: 'currency', currency: row.purchase_price_currency});
|
'en-US',
|
||||||
return formatter.format(total);
|
{
|
||||||
|
style: 'currency',
|
||||||
|
currency: row.purchase_price_currency
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return formatter.format(row.purchase_price * row.quantity);
|
||||||
},
|
},
|
||||||
footerFormatter: function(data) {
|
footerFormatter: function(data) {
|
||||||
var total = data.map(function(row) {
|
var total = data.map(function(row) {
|
||||||
|
Loading…
Reference in New Issue
Block a user