Very Simple Overtime Hours Calculation

I have no experience with JavaScript and need help with a calculation for a simple Acrobat time sheet.
I have a timesheet form that adds and populates a "Total Hours" box, and I would like to automatically populate a "Regular Hours" box and an "Overtime Hours" box (based on a standard 40 hours week).
ex: if "Total Hours" = 55, "Regular Hours" should read 40, "Overtime Hours" should read 15.
ex: if "Total Hours" = 30, "Regular Hours" should read 30, "Overtime Hours" should read 0.

Use this code as the custom calculation code of Regular Hours:
event.value = +this.getField("Total Hours").value > 40 ? 40 : +this.getField("Total Hours").value;
Use this code as the custom calculation code of Overtime Hours:
event.value = +this.getField("Total Hours").value > 40 ? (+this.getField("Total Hours").value - 40) : 0;

Similar Messages

  • Employee overtime hours calculation

    Hello everyone,
    I need some help with an ABAP code:
    Records coming in with Employee ID, Date and Worked hours along with some other fields. There will be multiple records with the same Employee id.
    I would like to have a count for all the hours for that particular employee and keep a track if it goes above 40 hours.
    I also need to keep a track of hours in a particular day to see if they are above 8 hours.
    Can you please help with this code?
    Thanks,
    Raj

    Hi Raj....
    As we are not having such a kind of data....
    I tried this with appending itab...
    check this code....
    data: begin of itab occurs 0,
          empid(4),
          whrs(2) type n,
          flag1,
          exday(2) type n,             <---to capture the extra working hours of the day
          flag2,
          exemp(2) type n,             <----to capture the extra working hours of the employee
          date like sy-datum,
          end of itab.
    data: sum(3) type n.
    itab-empid = '1111'.
    itab-date = sy-datum.
    itab-whrs = 10.
    append itab.
    clear itab.
    itab-empid = '1111'.
    itab-date = sy-datum.
    itab-whrs = 80.
    append itab.
    clear itab.
    itab-empid = '1111'.
    itab-date = sy-datum + 1.
    itab-whrs = 10.
    append itab.
    clear itab.
    itab-empid = '1112'.
    itab-date = sy-datum.
    itab-whrs = 10.
    append itab.
    clear itab.
    itab-empid = '1112'.
    itab-date = sy-datum + 1.
    itab-whrs = 2.
    append itab.
    clear itab.
    itab-empid = '1112'.
    itab-date = sy-datum + 1.
    itab-whrs = 10.
    append itab.
    clear itab.
    itab-empid = '1113'.
    itab-date = sy-datum + 1.
    itab-whrs = 10.
    append itab.
    clear itab.
    itab-empid = '1113'.
    itab-date = sy-datum + 2.
    itab-whrs = 7.
    append itab.
    clear itab.
    itab-empid = '1113'.
    itab-date = sy-datum + 1.
    itab-whrs = 8.
    append itab.
    clear itab.
    loop at itab.
      at end of date.
        if itab-whrs > 8.
          itab-flag1 = 'X'.
          itab-exday = ( itab-whrs - 8 ).
          modify itab.
          endif.
        sum.
        sum = sum + itab-whrs.
      endat.
      at end of empid.                         <-----change code to avoid stars due to end of ..event
        if sum > 80.
          itab-flag2 = 'X'.
          itab-exemp = sum - 80.
          modify itab.
          clear itab.
         endif.
       clear: sum.
       endat.
      endloop.
    loop at itab.
    write:/ itab-empid,
            itab-date,
            itab-whrs,
            itab-flag1,
            itab-exday,
            itab-flag2,
            itab-exemp.
    endloop.
    Thanks,
    Naveen.I

  • Very Simple Calc - must be stupid!

    Hi!I have a very simple calc to solve but haven't used Essbase for over a year so forgot most of what I'd learnt (which wasn't much!)Right this is what I want to calc using Period 7 as Actual month and Period 6 as previous month.Value Amount(P7) = (Temp Amount(P7) - Deferred(P7)) + Deferred(P6)I know very easy. Just cant remember what the command and have until tomorrow to sort it!Hope someone can help.Oh I was thinking....though not sure.Fix("P7")     "Value Amount" = (("P7"->"Temp Amount") - ("P7"->"Deferred Amount")) + ("P6"->"Deferred Amount");EndFix

    Try this FIX(p7)"Value Amount" = (("Temp Amount" - "Deferred Amount") + P6->"Deferred Amount");ENDFIXyou don't need the ->p7 because you are calculating for P7 in the fix.Regards,Corey BidmeadClarity [email protected]

  • [Q] simple page with calculations

    Hi everybody,
    i'm completly new to Oracle APEX and i tested some things with a very simple Applikation at first.
    I can view, edit, delete my data. I tested simple reporting with Diagrams. Everything is working fine.
    Now i thought about a simple Page with some Calculations. I want to select my Data through Comboboxes
    and then doing some simple calculations with a button press.
    Like..
    Selecting a Country -> showing me some values for that contry.. (sales, whatever) -> entering 5% in a textbox
    ->pressing calculate -> and its showing me the result on the screen
    Now I'm completly lost on "How to start"... Is this even possible? I dont want a complete walkthrough..
    Maybe someone can give me just a hint "How to start"..
    Greetings

    Consider placing a LOV to select Country codes and a Text item to capture your percentage within your Report region.
    Then your code would mimic this code where p1_letter would be your Text item and p1_state would be your LOV.
    SELECT a.state_name
      FROM demo_states a
    WHERE     a.state_name LIKE '%' || UPPER (:p1_letter) || '%'
           AND a.st LIKE '%' || UPPER (:p1_state) || '%'Jeff

  • Exclude Holiday hours from overtime hours and add into regular hours

    In our current scenario any holiday hours are included in Overtime hours. We want to exclude these holiday hours from overtime hours
    Two examples:
    In one week an employee works 35 regular hours, with 8 holiday hours, for a total of 43 hours. Currently, the employee would get 40 hours of straight time, with 3 hours of OT. The change required is that it should have 43 hours of straight time, with no OT.
    Another example - In one week an employee submits 42 hours of time, with 8 holiday hours for a total of 50 hours. Currently, the employee would get 40 hours of straight time, with 10 hours of OT. With the change, the employee would receive 48 hours of straight time, with 2 hours of OT.
    In summary any holiday hours should be included into regular hours not in Overtime hours.
    Which setup changes are required to achive this functionalty?

    You can exclude the holiday hours from the OT calculation by excluding it from the earning group setup.
    --Shiv                                                                                                                                                                                                                                   

  • Urgent: Can Overtime hours be directly charged to a WBS, Project etc.

    Dear Team:
    Can Overtime hours be directly charged to a WBS, Project etc.
    Let me have a Business Solution as well as the SAP solution to do the same requirement.
    For example:
    If an employee has worked for a Project - Instrumentation for 8 hours + 4 hours as overtime. The total 12 hours to be charged to Instrumentation Project.
    Currently we are following as 8 hours are charged directly to the Project using Project Systems Data Entry Profile and 4 hours overtime using HR Data Entry Profile. These overtime hours are not getting directly charged to the Project but these are getting paid.
    How the above 4 hours of overtime be charged against a project as well as to be paid as overtime. Please assist.
    Regards
    Mallikarjun P
    [email protected]

    I didn't get you. Please could you explain me clearly.
    Now my scenario is as follows:
    If an employee has worked for a project he would be recording his man hours using the Project Systems Profile. For example he has worked on 24.03.2008 for 10 hours for an X project. He books the 10 hours in the project, but in this case 2 hours is overtime to be paid, so he goes to the HR Data entry profile and books the 2 hours as overtime for date 24.03.2008. These 2 hours are recorded in infotype 2002 and payment is made as per the calculation.
    10 hours which went to Project Systems will be based on some fixed amount per hour as per the settings. But these 2 hours cost which was paid as overtime in HR should be reflected in the project instead of the normal cost which was set in PS.
    More clear:
    Project Systems - 1 hour rate is Rs.30.
    Human Resources - 1 hour overtime is Rs.100.
    If 10 hours worked in Project, 8 hours * 30 = Rs.240 charged to a project.
    But 2 hours overtime = 2  hours * 100 = Rs.200 should be charged to the Project and also should be paid as overtime.
    Please update on the same.
    Regards
    Mallikarjun P
    Edited by: Patlolla Mallikarjun on Apr 2, 2008 11:58 AM

  • How can i calculate overtime hours with PCR?

    hi all,
    i was wandering, can i calculate overtime hours in this case?
    example my DWS for this day is 08.00 - 16.00
    i do early overtime from 06.00 - 08.00, and after my working hours is finished, i do late overtime from 16.00 - 19.00
    (in TIP it is separated in 2 rows)
    how can i calculate my total overtime with pcr? i want to use the total for another calculation..
    06.00 - 08.00 : 2 hours
    16.00 - 19.00 : 3 hours
    +
            total      : 5 hours.
    thx all..

    ZPRN    DVARSTPRSNT
    N      COLOP*
    Y     DOUTTPORIGS
    Y E  HRS=0     HRS=PNUM  ADDDB9066 COLOP*
    Y *  COLOP*
    THE ZPRN PCR WILL GET THE TOTAL NUMBER WORKING HRS IN TIME TYPE 9066
    Now we will write a pcr to get overtime details
          DVARSTDPRCL
    *    DVARSTHOLCL
    * 1  D HRS=D9066  HRS-S HRS?0
    * 1 * ADDDB9067
    * 1 < COLOP*
    0 *
    NOW THIS PCR WILL BRING THE OVERTIME
    BASED ON YOUR DAILY WORK SCHEDULES U NEED TO CHANGE VARSTDPRCL NOW MY RULES WILL WORK FOR ALL THE SHIFTS OTHER THAN WEEKLY OFFS
    REGARDS,
    RAJA SEKHAR.

  • My problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for example i have gone into options and set sav

    ''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/986549 /questions/986549]''
    my problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for example i have gone into options and set save downloads to my e drive....but still firefox keeps saving them to my c drive....i have 4 internal hard drives in my rig....and have tried saving downloads to them all.......why this is happening i cant understand....i have tried lots of suggestions....and have re-installed firefox multiple times

    hello, there's a general regression in firefox 27 that won't allow files to download directly into a root drive. please try to create a subfolder (like ''E:\Downloads'') and set this as default location for downloads...
    also see [https://bugzilla.mozilla.org/show_bug.cgi?id=958899 bug #958899].

  • Problem with very simple 2 threads java application

    Hi,
    As fa as i'm concerned this is a thread licecycle:
    1. thread created: it is dead.
    2. thread started: it is now alive.
    3. thread executes its run method: it is alive during this method.
    4. after thread finishes its run method: it is dead.
    No I have simple JUnit code:
    public void testThreads() throws Exception {
    WorkTest work = new WorkTest() {
    public void release() {
    // TODO Auto-generated method stub
    public void run() {
    for (int i=0;i<1000;i++){
    log.debug(i+":11111111111");
    //System.out.println(i+":11111111111");
    WorkTest work2 = new WorkTest() {
    public void release() {
    // TODO Auto-generated method stub
    public void run() {
    for (int i=0;i<1000;i++){
    log.debug(i+":22222222222");
    Thread workerThread = new Thread(work);
    Thread workerThread2 = new Thread(work2);
    workerThread.start();
    //workerThread.join();
    workerThread2.start();
    //workerThread2.join();
    And
    public interface WorkTest extends Runnable {
    public abstract void release();
    And that's it..
    On the console I see 999 iterations of both threads only if i uncomment
    //workerThread.join();
    //workerThread2.join();
    In other case I see random number of iterations - JUNIT finishes and Thread1 made 54 and Thread2 233 iterations - the numbers are different every time i start the JUnit..
    What I want? Not to wait until the first one finishes - I want them to start at the same time and they must FINISH their tasks...
    Please help me asap :(

    This is very simple... Look at your code:
    workerThread.start();
    workerThread.join();
    workerThread2.start();
    workerThread2.join();What are you doing here? You start the first thread, then you call join(), which waits until it finishes. Then after it's finished, you start the second thread and wait until it finishes. You should simply do this:
    workerThread.start();
    workerThread2.start();
    workerThread.join();
    workerThread2.join();I.e., you start the 2 threads and then you wait (first for the first one, then for the second one).

  • Problem With Deploying a very simple Servlet

    HELP REQUIRED:
    Hi,
    I'm including code of a very simple Servlet application (I shd not call it an application):
    index.html
    ==========
    <html><body bgcolor="#FFFFFF">
         <head>
         <title> Rajeev Asthana </title>
    <form action = "/HelloWorldApp/HelloWorld" method = "POST" >
    Please press Submit
    <input type = "submit" value = "Press Me!">
    </form>
    </body></html>
    HelloWorld.java
    ===============
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld extends HttpServlet {
         public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
              throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("<html><body bgcolor=\"#FFFFFF\">");
              out.println("<p>Hello World!</p>");
              out.println("</body></html>");
              out.close();
    web.xml
    ========
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>HelloWorldApp</display-name>
    <servlet>
    <display-name>HelloWorld</display-name>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    </web-app>
    sun-web.xml
    ===========
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.0 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-0.dtd">
    <sun-web-app xmlns="http://java.sun.com/xml/ns/j2ee">
    <context-root>/HelloWorldApp</context-root>
    <session-config>
    <session-manager persistence-type="memory">
    <manager-properties/>
    <store-properties/>
    </session-manager>
    <session-properties/>
    <cookie-properties/>
    </session-config>
    <cache enabled="false" max-entries="4096" timeout-in-seconds="30">
    <default-helper/>
    </cache>
    <class-loader delegate="true"/>
    <jsp-config/>
    </sun-web-app>
    I have deployed it in following directory structure:
    C:\Sun\AppServer\domains\domain1\applications\j2ee-modules\HelloWorldApp\
    |
    |
    |               |               |               |
    |               |               |               |
    META-INF          WEB-INF          HelloWorld.java          index.html
                   |
                   |
              |          |          |          |
              |          |          |          |
         classes          sun-web.xml     web.xml          sun-j2ee-ri-project
         |
         |
         HelloWorld.class
    While generating HelloWorldApp.war (which is the war file for this app), I specifies /HelloWorldApp as context root (sun specific).
    Now, when I deployed it thru Admin Tool and then clicked on "Launch", it displays a page with :
    Please press Submit Press Me!
    But when I click the button "Press Me!", it says:
    "The requested resource (/HelloWorldApp/HelloWorld) is not available."
    What should I do to correct the problem?
    Thanks in advance.
         

    Yes, you need to add a servlet -mapping element and adjust your form to submit to the appropriate URL mapping.
    <servlet-mapping>
    <servlet-name>HelloWorldServlet</servlet-name>
    <url-pattern>/servlet/Hello</url-pattern>
    </servlet-mapping>

  • I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.

    I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.

    Why do you need a expensive MacBook Pro?
    Your attending high school and unless everyone else is rich also your likely going to be a target by the more poorer students for theft or damage to the machine.
    You could keep it home, but if you need it for class then your exposed again.
    Also at that age your not very careful yet, a MacBook Pro is a expensive and easily damaged machine.
    Unless your made of money and so are others at your school, I would recommned a low profile, just does the job cheap Windows PC.
    If it dies, gets lost, stolen or damaged because of your inexperince handling senstivie electronics then it's no big deal.
    You can buy a Mac later on when your sure you have a need for it, currently there isn't much advantage of owning a Mac compared to a PC, they do just about the same things now, one just looks prettier than the other.
    Since 95% of the world uses Windows PC's your going to have to install Windows on the Mac in order to keep your skills up there or be unemployed, so it's a extra headache and expense.
    good luck

  • Very simple EJB 3.0 MDB but I get NullPointerException

    I tried to create a very simple EJB 3.0 Message Driven Bean in JDeveloper 10.1.3.2 as follows:
    Message Driven Bean Class:
    import javax.ejb.MessageDriven;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    @MessageDriven(mappedName="MDBQueue")
    public class MDB implements MessageListener {
    public void onMessage(Message message) {
    System.out.println("Got message!");
    Application Client:
    import javax.annotation.Resource;
    import javax.jms.*;
    public class MDBAppClient {
    @Resource(mappedName="MDBQueueConnectionFactory")
    private static QueueConnectionFactory queueCF;
    @Resource(mappedName="MDBQueue")
    private static Queue mdbQueue;
    public static void main(String args[]) {
    try {
    QueueConnection queueCon = queueCF.createQueueConnection();
    QueueSession queueSession = queueCon.createQueueSession
    (false, Session.AUTO_ACKNOWLEDGE);
    QueueSender queueSender = queueSession.createSender(null);
    TextMessage msg = queueSession.createTextMessage("hello");
    queueSender.send(mdbQueue, msg);
    System.out.println("Sent message to MDB");
    queueCon.close();
    } catch(Exception e) {
    e.printStackTrace();
    But I get the following error:
    java.lang.NullPointerException
         at model.MDBAppClient.main(MDBAppClient.java:17)
    I read similar problem in the this thread:
    Re: message driven bean on ejb 3.0 does not work
    some one said that the version in ejb-jar.xml must be changed from 2.1 to 3.0
    but in this case there is no ejb-jar.xml.
    ( I have other cases with ejb-jar.xml file but I can't change the version in ejb-jar.xml)
    the version in web.xml is 2.4 but it not accept any value except 2.4 and an error occur when I tried to change it to 3.0
    please can you tell me why I get NullPointerException and how can I allow EJB 3.0 MDB and JMS to work in JDeveloper

    Note that you can't run MDBs in the embedded OC4J in JDeveloper - try deploying to a stand-alone install of OC4J and see if it works there.

  • I want to  download Mavericks on my iMac.  I presently have 10.6.8. Sadly I am a total klux when downloading and need very simple advice please.

    I want to upgrade from O S 10.6.8 but am a total klux when downloading.  Instructions have to be very simple.  Thanks a lot.

    Check to make sure your applications are compatible. PowerPC applications are no longer supported after 10.6.      
    Application Compatibility
    Applications Compatibility (2)

  • Need to get the overtime hours worked for Report

    Dear Experts,
    We have configured Overtime for client and it is working fine.
    But for custom report development we need to get the overtime hours worked.
    We have searched in B2 cluster and not able to identify exact overtime table.
    Request your suggestionsu2026u2026..

    Hi,
    after time elavualtion use t code PT66,  in this t.code double click on the each month(period) then you can get the internal table like ZES, SALDO, ZKO. again double click on the each internal table, you can get the information through the time types.  Like , now you want the overtime hours, 0903, 0904 with this time types you can get the each employee no. of. overtime hours.
    ZL, ZES, SALDO, TIP entries are internal table , you could not get any results from this table with using se11, se16.
    With PT_BAL00 with this report also we can get the overtime hours with the help of time events.
    Good luck
    Devi

  • Daily working hours calculation but Half an hour flexi before start of planned time & shortfall hours calculation

    Dear All,
    I want to calculate daily working hours but Half an hour flexi before start of planned time & shortfall hours calculation if a person didn't completed 9 hours job.
    We have different types of DWS, PWS & WSR for different PS/PSA & EG/ESG groupings.
    We have a requirement for Executives/Officers (E0-E8/ S1-S2) for only one PSA (1100) for only one DWS(GFLX). In this requirement I want to calculate daily working hours but Half an hour flexi before start of planned time & shortfall hours calculation if a person didn't completed 9 hours job.
    Please see the requirement and my configured DWS and PCR's in detail with example and suggest me the solution:-
    Overview
    I want to calculate (Please take the reference from DWS screenshot)
    daily working hours, but starting from first Begin Tolerance Time
    Shortfall of hours if 9 hours not completed, but again starting from first Begin Tolerance Time, although employee has come before Begin Tolerance Time
    I've configured one DWS as below,
    Requirement:-
    The planned shift timings is 9:30 - 18:30. Employees should work and complete 9 hrs in a day, but this 9 hours should be counted only from 9:00 (i.e. Begin tolerance time). It means. In time should not consider before 9:00.
    1. Suppose 1st day employee punch In time is 9:00 then he has to work up to 18:00, then only 9 hours of working will be completed & no shortfall will be calculated.
    In above case, if Out time is 17:00 then shortfall will be calculated 1.0 hours, because his working hours will be counted 8 hrs only.
    2. Suppose 2nd day employee punch In time is 9:45 then he has to work up to 18:45, then only 9 hours of working will be completed & no shortfall will be calculated.
    In above case, if Out time is 18:00 then shortfall will be calculated 0.75 hours, because his working hours will be counted 8.25 hrs only.
    3. Suppose 3rd day employee punch In time is 8:30 then he has to work up to 18:00, then only 9 hours of working will be completed & no shortfall will be calculated. (In between 9:00 - 18:00 ). Here In time is 8:30 but system should consider and count from 9:00.
    In above case, if Out time is 17:30 then shortfall will be calculated 0.5 hours, although he has worked 9 hrs.
    4. Suppose 4th day employee punch In time is 10:11 then he will be marked as Late Come(as per DWS) and then he has to work up to 19:11, then only no shortfall will be calculated, because he completed 9 hours.
    Now the below PCR is calculating Daily Working Hours,
    Now the below PCR is calculating Late Coming Hours,
    Overview
    I know that use of begin tolerance time is different in from my requirement. Please guide me if this DWS configuration will not work.
    As of now system is able to calculate Daily Working Hours (but not from the begin tolerance time), Late coming days and Late coming hours, but shortfall is not getting calculate properly.
    Please give me the idea how to write PCR for these requirement, I know that my ZDHR PCR (Daily Working Hours) needs to change or replace to fulfill this requirements.
    If you want any other details please let me know.
    Best Regards,
    Deepak

    Hi Sankarsan,
    After changing the function PTIP and I used GEN in PAR2, because in PAR3 error was coming.
    After the changes PCR is processing as below for three different IN time :
    1. when IN time is 8:45
    and in this case, ZES table No Time type is showing which is wrong because he worked from 8:45 to 18:30 it means 9:30 hours (calculation should start from 9:00 am).
    2. when IN time is 9:15
    and in this case, ZES table Time type 9002 is showing 9.25 hours which is correct because he worked 9.25 hours.
    3. when IN time is 10:30
    and in this case, ZES table Time type 9003 is showing 9.00 hours which is wrong because he worked only 8 hours.
    Pls suggest.
    Best Regards,
    Deepak

Maybe you are looking for