Purpose

To obtain the current exchange rates from the web for all other currencies used in the specific FA install for the chosen company vis-a-vis the default currency of the company and then tweak the value before storing it along with an settable date (default today) from which it should be operational.

Procedure

  • Currencies acceptable to the company are set in Banking and General Ledger -> Currencies
  • Default Currency of Company is set in Setup -> Company Setup
  • Get Current Exchange Rates from the Web and set the optionally tweaked rate and Effective Date at Banking and General Ledger -> Exchange Rates
  • The Exchange Rate Request page still lists the default currency for choice but does not display the default currency in the rate obtained page.

Tips and Tricks

As of v2.3+, the order of using the Exchange Rate Provider is: ECB, YAHOO and then GOOGLE. No fiddling with code is necessary now. The file called /gl/includes/db/gl_db_rates.inc contains the code and the order of processing that can be rearranged for quicker and differently ordered rate acquisition as the case may be. As of v2.3.12+, the default Exchange Rate Provider can be set in the config.php file and BLOOMBERG is now an additional choice. The URLs used are:

It is possible that in the case of YAHOO (Old URL), more than one entry arises whence the first one will be chosen. Hence in BugFix 1792 - FA v2.3.12+ a new processing code with a new url came into effect:

Development Notes

Currently (as of FA v2.3.12+) only rate_buy field in the exchange_rates table is used in FA. The field rate_sell is not used (may be used in future).

Archive

We still use ECB as our stable exchange rates provider, however, we are avare of that the coverage is not good for South America, Africa and Asia, so we have implemented it so that it is possible to swap provider. In CVS Main, a file called /gl/includes/db/gl_db_rates.inc has been updated so it is possible to use YAHOO or GOOGLE instead of ECB. Both YAHOO and GOOGLE have almost all currency rates in the world. These changes are going to release 2.2.2, but if you want this to be available in your 2.2 you will have to download this file from the CVS repository. http://frontaccounting.cvs.sourceforge.net/viewvc/frontaccounting/frontaccount/gl/includes/db/gl_db_rates.inc?view=log And you will have to create the following locale.inc file and place it in the /lang/xx_YY folder, where xx is the language and YY is the country. F.i. en_US.

<?php

class Hooks {

    function retrieve_exrate($curr, $date)
    {
        return get_extern_rate($curr, 'YAHOO', $date);
        //return get_extern_rate($curr, 'GOOGLE', $date);
    }

}

?>

This will use YAHOO instead of ECB. Comment the YAHOO line and uncomment the GOOGLE line if you want to use GOOGLE instead. We do not guarantee that the currency rates are provided correctly, but I guess this is better than nothing for countries not served by ECB.