Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Subpanel field format - SugarCRM 5

  1. #1
    nicholak is offline Sugar Community Member
    Join Date
    Nov 2007
    Posts
    16

    Default Subpanel field format - SugarCRM 5

    I have successfully installed a custom module including tables etc and it is correctly displaying detail view and the subpanel in the Accounts module view.

    Whilst the currency format fields for the new module display correctly in their detail view (rounded to 2 decimal places), the subpanel shows the exact db field content which is 6 decimal places (which is odd given that I chose currency type in the module builder...).

    Can anyone suggest how to apply formatting to the subpanel view? Perhaps a custom template is required?

    TIA.

    Nicholas

  2. #2
    lvangool is offline Sugar Community Member
    Join Date
    Jul 2006
    Location
    Near Rotterdam, Holland
    Posts
    280

    Default Re: Subpanel field format - SugarCRM 5

    I looked into it last night, and I couldn't get it right either. In Opportunities' subpanels, there's a nice currency character, and rounding as you say. But setting the fields to type=>currency did not make a difference...

    Please please Sugar, enlighten us.

  3. #3
    mareczek1982 is offline Member
    Join Date
    Jan 2007
    Posts
    5

    Smile Re: Subpanel field format - SugarCRM 5

    I have a question related to your problems.. I would like to disable .00 (decimal separator and 00) values in amount (opportunities).. also.. In list view I want to change display format of amount.. now I have zl2,207.00.. I would like to have 2,207 zl .. What should I do ?

    marekk

    /I've found the answer
    I've edited format_number and format_place_symbol funcions in /var/www/sugarcrm/modules/Currency/Currency.php
    Last edited by mareczek1982; 2008-01-05 at 04:14 PM.

  4. #4
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Subpanel field format - SugarCRM 5

    Try to put a function named "get_list_view_data" in the Bean of the your module ( MODULE_NAME.php )

    Ex: in this case "amount" field.

    function get_list_view_data(){
    global $locale, $current_language, $current_user, $mod_strings, $app_list_strings, $sugar_config;
    $app_strings = return_application_language($current_language);
    $params = array();
    require_once('modules/Currencies/Currency.php');
    $temp_array = $this->get_list_view_array();
    $temp_array[AMOUNT'] = currency_format_number($this->amount,$params);
    return $temp_array;
    }

    Any doubt, you cam see this function in modules/Opportunity/Opportunity.php

    _________
    Diego Lorenzetti
    Lampada Global Services
    SugarCRM Silver Partner
    +55 11 3237-3110
    Sao Paulo, Brasil
    www.lampadaglobal.com

  5. #5
    nicholak is offline Sugar Community Member
    Join Date
    Nov 2007
    Posts
    16

    Default Re: Subpanel field format - SugarCRM 5

    Quote Originally Posted by mareczek1982
    I have a question related to your problems.. I would like to disable .00 (decimal separator and 00) values in amount (opportunities).. also.. In list view I want to change display format of amount.. now I have zl2,207.00.. I would like to have 2,207 zl
    Your question is not specific to this thread. Please do not hijack the threads of others - just start a new thread in future.

  6. #6
    nicholak is offline Sugar Community Member
    Join Date
    Nov 2007
    Posts
    16

    Default Re: Subpanel field format - SugarCRM 5

    Thanks Diego. I'll try your suggestion and report back just as soon as I can get it done.

  7. #7
    nicholak is offline Sugar Community Member
    Join Date
    Nov 2007
    Posts
    16

    Default Re: Subpanel field format - SugarCRM 5

    Diego, can you please clarify if your suggestion is in reply to my question, or to that of mareczek1982? It appears related to his and not mine. Thank you.

    Nicholas

  8. #8
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Subpanel field format - SugarCRM 5

    Hey Nicholas,

    it's to your question, for to show the fields with the currency format in SubPanel.
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.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.

  9. #9
    Dentalman is offline Junior Member
    Join Date
    Feb 2008
    Posts
    1

    Default Re: Subpanel field format - SugarCRM 5

    Hi dlorenzetti,

    I got the get_list_view_data() function working for a field, but what are you supposed to do when you have let's say 3 fields to show as currencies in the subpanel?

    I am a bit surprised that only 'currency_format' => true, is needed to display currency fields in the list view but you need to go through all this trouble for a subpanel.

    Cheers
    DM

  10. #10
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Subpanel field format - SugarCRM 5

    Hi Dentalman,

    To show more than one field as currencies in the subpanel you is just add the line:
    $temp_array[AMOUNT'] = currency_format_number($this->amount,$params);
    for each field.

    i.e.:
    $temp_array[<NAME_OF_FIELD>'] = currency_format_number($this-> <name_of_field> ,$params);

    this parameter: 'currency_format' => true, work only in ListView.
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.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.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Blank Screen for Custom Module
    By swhitlow in forum Developer Help
    Replies: 2
    Last Post: 2007-09-19, 12:30 AM
  2. Replies: 4
    Last Post: 2007-01-12, 05:17 PM
  3. Cron - Sugar Log Error
    By aguerrave in forum Help
    Replies: 9
    Last Post: 2006-05-10, 10:57 AM
  4. how to add a custom link to a subpanel field
    By tooth_decay in forum Developer Help
    Replies: 3
    Last Post: 2005-12-06, 09:00 PM
  5. Serious issue with sugarcrm 3.5.1.c
    By wp.rauchholz in forum Help
    Replies: 17
    Last Post: 2005-12-01, 07:22 AM

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
  •