mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Specify order currency (#4698)
* Add 'order_currency' to the various external order models - By default will use the currency specified for the supplier (or customer) - Can be specified per order, also * Display order currency on order pgae * Add 'order_currency' field * Enable "blank" currency option (to default to the currency specified by the referenced company * Fix default currency code when adding line items * Remove 'total_price_currency' serializer field - Now replaced with 'order_currency' for greater flexibility * Bump api_version.py * Update default order report templates * Updated docs * More docs updaes * Adjust unit tests * Use 'order_currency' in order tables * Update purchase order api unit tests
This commit is contained in:
12
InvenTree/templates/currency_data.html
Normal file
12
InvenTree/templates/currency_data.html
Normal file
@ -0,0 +1,12 @@
|
||||
{% load i18n %}
|
||||
{% if instance and instance.currency %}
|
||||
<tr>
|
||||
<td><span class='fas fa-dollar-sign'></span></td>
|
||||
<td>{% trans "Currency" %}</td>
|
||||
{% if instance.order_currency %}
|
||||
<td>{{ instance.currency }}</td>
|
||||
{% else %}
|
||||
<td><em>{{ instance.currency }}</em></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
@ -65,6 +65,9 @@ function purchaseOrderFields(options={}) {
|
||||
project_code: {
|
||||
icon: 'fa-list',
|
||||
},
|
||||
order_currency: {
|
||||
icon: 'fa-coins',
|
||||
},
|
||||
target_date: {
|
||||
icon: 'fa-calendar-alt',
|
||||
},
|
||||
@ -1670,7 +1673,7 @@ function loadPurchaseOrderTable(table, options) {
|
||||
sortable: true,
|
||||
formatter: function(value, row) {
|
||||
return formatCurrency(value, {
|
||||
currency: row.total_price_currency,
|
||||
currency: row.order_currency,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -49,6 +49,9 @@ function returnOrderFields(options={}) {
|
||||
project_code: {
|
||||
icon: 'fa-list',
|
||||
},
|
||||
order_currency: {
|
||||
icon: 'fa-coins',
|
||||
},
|
||||
target_date: {
|
||||
icon: 'fa-calendar-alt',
|
||||
},
|
||||
@ -349,7 +352,7 @@ function loadReturnOrderTable(table, options={}) {
|
||||
visible: false,
|
||||
formatter: function(value, row) {
|
||||
return formatCurrency(value, {
|
||||
currency: row.total_price_currency
|
||||
currency: row.order_currency
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,9 @@ function salesOrderFields(options={}) {
|
||||
project_code: {
|
||||
icon: 'fa-list',
|
||||
},
|
||||
order_currency: {
|
||||
icon: 'fa-coins',
|
||||
},
|
||||
target_date: {
|
||||
icon: 'fa-calendar-alt',
|
||||
},
|
||||
@ -802,7 +805,7 @@ function loadSalesOrderTable(table, options) {
|
||||
sortable: true,
|
||||
formatter: function(value, row) {
|
||||
return formatCurrency(value, {
|
||||
currency: row.total_price_currency,
|
||||
currency: row.order_currency,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user