Modules:Conversion Rates Creation
Conversion Rates Creation is a commercial module that adds a process to create and update opposite conversion rates automatically.
Specifically this module:
- Adds two fields to the Conversion_Rates window
- A check to create or not missing conversion rates
- A reference to the opposite conversion rate
- Adds a preference to default the check to create missing rates
- Adds the processes to create missing rates (available with module version 2.0.0 and above) and create/update the opposite rate
Module version 2.0.0 improves the capabilities of this module as it allows to create all combinations of currencies depending on the conversion rates already saved.
This module needs minimal configuration to be used.
The preference OBCRC_CreateOppositeRate is created at System level and is defaulted to the value N. It can be changed at any time by a System Administrator.
Opposite Conversion Rate Creation
Two fields have been added to the Conversion_Rates window:
- A check named Create Missing Rates on Rate Creation (formerly Create Opposite)
- A reference to the Opposite Rate
Formerly the visibility of the Opposite Rate field was defined both by the Create Opposite check and the content of the Opposite Rate reference:
- If the check was not selected and the reference was empty, the reference would not be shown.
- If the check was selected the reference would be shown regardless of its content.
- If the reference was not empty then the check could not be unchecked. Trying to do so fired an error message and the saving process was canceled.
Now with version 2.0.0 if we create a new record, enable the Create Missing Rates on Rate Creation check and save the record, the system will check for all the conversion rates already saved with the same Valid To and Valid From dates, and combine them creating missing conversion rates. E.g.
User inputs rate EUR (€) => USD ($) without the check
User inputs rate EUR (€) => JPY (¥) with the check
System creates automatically the following rates:
- USD => EUR
- JPY => EUR
- USD => JPY
- JPY => USD
After refreshing the newly created record the reference to the Opposite Rate will show up:
Updating Conversion Rates
Updating a Conversion Rate with its Opposite Rate reference set will cascade the changes to the Opposite Rate.
Prior to 2.0.0 if the Opposite rate had the opposite reference set (assumming the original rate already had the reference), the system would try to cascade changes over and over causing infinite loops trying to update both records.
With 2.0.0 both the original and the opposite records can contain the corresponding reference.
There are some triggers that ensure the consistency of the Conversion Rates entered to the database.
If the creation of an opposite rate would create inconsistencies in the database, neither the original nor the opposite rates can be saved, and an error message is shown accordingly. This message, however, doesn't specify if the error ocurred while saving the original or the opposite record, it's up to the user to check what has gone wrong.
The same can happen when updating Conversion Rates. If the changes made would create inconsistencies none of the records is updated.