Alternative providers for exchange rates.

Program
Posted by Joe (joe) on Dec 07 2009
News from the Editor >> Program

While we still use ECB as our stable exchange rates provider, we are, however, 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.
https://frontaccounting.cvs.sourceforge. … c?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.
 

Code:

<?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.

/Joe

Last changed: Dec 07 2009 at 10:29 am

Back

Support This Project