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

Thread: Calculations in templates?

  1. #1
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Calculations in templates?

    General question,

    Is it possible to make a calculation in an email template with two fields? For example the value of one field multiplied by the value of another?

    Thanks


    6.0 Pro is the version I use

  2. #2
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Calculations in templates?

    Anybody know a trick to do this? Maybe in the HTML code of the template?

    Help is really appreciated!

  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: Calculations in templates?

    Let us know in details what you want to accomplish.

    Regards
    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
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Calculations in templates?

    Hello André and other fellow users,

    Actually what I want to do is the following:

    I have made a custom module that is related to the product catalog. This module uses the list price of the product that I selected, but sometimes I would like to apply a discount on this price. This discount can vary, so I created a field in the custom module with the amount of discount. What I would like is that in the template that I want to be sent, the list price is multiplied by this discount.

    For example: the list price is $300 and the discount is 40% (0.4) then I would like to calculate the discount by multiplying the {listprice} * {discount%} = $300 * 0.4= $120
    Next I would like to calculate the discount price by subtracting the discount from the list price:
    {listprice} - {discount} = $300-$120= $180.

    Since I found out that the whole template is captured in a html code that you can edit, I thought this might maybe be possible. If this is possible, help is really welcome.

    Thanks in advance!

    OS: Windows 2003 Server R2
    Sugar: Version 6.6.0 Pro
    Webserver: apache 2.0.59
    PHP: Version 5.2.5
    Mysql: version 5.0.45

  5. #5
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Calculations in templates?

    Anyone an idea?

    thanks

  6. #6
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Calculations in templates?

    bump.........

  7. #7
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Calculations in templates?

    Anyone please?

  8. #8
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Calculations in templates?

    Is there nobody who can tell if and how it is possible to make simple calculations in html code?

    Please help.

  9. #9
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Calculations in templates?

    bump......

  10. #10
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Calculations in templates?

    bump.....................

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. Calculations in reports
    By REByers in forum Help
    Replies: 5
    Last Post: 2010-03-01, 04:22 AM
  2. Calculations
    By monicaDC in forum Developer Help
    Replies: 11
    Last Post: 2009-05-13, 05:57 AM
  3. Date Calculations
    By brodellis in forum Help
    Replies: 3
    Last Post: 2009-01-23, 06:18 AM
  4. Mathematical calculations
    By danrweki in forum Developer Help
    Replies: 2
    Last Post: 2008-08-05, 07:58 AM
  5. Help with Calculations
    By JackieBM in forum Help
    Replies: 0
    Last Post: 2007-02-21, 06:13 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
  •