Results 1 to 10 of 10

Thread: Base Currency in Sugar

  1. #1
    geoff_allan is offline Junior Member
    Join Date
    Mar 2006
    Location
    Perth, Western Australia
    Posts
    1

    Default Base Currency in Sugar

    Having implemented sugar I have discovered an issue related to the way sugar stores monetary values. The system assumes a base curreny of USD which is fine as long as you live in the US. For everyone else it means that the only way to get accurate reporting in the local currency is to pretend that the base currency is {local_dollars} and change labels and headings to suit. There also needs to be a currency record for USD which reflects the exchange rate between the local currency and USD. Has anyone been successful with this approach or was it necessary to resort to wholesale code changes? I can't imagine that other non-US users of sugar have not come across this issue!

  2. #2
    ruchida's Avatar
    ruchida is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Feb 2005
    Location
    Japan
    Posts
    1,375

    Default Re: Base Currency in Sugar

    Yes, this is a very critical issue, and there are some places in SugarCRM where functions do not correctly work for a local currency. I have fully rewrote codes to resolve this.
    Ryuhei Uchida
    Help Forum Moderator
    Calendar 2.0
    http://blogs.itmedia.co.jp/ruchida/

  3. #3
    patrickdight is offline Sugar Community Member
    Join Date
    Jul 2005
    Posts
    51

    Default Re: Base Currency in Sugar

    We reset the base currency in the config file.

    The following settings change the base currency to Euro for example:

    'default_currency_iso4217' => 'EUR',
    'default_currency_name' => 'Euro',
    'default_currency_symbol' => '€',

    If you serach there are existing posts which may shed more light on this too.

    Good luck

  4. #4
    ruchida's Avatar
    ruchida is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Feb 2005
    Location
    Japan
    Posts
    1,375

    Default Re: Base Currency in Sugar

    The base currency is different from the default currency. SugarCRM stores currency values (opportunity ammount, product price, etc) in $US as base values. This causes lots of calculation errors all over SugarCRM when the ratio of a local currency to USD is large. Those who use Euro may not have this issue because the Euro-USD ratio is very close to one.
    Ryuhei Uchida
    Help Forum Moderator
    Calendar 2.0
    http://blogs.itmedia.co.jp/ruchida/

  5. #5
    george_bbch is offline Sugar Community Member
    Join Date
    Jan 2006
    Location
    Switzerland
    Posts
    349

    Default Re: Base Currency in Sugar

    In my system the default currency in System Settings is Swiss Franc and in the Currencies list there's also US Dollar (which we actually don't use) with a conversion rate of 0.74. I've entered a couple of quotes and the calculations seem OK to me. Do you have a specific example for such an error?

  6. #6
    ruchida's Avatar
    ruchida is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Feb 2005
    Location
    Japan
    Posts
    1,375

    Default Re: Base Currency in Sugar

    Hi,

    The ratio of 0.74 is very small and will not have a critical issue.

    We use a currency "YEN" that has a ratio of 120 to 1 $USD, that always generates a wrong quote line.

    For example, when a new YEN currency is defined with the ratio of '120' to one $US, a product with '250000.000000' YEN is stored as $2083.333333 in the product template table. (This is correct.)

    But this becomes $2083.33 in the product_template popup, and the value in the quote line shows 249960 YEN (= 2083.33 * 120).

    This sort of calculation error happens in every line.
    Ryuhei Uchida
    Help Forum Moderator
    Calendar 2.0
    http://blogs.itmedia.co.jp/ruchida/

  7. #7
    george_bbch is offline Sugar Community Member
    Join Date
    Jan 2006
    Location
    Switzerland
    Posts
    349

    Default Re: Base Currency in Sugar

    OK, I see, but it looks rather like a numeric formatting issue, because in the product_template popup you only have 2 decimal places, whereas in the table there are 6 decimal places, and this truncation (or rounding) generates a visible / sensible error if the exchange rate is very high.

    If there's a way to edit the product_template popup and configure the numeric format with 6 decimal places, then the problem should be fixed.

    On the other hand, if you store the price in the product template also in YEN, then it should be ok, right?

  8. #8
    ruchida's Avatar
    ruchida is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Feb 2005
    Location
    Japan
    Posts
    1,375

    Default Re: Base Currency in Sugar

    Quote Originally Posted by george_bbch
    OK, I see, but it looks rather like a numeric formatting issue, because in the product_template popup you only have 2 decimal places, whereas in the table there are 6 decimal places, and this truncation (or rounding) generates a visible / sensible error if the exchange rate is very high.

    If there's a way to edit the product_template popup and configure the numeric format with 6 decimal places, then the problem should be fixed.
    Thanks for the comment. I have been fighting this issue for more than a year.
    This is not a round or formatting issue. Even if SugarCRM rounds or formats a number with 6 decimals, it does not work when a product with a bigger price like 25000000000 yen is created.

    Quote Originally Posted by george_bbch
    On the other hand, if you store the price in the product template also in YEN, then it should be ok, right?
    Again no. The logics in SugarCRM always refer to a base price in $US, so a product with YEN does not matter.

    By the way, we already rewrote most of parts, and our version of SugarCRM resolves this issue.
    Ryuhei Uchida
    Help Forum Moderator
    Calendar 2.0
    http://blogs.itmedia.co.jp/ruchida/

  9. #9
    sugarchris's Avatar
    sugarchris is offline Sugar Community Member
    Join Date
    Sep 2005
    Location
    San Francisco, CA
    Posts
    861

    Default Re: Base Currency in Sugar

    This is a targetted fix for 4.5 - since I've been tasked with i18n, i guess l10n also falls on my shoulders.

    The current currency implementation has been broken for several releases, and now that more international customers are coming on board, the issue is getting the negative attention it needs.

    Ryohei:
    Does your code change follow the "base_currency" is an abstract float number, and the "default_currency" is usually 1:1 with that number? Or did you try some other method?

  10. #10
    ruchida's Avatar
    ruchida is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Feb 2005
    Location
    Japan
    Posts
    1,375

    Default Re: Base Currency in Sugar

    Chris,

    Good to know you're refurbishing the currency framework.

    I like the currenct concept of the base & the default (local) currency because an international company needs it, but don't like an automatic conversion between the two.

    So our team has rewrote the codes so that automatic conversion does not happen in the Quotes module when the currency of a product is as same as that of a quote (line).

    We have not yet thought of a way to pile up ammounts of opportunities, forecasting, reporting, campaign budget, etc. that are created in various currencies.
    Ryuhei Uchida
    Help Forum Moderator
    Calendar 2.0
    http://blogs.itmedia.co.jp/ruchida/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •