Hiroyuki Tamura
asked on
filemaker script with overtime and calcuration
do you know how to make this script?
40 hours max per week regular work hour and if it get more, it becomes overtime.
lunch hour deduct from overtime first and if there is no overtime, deduct from regular time.
i can't figure out how to make lunch hour deduction "if script" like this case;
if overtime is 3 hour and lunch time is 4 hour, they deduct 3 hours from overtime and 1hour from regular time..
please help me.
40 hours max per week regular work hour and if it get more, it becomes overtime.
lunch hour deduct from overtime first and if there is no overtime, deduct from regular time.
i can't figure out how to make lunch hour deduction "if script" like this case;
if overtime is 3 hour and lunch time is 4 hour, they deduct 3 hours from overtime and 1hour from regular time..
please help me.
ASKER
thank you, JoJohn2004!
i have some problem;
case 1
HoursWorked: 60hours, Lunch 4 Hours
Regular 40hours, Overtime 20hours - Lunch 4 Hours = CalcOvertime 16hours
case 2
HoursWorked: 44hours, Lunch 4 Hours
Regular 40hours, Overtime 4hours - Lunch 4 Hours = CalcOvertime 0hours
case 3
HoursWorked: 43hours, Lunch 4 Hours
Regular 40hours, Overtime 3hours - Lunch 4 Hours = CalcOvertime 0hours (even -1 hours)
CalcRegular 39hours (they deduct from regular)
it's little weird but they deduct from overtime and Lunchtime same unit...
i have some problem;
case 1
HoursWorked: 60hours, Lunch 4 Hours
Regular 40hours, Overtime 20hours - Lunch 4 Hours = CalcOvertime 16hours
case 2
HoursWorked: 44hours, Lunch 4 Hours
Regular 40hours, Overtime 4hours - Lunch 4 Hours = CalcOvertime 0hours
case 3
HoursWorked: 43hours, Lunch 4 Hours
Regular 40hours, Overtime 3hours - Lunch 4 Hours = CalcOvertime 0hours (even -1 hours)
CalcRegular 39hours (they deduct from regular)
it's little weird but they deduct from overtime and Lunchtime same unit...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank u
Create 2 number fields, HoursWorked and LunchTime
Make a Calculation field called CalcHoursWorked which results in a number:
CalcHoursWorked =
Let(
[
RegTime = If(HoursWorked>40;40;Hours
Overtime = If(HoursWorked>40;HoursWor
CalcTotalTime = regTime +Overtime*1.5
];
CalcTotalTime-LunchTime
)
Make 2 fields called StraightTime and OverTime which are calculations that results in numbers:
StraightTime = If(CalcHoursWorked>40;40;C
Overtime = If(CalcHoursWorked>40;Calc
If you do not have to calculate the effictive hours that a person has to be paid for before subtracting the lunch, you can just subtract the lunch from the hours worked instead of going through all these steps but I don't think that is what you were asking.