Results 1 to 2 of 2

Thread: Duplicating Quotes in foreign currencies after conversion change

  1. #1
    robertbmirth is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Irvine, CA
    Posts
    345

    Default Duplicating Quotes in foreign currencies after conversion change

    Hey all,

    I'm working on SugarPro 6.2, and I'm having an issue when I duplicate quotes that are not in USD. We like to keep our currencies up to date, so we also have a script running that checks and updates our conversion rates daily. This, however, causes an issue should we try to duplicate a quote in a foreign currency. When we duplicate a quote for which the conversion rate has changed (essentially all of them, I don't know any days that happen when conversion rates don't change) the values on the line items will change as well. For example, we duplicated a quote in GBP for £3262.08 that was from a few weeks ago and we ended with a value of £3214.54. The currency conversion from USD to GBP went from .6524 to .6429 in that time.

    The issue is that, in the duplication process, Sugar duplicates the USD value and then recalculates for the currency. In the above example, you'll note that 3262.08 / .6524 ~= 3214.54 / .6429 ~= 5000 (excuse rounding errors), which is the USD value for the line item. I'm wondering if this is working as intended or if this is a bug.
    Robert Beckman
    Software Engineer
    Mirth Corporation

  2. #2
    robertbmirth is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Irvine, CA
    Posts
    345

    Default Re: Duplicating Quotes in foreign currencies after conversion change

    Furthermore, this issue doesn't happen just on the duplication process. If you re-edit a quote, the same issue occurs, which I believe is even more of an issue, because the same quote will have different values before and after an edit. I would definitely consider that a bug, and the fix is below.

    Change the $add_row .= statement on line 251 of modules/Quotes/views/view.edit.php to
    PHP Code:
    $add_row .= "addRow('$line_item->id','" format_number($line_item->quantity00) . "','$line_item->product_template_id','$encoded_name'"
        
    ", '".format_number($line_item->cost_price$significantDigits$significantDigits, array('convert' => false'currency_id' => $curid)) . "'"
        
    ", '".format_number($line_item->list_price$significantDigits$significantDigits, array('convert' => false'currency_id' => $curid)) ."'"
        
    ", '".format_number($line_item->discount_price$significantDigits$significantDigits, array('convert' => false'currency_id' => $curid)) . "'"
        
    ", '', '', '$line_item->pricing_factor', '$line_item->tax_class', '$tax_class_name', '$line_item->mft_part_num', '$product_bundle->id', '$product_bundle->bundle_stage', '$product_bundle->name', '"
        
    format_number($product_bundle->shipping)."', '".js_escape(br2nl($line_item->description))."', '"$line_item->type_id."'"
        
    ", '".format_number($line_item->discount_amount$significantDigits$significantDigits, array('convert' => !$line_item->discount_select'currency_id' => $curid))."'"
        
    ", ".($line_item->discount_select?1:0)
        . 
    ", ".($line_item->deal_calc?1:0)
        . 
    ", '".$line_item->status."');\n"
    and the $add_row .= statements starting on line 292 of the same file to
    PHP Code:
    $add_row .= "addRow('','$line_item->quantity','$line_item->product_template_id','$line_item->name'"
        
    ", '".format_number($line_item->cost_price$significantDigits$significantDigits, array('convert' => false'currency_id' => $curid)) . "'"
        
    ", '".format_number($line_item->list_price$significantDigits$significantDigits, array('convert' => false'currency_id' => $curid)) ."'"
        
    ", '".format_number($line_item->discount_price$significantDigits$significantDigits, array('convert' => false'currency_id' => $curid)) . "'";
    $add_row .=  ", '', '', '$line_item->pricing_factor', '$line_item->tax_class', '$tax_class_name',
        '$line_item->mft_part_num', 'group_$product_bundle->id', '$product_bundle->bundle_stage', '$product_bundle->name', '"
    .format_money($product_bundle->shipping,FALSE)
        .
    "', '".js_escape(br2nl($line_item->description))."', '"
        
    $line_item->type_id ."','"
        
    $line_item->discount_amount."',".($line_item->discount_select?1:0)
        . 
    ",0, '"$line_item->status."');\n"
    Robert Beckman
    Software Engineer
    Mirth Corporation

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2012-01-05, 07:51 PM
  2. Change size of product text fields in Quotes Editview
    By chronos13 in forum Developer Help
    Replies: 3
    Last Post: 2011-05-11, 01:37 PM
  3. Duplicating Quotes module ?
    By Liior in forum Developer Help
    Replies: 4
    Last Post: 2009-05-28, 10:04 AM
  4. Change charset of PDF quotes printing?
    By rudibr30 in forum Help
    Replies: 0
    Last Post: 2008-09-30, 08:57 PM
  5. Conversion Rate of currencies via RSS
    By Systems Navigator in forum Feature Requests
    Replies: 3
    Last Post: 2008-08-30, 11:38 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
  •