Need to calculate VAT in form if applicable

I have created a form for expenses that has a field for VAT calculation. I want to calculate the VAT that applies to other fields within the form e.g. Entertainment, but only if this applies. Another field within the form indicates with Y or N whether VAT is applicable. I assume that this requires a Custom Calculation Script but as I am new to this I have not been able to come up with a script that does what I want. Any help will be appreciated.    

The custom calculation script for the field that calculates the VAT could be something like:
(function () {
    // Get the total amount field value
    var total = getField("Entertainment").valueAsString;
    // Get the value of the check box. This will be "Off" if it's deselected.
    var vat_applies = getField("doVAT").value;
    // Set the tax rate here. I'm using 20% as an example
    var VAT = .2;
    // Calculate the VAT if the field is not empty and the VAT should be applied
    // Otherwise, blank this field
    event.value = (total && vat_applies !== "Off") ? util.printf("%.2f", +total * VAT) : "";
This rounds the calculated value to two decimal places, but you can change that to suit your needs. Change "Entertainment" and "doVAT" in the getField lines above to match the name of the field on your form that contains the total value and the check box that indicates whether the VAT should apply.  Also, change the rate to match the actual rate. If the form is not set up the way I'm assuming it is, post again with more information.

Similar Messages

  • Need help in alignment a form

    Hello,
    I am new in writing HTML code. I need help to align my Form
    and it's text.
    Please view my code and please show me how to align all the
    square boxes (the square box is where the user type the text
    input). Currently I have 2 boxes but they are not aligned. The
    below is my code:
    <FORM name="input" method="get" >
    PROJECTROOT: <INPUT TYPE=TEXT SIZE=50 NAME=proj_root>
    <br>
    FRONTEND: <INPUT TYPE=TEXT SIZE=50 NAME=frontend>
    <br>>
    <BR>
    <INPUT TYPE=SUBMIT VALUE=Submit onclick="save()">
    <BR>
    </FORM>
    Would you please help.
    Thank you very much
    Goober35

    <form name="input" method="get" action=""> <!-- ARE
    YOU SURE YOU NEED "GET"
    and not "POST"? -->
    <table cellspacing="0" cellpadding="0" border="0"
    width="300">
    <tr>
    <td><label for="proj_root">PROJECTROOT:
    </label></td>
    <td><input type="text" size="50" name="proj_root"
    id="proj_root"></td>
    </tr>
    <tr>
    <td><label for="frontend">FRONTEND:
    </label></td>
    <td><input type="text" size="50" name="frontend"
    id="frontend"></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit"
    name="submit"
    id="submit" value="Submit" onclick="save()"></td>
    </tr>
    </table>
    </form>
    (your form needs an action attribute value)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "goober35" <[email protected]> wrote in
    message
    news:gcjmlh$p42$[email protected]..
    > Hello,
    > I am new in writing HTML code. I need help to align my
    Form and it's text.
    > Please view my code and please show me how to align all
    the square boxes
    > (the
    > square box is where the user type the text input).
    Currently I have 2
    > boxes but
    > they are not aligned. The below is my code:
    >
    > <FORM name="input" method="get" >
    > PROJECTROOT: <INPUT TYPE=TEXT SIZE=50
    NAME=proj_root> <br>
    > FRONTEND: <INPUT TYPE=TEXT SIZE=50 NAME=frontend>
    <br>>
    > <BR>
    > <INPUT TYPE=SUBMIT VALUE=Submit onclick="save()">
    <BR>
    >
    > </FORM>
    >
    >
    > Would you please help.
    >
    > Thank you very much
    > Goober35
    >
    >
    > <FORM name="input" method="get" >
    > PROJECTROOT: <INPUT TYPE=TEXT SIZE=50
    NAME=proj_root> <br>
    > FRONTEND: <INPUT TYPE=TEXT SIZE=50 NAME=frontend>
    <br>>
    > <BR>
    > <INPUT TYPE=SUBMIT VALUE=Submit onclick="save()">
    <BR>
    >
    > </FORM>
    >

  • I need to create a fillable form and then generate a reports.

    Hello everybody. I need to create a fillable form and then generate a report using numbers. You know, for example if you have customers, I need to be able to write the usual , name, last name, address, and some other details and then using a standard letter I would like the form to be able to populate these fields automatically in a standard pre formatted letter by our company and then be able to print it.
    Any help to point me in the right direction I would appretiate very much.
    I have iwork 9 installed in my macbook pro

    This is acalled a mail merge and is solved using a combination of Numbers (or address book) and Pages.  To get detailed help how to performa a mail merge start in Pages, then in the help menu type Mail Merge:
    Also download the help files for Numbers and Pages here:
    http://support.apple.com/manuals/#
    Page 247 in the Pages User's Guide has details how to perform a a mail merge.
    Post back with specific questions if you need to.
    Regards,
    Wayne

  • Need help in posting a Form

    Hi Everybody,
    I'm having a Struts application that uses DynaValidatorForm for performing Validations.
    The basic flow is like this -> I've got a home page, then a login page (action -> register.do) & a third page (action -> authenticate.do) which is displayed after authenticating the user.
    I'm trying to re-direct the user to the home page once he directly accesses /authenticate.do
    For this, in the Action class of /register, I'd defined a session attribute & set a value to it.
    Then, in the Action class of /authenticate, I'm checking for the session attribute. If not present, I'm re-directing the user to home page.........
    The problem that I'm facing is that when I directly access /authenticate.do, the application is not getting re-directed & instead, it is displaying error messages that User name & password (the 2 fields present in my login page) are required..........
    The <action> tag of /authenticate.do has got validate="true" & hence it seems that validation occurs before re-directing....
    Therefore, can someone tell me why is the application not posting the form to Action class of /authenticate........
    Thanx in advance.....
    Regards,
    Sasidharan N

    <form name="input" method="get" action=""> <!-- ARE
    YOU SURE YOU NEED "GET"
    and not "POST"? -->
    <table cellspacing="0" cellpadding="0" border="0"
    width="300">
    <tr>
    <td><label for="proj_root">PROJECTROOT:
    </label></td>
    <td><input type="text" size="50" name="proj_root"
    id="proj_root"></td>
    </tr>
    <tr>
    <td><label for="frontend">FRONTEND:
    </label></td>
    <td><input type="text" size="50" name="frontend"
    id="frontend"></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit"
    name="submit"
    id="submit" value="Submit" onclick="save()"></td>
    </tr>
    </table>
    </form>
    (your form needs an action attribute value)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "goober35" <[email protected]> wrote in
    message
    news:gcjmlh$p42$[email protected]..
    > Hello,
    > I am new in writing HTML code. I need help to align my
    Form and it's text.
    > Please view my code and please show me how to align all
    the square boxes
    > (the
    > square box is where the user type the text input).
    Currently I have 2
    > boxes but
    > they are not aligned. The below is my code:
    >
    > <FORM name="input" method="get" >
    > PROJECTROOT: <INPUT TYPE=TEXT SIZE=50
    NAME=proj_root> <br>
    > FRONTEND: <INPUT TYPE=TEXT SIZE=50 NAME=frontend>
    <br>>
    > <BR>
    > <INPUT TYPE=SUBMIT VALUE=Submit onclick="save()">
    <BR>
    >
    > </FORM>
    >
    >
    > Would you please help.
    >
    > Thank you very much
    > Goober35
    >
    >
    > <FORM name="input" method="get" >
    > PROJECTROOT: <INPUT TYPE=TEXT SIZE=50
    NAME=proj_root> <br>
    > FRONTEND: <INPUT TYPE=TEXT SIZE=50 NAME=frontend>
    <br>>
    > <BR>
    > <INPUT TYPE=SUBMIT VALUE=Submit onclick="save()">
    <BR>
    >
    > </FORM>
    >

  • Need to calculate subtotal and print it on basis of dc,store and lid number

    Hi Expert
    I need to calculate sub total for couple of fields on the basis of DC, store and lid number. I have clculated the sub total in query level but while printing it in the report i am facing the real problem.
    Please find the example:
    For DC=1111, store=2222, lid no=3333
    QTY rcvd qty ordered qty available REFNO
    20 300 680 7859
    45 258 348 4528
    For DC=1111, store=2222, lid no=3334
    QTY rcvd qty ordered qty available REFNO
    58 78 69 1487
    45 54 74 2578
    i want the sum in below of completion of one set of values. but as i am calculating the sum in sql query , i put it in a group and it is appearing in the end of every line which is not my desired.
    Kindly let me know how to do the grouping so that i can get it in the end of each combination of DC,store, lid no.
    Thanks in advance.
    Regards
    Srikant

    Can you send me the xml and RTF template to [email protected] ? I will take a look.
    Thanks,
    Bipuser

  • Need to ommit the short form letter from the given string

    HI,
         I need to ommit the Short form letter from column data.
    EX :
    CREATE table #testdata
    (id int identity(1,1),cust_address varchar(max))
    insert into #testdata (cust_address)
    select 'first street 5N, North'
    union
    select 'second street W, west'
    union
    select 'roja street 5S, South'
    union
    select 'temple street E, East'
    union
    select 'first street, Northwest, NW'
    union
    select 'first street, Southwest, SW'
    select  * from #testdata
    actutal out put:
    id cust_address
    1 first street 5N, North
    2 first street, Northwest, NW
    3 first street, Southwest, SW
    4 roja street 5S, South
    5 second street W, west
    6 temple street E, East
    Need to ommit the Short form letter from this output,
    condition , 1) the short form letter should have space in front of the letter ex : first street (space)N, North
                   so the output should be "first street, North" like that for other words like "first street, Southwest, SW" should be "first street, Southwest"
                 2) the short form letter should not combine with any other letter ex :  first street 5N, North
                     here we dont need to do anything.
    Required Out put :
    id cust_address
    1 first street 5N, North
    2 first street, Northwest
    3 first street, Southwest
    4 roja street 5S, South
    5 second street, west
    6 temple street, East
    Nandha Kumar

     CREATE FUNCTION [dbo].[SplitString]
             @str VARCHAR(MAX)
        RETURNS @ret TABLE (token VARCHAR(MAX))
         AS
         BEGIN
        DECLARE @x XML 
        SET @x = '<t>' + REPLACE(@str, ',', '</t><t>') + '</t>'
        INSERT INTO @ret
            SELECT x.i.value('.', 'VARCHAR(MAX)') AS token
            FROM @x.nodes('//t') x(i)
        RETURN
      END
    with cte
    as
    select  *
    from #testdata
    CROSS APPLY (SELECT * FROM [dbo].[SplitString](cust_address)) AS der
    ) ,cte1
    as
    select *,
    case when UPPER(token)=token COLLATE Latin1_General_BIN
      then  '' else token end as d 
     from cte
     ) ,CTE2
     AS
     (SELECT *,case when RIGHT(UPPER(D),1)=RIGHT(D,1) COLLATE Latin1_General_BIN 
      then  replace(D,RIGHT(UPPER(D),1),'') else token end d1 FROM CTE1
     SELECT m1.id,
           ( SELECT m2.D1 + ','
               FROM cte2 m2
              WHERE m2.id = m1.id
              ORDER BY id
                FOR XML PATH('') ) AS token
      FROM cte2 m1
     GROUP BY m1.id 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • NEED TO SEND MAIL FROM FORMS...

    DEAR ALL,
    I NEED TO SEND MAIL FROM FORMS WHEN I PRESS THE MAIL BUTTON.
    I HAVE NO IDEA FOR THIS CRITERIA. IF ANY ONE EXPERIENCED WITH
    THIS CRITERIA, PLS HELP ME AND GIVE ME THE CODING FOR THAT.
    AND ALSO PLS EXPLAIN EACH LINE OF CODING, WHICH U POST.
    THANKS IN ADVANCE
    S.BERNANDAS

    Your requirement can be done in forms. Good amounts of advice here. There 244 messages this year alone that fit the search criteria in the Oracle Forms forum.

  • Need to calculate the area of a vector shape in Illustrator CS6

    Hi All,
    I need to calculate the area of vector graphics we are designing for a vinyl window sticker. I've read a couple of previous threads, and all the solutions provided either don't work (using cmd, option, shift F12 to open debugging menu to get area), or are beyond my level of experience (doing a build of the Telegraphics Path Area Filter). Does anyone have any solutions, or know how to access the debugging menu/window other than using cmd, shift, option F12....I couldn't even find it in the Shortcut Keys preferences).  Thanks!

    Jacob
    It worked very well - great stuff!. I am a physician and I am working on cardiac MRI.. such as calculating the heart function using slices of heart images in systole and diastole (when the heart is squeezed or full of blood).
    .. we can write a little medical paper comparing really pricey software (GE, Siemens, Medis you name it..) with this method for people with not too many pennies in their pocket. The advantage of using Illustrator is that you can blow up the images up to the point of loosing resolution, and trace the margins of the heart with an accuracy that would make any GE guy cry for his mama..
    I thought even a cm further.. for simple-minded people (such as physicians for example) one would like a way to input the area of one slice directly into an equation. For example would be a way to create a routine that would take the number of the area of one slice and input it in this equation? Such as to create a little square where you put the slice, you trace it and then the program takes that number and pitches it in the equation without you writing it down on a paper.
    thanks again!
    Avi

  • Hi, I need find out a script form of MIGO

    When user receive goods of PO using MIGO, they can print the goods receipt slip if they check the print box.
    Now I need create a new script form instead the default one, but I can't find the configuration of it.
    I think it should be SPRO->Material Management->Purchasing->Messages->Output Control->Message Types->Define message for purchase order , and I got the configuration of NEU, but the result looks not right.
    Is there anyone can help me to find out the exactly configuration of the script form of MIGO?

    but there are no WT03 at all, all output types list below:
    ET01     Material label
    J1IB     Excise Bonding ARE
    J1IF     Subcontract Challan
    MLFH     GR Missing Parts Msg
    MLGR     GR Message
    MLMD     GR Qty Deviation
    MLUD     GR under/Over deliv.
    WA01     GI Note Vers.1
    WA02     GI Note Vers.2
    WA03     GI Note Vers.3
    WAE1     GI Label Vers.1
    WAE2     GI Label Vers.2
    WAE3     GI Label Vers.3
    WE01     GR Note Vers.1
    WE02     GR Note Vers.2
    WE03     GR Note Vers.3
    WEE1     GR Label Vers.1
    WEE2     GR Label Vers.2
    WEE3     GR Label Vers.3
    WEK1     Kanban Card 1
    WF01     GR Prod. Ord. Vers.1
    WF02     GR Prod. Ord. Vers.2
    WLB1     GI Note RP Vers.1
    WLB2     GI Note RP Vers.2
    WLB3     GI Note RP Vers.3

  • Do customers need adobe to fill out forms

    I am trying to do a meal order form to email to my customers for them to fill out and submit.  Do my customers need Adobe to fill out form?

    The answer depends on which Adobe FormsCentral workflow you use.  If you plan to create a pdf form and email it to customers, then they will need the free Adobe Reader to fill out the form and submit the data to FormsCentral.  If you create a FormsCentral HTML form and email a link to the form, then your customers will need a web browser to enter and submit data.

  • Need to calculate average

    Hi all,
    i have 2 int. tables defined as below:
    DATA: BEGIN OF i_mgmt OCCURS 0,
           btrtl     TYPE pa0001-btrtl,
           btext     TYPE t001p-btext,
           perm      TYPE pad_amt7s ,
           con       TYPE pad_amt7s ,
           perm2     TYPE pad_amt7s ,
           con2      TYPE pad_amt7s ,
           perm3     TYPE pad_amt7s ,
           con3      TYPE pad_amt7s ,
           tot       TYPE pad_amt7s ,
           avg       TYPE pad_amt7s ,
          END OF i_mgmt,
          BEGIN OF i_mgmtavg OCCURS 0,
           btrtl    TYPE pa0001-btrtl,
           btext    TYPE t001p-btext,
           perm     TYPE pad_amt7s ,
           con      TYPE pad_amt7s ,
           perm2    TYPE pad_amt7s ,
           con2     TYPE pad_amt7s ,
           perm3    TYPE pad_amt7s ,
           con3     TYPE pad_amt7s ,
           tot      TYPE pad_amt7s ,
           avg      TYPE pad_amt7s ,
           avgsal   TYPE pad_amt7s ,
          END OF i_mgmtavg,
    I need to calculate avgsal...
    i_mgmtavg-avgsal = imgmtavg-avg / imgmt-avg.
    I'm getting any idea how do calculate.please suggest some methods to calculate avgsal.
    Thanks.

    Hi Ramya,
    You can try the following code
    loop at i_mgmt .
    read table i_mgmtavg with key btrtl = i_mgmt-btrtl btext-i_mgmt-btext.
    if sy-subrc = 0.
    i_mgmtavg-avgsal = imgmtavg-avg / imgmt-avg.
    modify i_mgmtavg.
    clear i_mgmtavg-avgsal.
    endif.
    endloop.
    Regards,
    Vik
    Edited by: vikred on Jul 17, 2009 12:23 PM

  • Define appraisal form for Applicants

    Dear experts!
    Now, I'm getting some issues about define appraisal form for applicant.
    - Where is I can define appraisal form for applicant?
    - Steps configure after that I can create appraisal form for applicants.
    - Steps process applicant, before transfer them to Employee.
    Help me, please!
    Regards, Huy!

    Hi,
    Are you using ECC Recruitment or E-Recruitment module.
    Since I have not worked extensively on E-Recruitment Module, will not be able to do justice to your questions. But there is enough material available on SDN as well as on SAP Help. Please have a look.
    Defining Questionnaires and ranking can be managed easily if you are using E-Recruitment module.
    Many Thanks,
    Chetan

  • Need reference material on pdf forms

    hi all,
    I need to develop a pdf form in sap...But i have no knowledge about it..Can u suggest some good link or any reference so that i can have a concept of pdf forms and so that i can start developing one...

    Hi,
    Please check the standard sap help
    http://help.sap.com/saphelp_nw2004s/helpdata/en/37/47a2be350c4ac8afe36b691203971f/frameset.htm
    Thanks,
    Naren

  • Calculate VAT on freight

    Dear,
    In pricing procedure, I want to calculate VAT on freight conditoin type.. pls tell the procedure.

    Hi,
        Using M/08, open that particular pricing procedure and here scroll down to get to the freight condition type , then against that freight condition type move horizontally, to see 3  checkboxes--
    1. Manual
    2. required
    3. statistical
    here the statistical checkbox is to be unchecked
    Then create the PO  with the taxcode containing the VAT
    Thanks & Regards,
    Amjad

  • Calculate vat on frieght

    Hi All
    My procedure has to calculate VAT on Frieght.
    (BasicEDFRT) on this VAT.
    But in MM, Basic price is coming from Pricing procedure and (ED+VAT) is coming from TAXINN,
    how can i include Frieght before VAT
    pls help
    Regards
    Vipin

    Hi pankaj
    i try what u suggest but Alt Cal Base Value  column is not their intaxinn so i add 362 in cal ty but it result in base value deduct by friegt value and vat is not calculated it comes 0.
    pls help

Maybe you are looking for

  • Weird behaviour from AirPort after 10.5.8 update on MacBooks

    Hi, I see I'm not alone with the erratic AirPort behavior I've experienced after I updated my MacBook 13" and MacBook Pro 15" to OS 10.5.8. I have several drives and printers connected to my AirPort Extreme including a drive I use for Time Machine ba

  • Word to PDF Conversion = Different Color on Paper

    Hello All, I created a bunch of forms in Word 2010. Converted them into PDF and made them fillable. On screen Word doc and PDF doc colors look the same, but when I print PDF documents their blue turns intor dark purple. Any suggestions on how to keep

  • How to remove entries from the plot legend?

    Hello, I have got a waveform graph to display measurement data. Sometimes there will be 40 plots shown. The plot legend also expands to 40 and I limit the number of elements shown in the Plot legend and I have activated the vertical scroll bar. Of co

  • How to find how much space is required for backup.

    Hi, I have 7 gb of space available but on backup it is saying space not avialable, Please tel me following 1) how to find how much backup space is required. 2) and i think it does not currup the old backup set when backup fails?so i can feel good tha

  • My Apple TV 2 isn't recognised in iTunes.

    Hi, My Apple TV 2 isn't recognised in iTunes and checking the support pages the solution appears to be to get a Bonjour update download, only problem is where do I get this download as I can't find it anywhere. Second problem may be linked to the fir