Results 1 to 4 of 4

Thread: Decimal values in amounts in quotes

  1. #1
    bslindhardt is offline Junior Member
    Join Date
    Jul 2011
    Posts
    2

    Default Decimal values in amounts in quotes

    Hello,

    I started using Sugar Professional a few weeks ago and I'm currently seting up functionalities.

    My problem is that I need to specify decimal values when stating amounts of a given product in a quote. We are selling service hours and we sell - for instance - 1,5 hours of service. When I type "1.5" or "1,5" I get an error and the value is corrected to either "1" og "15".

    Can anyone help? Thanks.

  2. #2
    sts's Avatar
    sts
    sts is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    978

    Default Re: Decimal values in amounts in quotes

    Please check the type of the field in admin->developer tools->Studio.
    Stefan Ulrich Sauer
    System Analyst

    Devoteam Danet GmbH
    Gutenbergstraße 10
    D-64331 Weiterstadt
    Germany
    email: Stefan-Ulrich.Sauer@devoteam.com
    http://www.devoteam.de

  3. #3
    bslindhardt is offline Junior Member
    Join Date
    Jul 2011
    Posts
    2

    Default Re: Decimal values in amounts in quotes

    Thanks for your reply.

    You are right; the type of the field (product/ amount) does not allow decimal values. But how do I change that? It seems that I am not able to change the data type as this is a standard field.

    Do I need to create a new field that allow decimal values and replace the standard field?

  4. #4
    sts's Avatar
    sts
    sts is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    978

    Default Re: Decimal values in amounts in quotes

    It is not possible with Studio to change the type of an existing field. But it is possible to do this in files and without changing the standard code.
    If you look into the developer guide, chapter 4 "Customizing Sugar", you'll find a description for "Vardefs". There is a nice example for changes by creating a file in /custom/Extension/modules/<MODULE_NAME>/Ext/Vardefs/ directory.
    In your case it should be enough to create such a file with the entry
    $dictionary['<MODULE_NAME>']['fields']['<FIELD_NAME>']['type'] = <NEW_TYPE>;
    where you have to set the values of the module name, field name and new type off course. After a quick repair (changes the database entry) the field should have the new type.

    [Please save your installation before ... create a zip of the sugar directory and a dump of the database!]
    Stefan Ulrich Sauer
    System Analyst

    Devoteam Danet GmbH
    Gutenbergstraße 10
    D-64331 Weiterstadt
    Germany
    email: Stefan-Ulrich.Sauer@devoteam.com
    http://www.devoteam.de

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. minimal & maximum values on decimal fields
    By manolotri in forum Help
    Replies: 9
    Last Post: 2009-05-07, 05:43 PM
  2. default_permissions - Decimal or Octal Values?
    By jjwdesign in forum Developer Help
    Replies: 9
    Last Post: 2009-03-17, 04:30 PM
  3. Replies: 0
    Last Post: 2009-01-28, 03:11 PM
  4. Quotes & Products - URGENT - Variable Decimal Point needed
    By malcolmh in forum Feature Requests
    Replies: 3
    Last Post: 2006-01-16, 12:03 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
  •