2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 19:45:46 +00:00

Currency setting (#7390)

* Add new global setting for currency options

- Moving away from external configuration
- Refactor currency support code into new file

* Refactoring

- Move functions into currency.py

* Limit choices for default currency

* Improve validation

* Adds data migration for existing currency selection

* Docs updates

* Remove currency config from external settings

* bump api version

* Add debug message

* Add unit tests

* Fix after_change_currency func

* Fix after_change_currency func

* Revert change to after_chance_currency

* Revert other change
This commit is contained in:
Oliver
2024-06-03 12:53:30 +10:00
committed by GitHub
parent 7108bc48bd
commit e83feb9414
42 changed files with 417 additions and 278 deletions

View File

@ -6,13 +6,13 @@ title: Currency Support
InvenTree provides support for multiple currencies, allowing pricing information to be stored with base currency rates.
### Configuration
### Supported Currencies
To specify which currencies are supported, refer to the [currency configuration](../start/config.md#supported-currencies) section
InvenTree uses the [django-money](https://github.com/django-money/django-money) library, which in turn uses the [py-moneyed library](https://py-moneyed.readthedocs.io/en/latest/index.html). `py-moneyed` supports any currency which is defined in the [ISO 3166 standard](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) standard.
### Currency Conversion
Currency conversion is provided via the [django-money](https://github.com/django-money/django-money) library. Pricing data can be converted seamlessly between the available currencies.
Currency conversion is provided via the `django-money` library. Pricing data can be converted seamlessly between the available currencies.
### Currency Rate Updates
@ -26,6 +26,11 @@ If a different currency exchange backend is needed, or a custom implementation i
In the [settings screen](./global.md), under the *Pricing* section, the following currency settings are available:
{% with id="currency-settings", url="settings/currency.png", description="Currency Exchange Settings" %}
{% include 'img.html' %}
{% endwith %}
| Setting | Description | Default Value |
| --- | --- |
| Default Currency | The selected *default* currency for the system. | USD |
| Supported Currencies | The list of supported currencies for the system. | AUD, CAD, CNY, EUR, GBP, JPY, NZD, USD |
#### Supported Currencies
While InvenTree can support any of the currencies defined in the ISO 3166 standard, the list of supported currencies can be limited to only those which are relevant to the user. The supported currencies are used to populate the currency selection dropdowns throughout the InvenTree interface.