If qty 11, then calculate 10% discount on amount

New to java scripting, I've been looking and need help on the following...
3 fields: 
quant subtotal
amount subtotal
discount
If "quant subtotal" is >11, then "discount" =  ("amount subtotal" ) (-10%)
If "quant subtotal" is <=11, then "discount" =  0

Since its an AcroForm the article provides the correct information.
The solutuion is to create a caculation script in the "discount" field.
var nQuantity = this.getFeild("quant subtotal").value;
if(nQuantity > 11)
    event.value = this.getFeild("amount subtotal" ).value * 0.1;
else
   event.value = 0;
Thom Parker
The source for PDF Scripting Info
pdfscripting.com
The Acrobat JavaScript Reference, Use it Early and Often
Then most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)

Similar Messages

  • Trying to create a formula to calculate a discounted percentage, I need Help!?!?

    I am learning as I go.  I have a form I am working on and I need to calculate a discount.  So I created a combo box that I want to add 5 and 10% into.  I want my salesman to choose one of those percentages and have it calculate the 5% or 10% discount off the subtotal and give me a dollar amount in the discount field.
    5% x $100.00(subtotal) =  discount amount $5.00
    I am really not sure where to start with this.  Hoping for some pros out there to give me the dummies version of how to.

    As the export value for each of these options enter 0.05 and 0.1, resp.,
    and then you'll be able to just use the drop-down field directly in a
    Product calculation, together with the subtotal field, to calculate the
    value of the discount.

  • FM to calculate Customer Discounts

    Hello Experts,
                               I need a function module to calculate customer discounts. customer cash discounts that get displayed based on payment terms is what I need.
    Any pointers to other threads will be much appreciated.
    Thanks!
    Rahul.

    Try this
    CALL FUNCTION 'ISU_S_DISCOUNT_PROVIDE'
    EXPORTING
    x_rabzus = st_discount_hdr-rabzus
    x_ab = wa_discount_item-ab
    x_wmode = '2'
    IMPORTING
    y_obj = xy_obj
    EXCEPTIONS
    not_found = 1
    foreign_lock = 2
    general_fault = 3
    OTHERS = 4.
    all the details of the discount are returned in type xy_obj
    change the details of the discount in ie. xy_obj-edsch ie.:
    loop at xy_obj-edsch assigning <fs_edsch>.
    add 10 to <fs_edsch>-rabproz.
    endloop.
    set the control parameters and the okcode
    xy_obj-contr-no_dialog = 'X'.
    xy_obj-contr-db_update = 'X'.
    xy_obj-contr-upd_online = 'X'.
    xy_obj-auto-edscd_okcode = 'SAVE'.
    call the function module to effect the changes
    CALL FUNCTION 'ISU_S_DISCOUNT_CHANGE'
    EXPORTING
    x_rabzus = st_discount_hdr-rabzus
    x_ab = wa_discount_item-ab
    x_no_dialog = 'X' "!!!!
    x_obj = xy_obj
    IMPORTING
    y_db_update = sw_db_update
    EXCEPTIONS
    not_found = 1
    foreign_lock = 2
    cancelled = 3
    general_fault = 4
    not_authorized = 5
    OTHERS = 6.
    do not forget to:
    commit work.
    [end abap coding]
    In the pbo of screen 200 (which is called in the 'change' function module') there is a 'suppress dialog' statement, which is executed under a certain condition. So if you set all control switches correctly and do a call function with export parameter x_no_dialog set to 'X' then the changes are processed without interruption of this screen.
    You have set the ucomm to 'save' and therefore the pai of screen 200 is processed correctly as well....

  • Duplicate qty with Different Price after discount column in Inventory Posit

    Hi,
    I am getting Inventory duplicate qty with Different Price after discount column in Inventory Positing List Reports   When I make A/R credit memo thru DI API.
    With regards,
    Venki .A

    hi
    you can just see the above given data there is a filed total_qty there are two rows showing 0 why it happens i dont understand because i wrote same as for others. all were showng what my input but when the prod_id repeats then it was not taken the total_qty it wll show me 0
    Please Guide
    Thanks And Regards
    Vikas Snghal

  • SQL Query find month/year and then calculate difference from start date

    Hi All,
    Assume I have a table with a column Start_Date. I like to know how we can build a query to so we can find the end of the month date based on the start_ date and then calculate the difference
    For example lets say we have a date 12/06/2014 and now based on this we should get the end of the month date which is 30/06/2014. Now we can get the difference which is 18 days.
    Thanks

    Hi Jaggy99,
    According to your description, you need to get the date difference between a given date and the last day of that month, right?
    In this case, please try the query below.
    SELECT GETDATE() AS [CURRENTDAY], DATEADD(DAY,-1,DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)) AS [LASTDAY],
    DATEDIFF(DAY, GETDATE (), DATEADD(DAY,-1,DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0))) AS [DIFFERENCE]
    Regards,
    Charlie Liao
    TechNet Community Support

  • Discount Base Amount

    Good day all
    When I do postings via FB01 the discount base amount gets calculated automatically, which is correct. (Post key 40 and 31, Doc Type AB).
    When payroll does their postings to FI, to the vendor account, the discount base amount does not get calculated at all (using the same posting keys and doc type).
    Where do I fix this and how?
    I will really appreciate all your help on this.
    Kind Regards
    Louise.

    Hi Ashok
    Thank you very much for your prompt reply.
    Let me try to explain. Payroll deducts amounts from employees, ex. housing, garnishee's etc. Those deducted amounts are send to FI to the relevant Vendor account. AP will then pay the vendor one global amount for all the amounts deducted from the different employees.
    Ex. Empl 1 - deducts R50 for Attorney ABC (from payroll)
          Empl 2 - deducts R100 fro Attorney ABS (From payroll)
    Payroll executes program RPCIPE00 that creates one document in FI.
    CT's Attorney ABC and DT's the payroll clearing account. FI-AP will then pay Attorney ABC via F110 on behalf of the employees.
    Sometimes the business will have an agreement with these type of vendors to take a discount if paid early.
    Hope this helps.
    Louise.

  • Calculate base on gross amount calculation

    Dear forum,
    I would like to ask how does the system calculate the tax base on gross amount.
    Assuming the tax rate is 17% and the tax base amount is $1000.
    I do know that system will split the amount into 2 parts where the tax related account is 854.70 and the tax account is 145.30.
    The calculation is 1000/1.17 to get 854.70 but I still do not know why to get 1.17.
    Need advice.
    Thanks

    Hi Gengis,
    The system calculates by default the tax taking the invoice amount as gross amount. i.e. 1000 * 17/117 = 145.30 doller.
    However this setting can be changed to calculate the tax amount taking invoice amount as net amount in the below way:-
    1. For all users:-
                 Activate the tick "tax base in net value" in company code setting in transaction OBY6.
    2. For specific user:-
                Activate the tick "Calculate taxes on net amount" in transaction FB00 from that user login.
    Then the system will calculate the tax amount as 1000 * 17% = 170 doller.
    Let me know if you need any further help.
    Regards,
    Gaurav

  • Restriction of discount total amount

    Dear All expert,
    I meet a problem that with restriction for discount's total amount.
    I have two condtion type , one is for amout discount another one is for percent discount.
    After calculation, if the total discount's amount is greater than the sales price I need issue a error message.
    But I checked the limitation for condition , for percent It is only can check the percent limitation with  upper and lower limitation when user input the percent not the value after the calculation.
    The percent discount is after the amount discount.So I can not check it in amount discount.
    Do you have any suggestion ?

    Thanks for your reply.
    Do you mean issue a error in the routine of the calculation ?
    But we already try this way.After issue the error message, user can not go ahead.But He should has the chance to change something.

  • How to calculate Bill Discount, Letter of Credit, Deposits & Cheque amount!

    Hi,
    I have a requirement where in I have to develop a report to display bank balance chart with the following details in the output.They are :
    1. Posting Date
    2. Bill Discount (BD)
    3. Letter of Credit(LC)
    4. Cheque Amount may be cheque issued.
    5. Deposits.
    Above are the information which i have to display based on Posting Date range , Company Code and Bank Key present in the selection-screen.
    Below are my few observations:
    1. To retrieve the Bill Discount, I am first fetching the data from BKPF table by checking the document types 'DZ' ,'KZ', Company code and Posting Date Range. Then using document number,company code present in these entries along with Posting key = 39 and special GL indicator = 'W' retrieving the data like DMBTR,WRBTR from BSEG.
    2. Similarly for Letter of Credit amount retrieving the data in the same way as mentioned above except special GL indicator will be 'Y'.
    Now please correct me if my approach is wrong. Request you all to throw some light as I am Technical Consultant and humbly looking forward to all your help.
    Also, request to let me know the logic or process how one can calculate fourth point as well as Fifth point as mentioned above.
    I am just looking for flow of data/process flow/standard transactions through which I can see these above mentioned things which can help me in building the logic. At least a general approach to this will be appreciated highly.
    Regards,
    Raghavendra Kulkarni.
    Edited by: raghavendra kulkarni on Jul 8, 2010 2:31 PM

    Hi,
    I have a requirement where in I have to develop a report to display bank balance chart with the following details in the output.They are :
    1. Posting Date
    2. Bill Discount (BD)
    3. Letter of Credit(LC)
    4. Cheque Amount may be cheque issued.
    5. Deposits.
    Above are the information which i have to display based on Posting Date range , Company Code and Bank Key present in the selection-screen.
    Below are my few observations:
    1. To retrieve the Bill Discount, I am first fetching the data from BKPF table by checking the document types 'DZ' ,'KZ', Company code and Posting Date Range. Then using document number,company code present in these entries along with Posting key = 39 and special GL indicator = 'W' retrieving the data like DMBTR,WRBTR from BSEG.
    2. Similarly for Letter of Credit amount retrieving the data in the same way as mentioned above except special GL indicator will be 'Y'.
    Now please correct me if my approach is wrong. Request you all to throw some light as I am Technical Consultant and humbly looking forward to all your help.
    Also, request to let me know the logic or process how one can calculate fourth point as well as Fifth point as mentioned above.
    Edited by Raghavendra Kulkarni.
    I am just looking for flow of data/process flow/standard transactions through which I can see these above mentioned things which can help me in building the logic. At least a general approach to this will be appreciated highly.
    Regards,
    Raghavendra Kulkarni.

  • Error Message when delivery qty more then po qty in MV50AFZ1

    Hi
    Sap Gurus,
    I gt a requirement  that while creating deliveries in vl02n
    if delivery quantity greater then po qty it should through error
    but i have alredy done coding in mv50afz1 user exit its working fine. My problem is if delivery no is differnt for the po no.
    it is not giving error because delivery quantity is less for differnt deliveries .
    this is the code i have written,
    data : v_menge type ekpo-menge,
    Getting Quantity from ekpo Table
    select single menge
                  into v_menge from ekpo
                  where ebeln = lips-vgbel
                  and ebelp = lips-vgpos.
    if sy-subrc = 0.
    Cheking the Condition for Delivery Type
       if likp-lfart = 'ZGND' or likp-lfart = 'ZGNL' or likp-lfart = 'ZGNS'.
    Cheking Condition if Delivery Quntity More than Po Quantity
        if v_menge < lips-lfimg.
         message e002(zt) with 'Delivery Qty Cannot be Greater than PO Qty'.
        endif.
      endif.
    endif.
    this is checking for single delivery quantiry greater then po qty
    but if multiple deliveries it is not working.
    Please suggest me to write logic and coding chages.
    ravi n
    Edited by: Nekkannti Ravi Kumar on May 12, 2008 10:01 AM

    Hi,
    First u have to find all deliveries againegt PO Item (material). find out total deleviry qty + present delivery qty.
    than check with PO qty ..
    I think it will solve.............
    Gupta.......

  • How to calculate tax / discount amount on PO

    Hi,
    I have to calculate tax and discount on Purchase order and have add that to ekpo-netwr to get the actual amount. Can you please tell me how to do that?
    So far I have been taking the EKKO-KNUMV and going to KONV table and serach for records with that KNUMV. But here I am stuck.
    I can not understand (I mean I can not find the field to distinguish) which of the records is actually being used in the PO and has an amount (non-zero) against it, which I see in ME23N in "Condition" at header label.
    Reward Points Guaranteed.
    Regards,
    Anid

    Hi,
    Ya. Actually I need to know the Discount, Indiviual taxes (Like Freight tax etc) which we see the the "condition" tab of Header Data in ME23N. I have to make a total of them and subtract from (Sum of EKPO-NETWR ) to calculate the ACTUAL PRICE.

  • Trying to calculate value based on rounding up and then calculate date range excluding weekends..

    Hi
    I am creating a simple design studion project request form where the user can enter how many photographs need to be ordered. I am calling this field 'NumImages'. Then once the data is entered, another field (I am calling this NumDaysImage) will be calculated based on the fact that no more than 5 photographs can be shot per day. So, 1-5  photos = 1 day. 6-10 photos = 2 days. 11-15 photos = 3 days etc. I do not need to calculate part days, so 6 photos is the same as 10 i.e. 2 days.
    Once I have calcuated 'NumDaysImage', I then need to calculate an end date called 'DateDue'. The start date is entered by the user in the field 'DateStart'.
    I know this is not going to be easy, but how can I calculate 'DateDue' based on a Mon-Fri working week, and ideally excluding UK public holidays?
    Also on the form is a value 'NumDays' that is the number of days for designing the brochure for the photos. This value I have calculated already, but it will need to be added to 'NumDaysImage' to get a total number of production days that is then used to calculate 'DateDue'.
    Any help will be greatly appreciated. Thanks.

    JavaScript has the Math.ceil method which rounds up a number to the next integer if it is not an integer.
    Dates are more complicated calculation as the starting date needs to be converted to a number and then one can calculate the ending date and test that date to see if is a Sunday or Saturday. Do intervening weekends add to the number of days for processing.

  • I would like to create a web that gives users choices from drop down menu and it then calculates the results back to them and copy to me

    Hello I am a wedding planner and have decided to create new website.   I would like to have the user make choices of different items and have it calculate so that they can print it off.  Like an estimate of what costs would be to plan a wedding .  I will be giving them different selections to choose from  in drop down or radio selections .
    I was thinking much like a shopping cart but that seems too involved is there a simpler way.   Thank you for any help.

    Just based on your question I can tell that you're probably not experienced enough to develop something like a shopping cart. Hiring a web developer is the way to go, as previously said.

  • Stop new planned order when process order GR qty less then sales order qty

    Hi All,
    How should SAP be configured so that when a process order is GRu2019ed, the sales order requirement is fulfilled regardless of the quantity difference between the sales order and process order?
    The system behavior we are currently experiencing is MRP will generate another planned order for the fixed lot size if the GRu2019ed quantity is less than the sales order quantity.
    Additional background information:
                    Make to order scenario
                    Process industries
                    Batch control
                    Warehouse management
                    Fixed lot size
    Any comments or suggestion are welcome.
    Thanks.

    Brahmaji,
    Thanks for the reply.
    I agree that changing from FX to EX will produce a planned order for the quantity difference (SO qty less the GR qty).  So this would be an improvement to our present situation, but not quite what we are looking for.
    The system behavior we want is MRP to ignore the requirement for the difference, in other words, when the GR is done for the entire batch quantity, we won't be producing any addition product.  The sales order would be considered complete.

  • In A/P Service Invoice, a discount percent amount is automatically entered

    Hi all,
    I am stumped.  On a random basis (about 25% of time) a discount percent is appearing (not entered) in the field of a multi-line A/P Service invoice.  The percent amount appears to be random as well. The discount percent field is not visible and inactive in form settings.  What could be causing this?
    Thanks, Bill

    Hi,
    Please check the following scenario :
    One scenario is caused when the Total amount changed after system calculate it according to Unit Price.
    Check the following steps to reproduce this scenario,
    - open ap invoice and choose Services
    - choose an account and type Unit price, Total amount will be
      calculated automatillcay
    - change the total amount.
    - System will calculate the difference and leave it in Discount field.
      Not change the Price field.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

Maybe you are looking for

  • Why does namcap say I don't need stuff I definitely do need?

    I have developed some bash scripts using ffmpeg, imagemagick's convert, yad, and lots of other tools that I had to explicitly install, but namcap claims I don't need to list any of those dependencies. It's called silentcast and makes it easy to creat

  • Updating LIKP-ANZPK when goods receiving one line item of Inbound Delivery

    I am Goods Receipting a single inbound delivery line item via function module WS_DELIVERY_UPDATE. Once the line item, and associated Handling Unit, are received, I would like LIKP-ANZPK (number of packages) to be updated with a new total of HU's that

  • Intercompany Processing

    Hi Gurus, by trying to raise a sales order in the intercompany with the customer 100111  i created und with the sales area (2200/10/00) and Material 4176 I got the error message as No business area can be determined for Item 10. Could u help me solvi

  • Can/How do you save excel files to the cloud?

    How, if at all, can you save excel files to icloud?

  • Jars & library includes

    I could not find any other place to stick this thread, I am sure if it doesn't belong someone will move it. I was curious if there is a standard way or a "best practices" for including external jars into a project. For example I am using eclipse and