total price column as per #1660

This commit is contained in:
Matthias 2021-06-16 23:52:00 +02:00
parent 9386332de1
commit 70e0933336

View File

@ -182,6 +182,20 @@ $("#po-table").inventreeTable({
return row.purchase_price_string || row.purchase_price;
}
},
{
sortable: true,
title: '{% trans "Total price" %}',
formatter: function(value, row) {
var total = row.purchase_price * row.quantity;
// Create our number formatter.
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: row.purchase_price_currency,
});
return formatter.format(total)
},
},
{
sortable: true,
field: 'received',