# HG changeset patch
# User Rafa Alonso <rafael.alonso@openbravo.com>
# Date 1425462987 -3600
#      Wed Mar 04 10:56:27 2015 +0100
# Node ID 8aca4470c183a3843803624fc4f462a2e4bd13c3
# Parent  3382e410622e2e2202864b5ddc231e1e9ecec253
Related to issue 29106: Changes in the currency rate will not be treated as errors

The problem was that when the conversion rate was changed in the Backoffice, the rate was not updated in the WebPOS if there was previous data in the cache
This problem was caused because a check that was preveting unexpected or unwanted rate changes during Q3

A change has been done to allow rate changes and log the change in the 'info' console level

The problem was that there are legit changes in the conversion rate. E.g. when the rate is changed in the Backoffice
The check

 was that this check was added to avoid anwanted changes in the conversion rate.
As this was

diff -r 3382e410622e -r 8aca4470c183 web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js
--- a/web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js	Wed Mar 04 10:41:32 2015 +0100
+++ b/web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js	Wed Mar 04 10:56:27 2015 +0100
@@ -117,10 +117,13 @@ OB.UTIL.currency = {
 
     var conversionAlreadyExists = this.findConverter(fromCurrencyId, toCurrencyId);
     if (conversionAlreadyExists) {
+      // the conversor is already present. this is fine, unless a lot of calls are finishing here
       if (conversionAlreadyExists.rate !== rate) {
-        OB.error('The rate for a currency is trying to be changed. If you are not trying to change the rate, something needs critical and inmediate fixing. If you really want to change the rate and know what you are doing, clean the OB.UTIL.currency.conversions array and fill it again.');
+        // This will happen everytime the conversion rate has changed in the backend and the masterdata is synchronized (login, incremental, etc).
+        OB.info(enyo.format("Currency conversion from currencyId = '%s' to currencyId = '%s', updated to %s (was %s)", fromCurrencyId, toCurrencyId, rate, conversionAlreadyExists.rate));
       }
-      return; // the conversor is already present. this is fine, unless a lot of calls are finishing here
+      conversionAlreadyExists.rate = rate;
+      return;
     }
     this.conversions.push({
       fromCurrencyId: fromCurrencyId,
