Results 1 to 5 of 5

Thread: Amount in opportunities increases on ever save/duplicate

  1. #1
    catnipper is offline Sugar Community Member
    Join Date
    Jul 2008
    Posts
    15

    Default Amount in opportunities increases on ever save/duplicate

    I can not really imagine it can be a bug, but I noticed in my SugarCRM 5.1.0b CE that every time I edit/save an opportunity the given amount increases by 2 digits (x 100).

    Let's give an example:

    1. Create new opportunity: Amount = 100,10 [€]
    2. Detail view is correct (100,10)
    3. List view fails (10.010,00)
    4. Values written into the DB are:
    opportunities.amount = '100.1'
    opportunities.amount_usdollar = '10010'
    5. Going back to details view is correct again (100,10)
    6. In edit view we get again '100,10' displayed
    7. Saving the data without any changes writes the following to the DB:
    opportunities.amount = '100.1'
    opportunities.amount_usdollar = '10010'

    I defined the following for the System Locale Settings:
    - Default currency: Euro
    - 1000s Separator: '.' (dot)
    - Decimal Symbol: ',' (comma)

    Sure this has something to do handling the conversion (calculating 'amount_usdollar').
    Maybe anybody already got deeper into this???

  2. #2
    mattecosta is offline Member
    Join Date
    Dec 2006
    Posts
    9

    Default Re: Amount in opportunities increases on ever save/duplicate

    There is a double conversion error in modules/Opportunities/SaveOverload.php
    Modify it changing the line :

    $focus->amount_usdollar = $currency->convertToDollar(unformat_number ($focus->amount));
    into
    $focus->amount_usdollar = $currency->convertToDollar($focus->amount);


    This solved the problem to me.
    This problem only happen if you use decimal and thousands separator different from US standard.

  3. #3
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Amount in opportunities increases on ever save/duplicate

    Hi mattecosta

    You may search at the bugs.sugarcrm.com and check if there is that bug filed.
    You can file a new one if it does not exist and suggest the fix.
    If that one already exists you may add a note suggesting the fix.

    Great job!
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  4. #4
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Amount in opportunities increases on ever save/duplicate


  5. #5
    catnipper is offline Sugar Community Member
    Join Date
    Jul 2008
    Posts
    15

    Default Re: Amount in opportunities increases on ever save/duplicate

    Thank's a lot,
    that's it!

    Quote Originally Posted by mattecosta View Post
    There is a double conversion error in modules/Opportunities/SaveOverload.php
    Modify it changing the line :

    $focus->amount_usdollar = $currency->convertToDollar(unformat_number ($focus->amount));
    into
    $focus->amount_usdollar = $currency->convertToDollar($focus->amount);


    This solved the problem to me.
    This problem only happen if you use decimal and thousands separator different from US standard.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Amount -- Opportunities
    By fvermenouze in forum Developer Help
    Replies: 1
    Last Post: 2007-10-18, 01:03 PM
  2. Total amount for Opportunities
    By devknob in forum Help
    Replies: 1
    Last Post: 2007-04-24, 12:42 AM
  3. Replies: 1
    Last Post: 2006-08-25, 10:20 AM
  4. Replies: 0
    Last Post: 2005-03-03, 06:58 PM
  5. Replies: 3
    Last Post: 2004-10-29, 10:34 PM

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
  •