1 Reply Latest reply on Apr 17, 2012 6:11 AM by axler82

    formcalc script help!

    axler82

      My timesheet is a form created in livecycle es and the form looks similar to the one below my problem is in formcalc I cant figure out a way to calculate the time correctly for me what I want it to do is if I enter 12 in the sunday block 10 should then be added to straight time and 2 should be added to overtime and then if I add 12 in the monday block Straight time shoud then be 20 and overtime would then be 4 and it would continue to add the overtime of any value over 10 entered in any of the other blocks as well. and

      basically any day worked over 10 is overtime and the rest is straight time even I did not work a full 40 any help would be appreciated Thanks!

       

       

       

      sunmontuewedthufrisatstraight timeovertime
        • 1. Re: formcalc script help!
          axler82 Level 1

          I don't know if this helps but here is the script I wrote and it will work in wksunhrs1 if i put in 12 it puts 10 in wktlst1 and 2 in wktlrh1 but if I put 12 in the rest of the objects like wtlmonhrs it does not change wktlrh1 or wkmonhrs1 I need it to keep adding what it moves to wktlrh1 and wktlrh1 but it wont. any information would be very helpful Thanks!

           

           

           

           

          topmostSubform.Page1.WKTLST1::calculate - (FormCalc, client)

          var

          wktlst1 = WKSUNHRS1+WKMONHRS1+WKTUEHRS1+WKWEDHRS1+WKTHUHRS1+WKFRIHRS1

          if (WKSUNHRS1 > 10) then

          WKTLST1= 10

          WKTLRH1= WKSUNHRS1 - 10

          endif

          if (WKMONHRS1 > 10) then

          WKTLST1= 10

          WKTLRH1= WKMONHRS1 - 10

          endif

          if (WKTUEHRS1 > 10) then

          WKTLST1= 10

          WKTLRH1=WKTUEHRS1 - 10

          endif

          if (WKWEDHRS1 > 10) then

          WKTLST1= 10

          WKTLRH1=WKWEDHRS1 - 10

          endif

          if (WKTHUHRS1 > 10)

          then

          WKTLST1= 10

          WKTLRH1=WKTHUHRS1 - 10

          endif

          if (WKFRIHRS1 > 10) then

          WKTLST1= 10

          WKTLRH1=WKFRIHRS1 - 10

          endif