General
It is possible to add calculated indexes in the videocoding tab in order to manage currency conversions.
Operation:
4 indexes are added to the videocoding and must be made visible to third parties using foreign currency amounts.
3 indexes are computed via scripts. The user does not have to enter these values except to correct/balance amounts.
1 index is to be entered manually by the user: the conversion rate. It can be configured by default by provider (not by currency). Once entered, the scripted indexes are recalculated from the entered value.
Visual:

Configuration
To simplify user manipulations, we have included all our indexes in an index group to enable/disable them in a single manipulation.
Conversion Rate
The conversion rate is a string value, to allow you to receive decimals with more than 2 decimal places.
Total Indexes
These are decimal scripted indexes.
Here’s the script to use and customize for each index:
/**
* @param pParameters : Informations du document (les index dans lesquels on va chercher la date)
* @param pIDIndexToConvert : identifiant des index à sommer et convertir en devise
* @param idDateIndex : identifiant de l'index reprensentant le taux de la devise à appliquer à pIDIndexToConvert
* @return montant en devise converti dans le taux renseigné
*/
var getTTCConverted= function(pParameters, pIDIndexToConvert, pIDIndexConversion){
var indexesToConvert = getIndexesFromID(pParameters,pIDIndexToConvert);
var taux = parseFloat(getTextFromIndexInfo(getFirstIndexFromID(pParameters,pIDIndexConversion)));
var totalIndexToConvert = 0;
for(var i=0;i < indexesToConvert.length;i++){
var indexeToConvert = getTextFromIndexInfo(indexesToConvert[i]);
totalIndexToConvert += parseFloat(indexeToConvert.replace(',', '.'));
}
return totalIndexToConvert * taux;
};
return getTTCConverted(pParameters, "AMOUNT_INCLUDING_VAT_INDEX", "TAUX_DEVISE_CONVERSION_DEVISE_INDEX").toFixed(2);