ERP5 KM

HowToUseExperimentalBase

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.

HowToUseExperimentalBase (last edited 2008-03-27 21:02:48 by BartekGorny)

Page
  • Immutable Page
  • Info
  • Attachments
User
Learn about new ERP5 releases,technical articles, events and more.

Subscribe to the monthly ERP5 Newsletter!