erp5_base_experimental
Currency_convertCurrency
This script accepts the following arguments:
- to_currency - currency to convert into
- quantity - optional; default is 1, then returns exchange rate
- date - for when do we want exchange rate; defaults to today
- currency_exchange_type - to select cell; defaults to "sale"
The script looks up exchange rate and converts the quantity.
If it can't find a suitable rate or detects an inconsistency (like overlapping exchange lines) it logs a warning and returns 0.
This is a proposal for implementation of the method Currency.convertCurrency which is not implemented now but is a part of the API.