473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Time-keeping rules

Guys,
I get this:

Regular Hours are any hours less than the number of hours that can be worked
before the hours begin to be counted as overtime in the period.

Overtime Hours are any hours more than the number of hours that can be
worked as regular hours in the period.

Doubletime is similar to overtime but at a higher limit.

If we are doing this on a per day period then anything between eight and
twelve hours is overtime and anything more than twelve hours is doubletime.
This one is easy and I have three functions that work together to give me
the numbers I want for counting regular, overtime and double-time per day.

And if we are counting by week it's still similar: regular hours are
anything less than the regular hour limit.

It's overtime and doubletime per week that is frying my brain. I tend to
overcomplicate things and at the moment I have a contorted If End if
construct that looks at four break points. The first is the regular hours
limit, the second is regular hours limit plus eight, the third is the
overtime limit less eight and the fourth is the overtime limit. I have
different arithmetic depending on how many hours that week and where that
total falls in my four break points. Is there a simplier logic & companion
arithmetic?

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS
Nov 13 '05 #1
5 2097
Chuck,
I built a table called PROJECT that contains attributes of each employee's
job. Since I've done contract work in the past I built it with the
assumption that an employee under the same employer could work on different
projects at different pay rates, compensation packages, etc. I include a
ParentProject column so I can run PaidTimeOff under a primary
project/employer and allow for changes in compensation over time.

My current idea is something like:

If WeekTotalHours >= RegLimit and WeekTotalHours < (RegLimit + 8) Then
'Some of this day's hours may be overtime.
OTHours = WeekTotalHours = RegLimit
ElseIf WeekTotalHours >= (RegLimit + 8) And WeekTotalHours < OTLimit Then
'Everything is overtime.
Else
'Nothing is overtime.
End If

This is in a class module as a Property Get statement called OTHours. The
hope was that the class would contain all the business rules and simplify
things for other programmers because you could just create an instance of
this class, give it the data it needs to figure all this out, and get back
the correct numbers. I was hoping to find a simpler, more elegant bit of
logic than my own so suggestions are still appreciated.
--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS"

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:ed********************************@4ax.com...
On Tue, 26 Apr 2005 21:17:13 -0400, "Alan Webb"

The last time that I did something like this, it was a convoluted mess.

Nov 13 '05 #2
Chuck,
To save myself the processor time needed to run this each time a user wants
it I have a trigger built in to the Hours data entry form which kicks off a
procedure to post the totals to a table. This way reports can be run
against the table and until my user comes up with a contorted request for a
view that supports their analyis--"Give me total hours for all employees
that have Aries as thier Moon Sign and the Sun was in Mercury or they have a
first name of Star and they earn more than 10% of scale but worked less than
full-time in quarter 3 of 1927"--the SQL needed is easier and consequently
faster.

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS"

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:ed********************************@4ax.com...
On Tue, 26 Apr 2005 21:17:13 -0400, "Alan Webb"
<kn*******@hotSPAMmail.com> wrote:
The solution was to separate the data-entry task from the calculation
task, and handle
each employee as a separate entity, "walking" the recordset(s) to do
each sum of period for each "employee", depending upon what "type" of
an employee they were.

Nov 13 '05 #3
Guys,
Once I get something I am happy with I'll post documentation on what I
decided. I was really hoping to have someone step up and tell me what the
typical best practice solution is. I get paid by my employer with payroll
software so at least one bunch of programmers has solved this in a way that
works. It would be nice to know what logic my boss' software uses.
--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS"

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:ed********************************@4ax.com...
On Tue, 26 Apr 2005 21:17:13 -0400, "Alan Webb"
<kn*******@hotSPAMmail.com> wrote:
Regular Hours are any hours less than the number of hours that can be
worked
before the hours begin to be counted as overtime in the period.
Overtime Hours are any hours more than the number of hours that can be
worked as regular hours in the period.
Doubletime is similar to overtime but at a higher limit.
If we are doing this on a per day period then anything between eight and
twelve hours is overtime and anything more than twelve hours is
doubletime.
This one is easy and I have three functions that work together to give me
the numbers I want for counting regular, overtime and double-time per day.
And if we are counting by week it's still similar: regular hours are
anything less than the regular hour limit.
It's overtime and doubletime per week that is frying my brain. I tend to
overcomplicate things and at the moment I have a contorted If End if
construct that looks at four break points. The first is the regular hours
limit, the second is regular hours limit plus eight, the third is the
overtime limit less eight and the fourth is the overtime limit. I have
different arithmetic depending on how many hours that week and where that
total falls in my four break points. Is there a simplier logic &
companion
arithmetic?


The last time that I did something like this, it was a convoluted
mess. I suspect that you're in the same situation. The solution was
to separate the data-entry task from the calculation task, and handle
each employee as a separate entity, "walking" the recordset(s) to do
each sum of period for each "employee", depending upon what "type" of
an employee they were.

--
(A)bort, (R)etry, (S)mack The Friggin Thing

Nov 13 '05 #4
Guys,
What I found to work in Excel was to keep a running total by week of the
number of hours worked. Then if the running total was between forty and
forty eight hours some of that day's hours were regular time and some were
overtime. Similarly, if the running total for that week was between sixty
and sixty-eight hours some of the day's hours were overtime and some were
doubletime. The only other cases I needed to worry about were hours that
fell below the threshold and hours that exceeded the threshold plus eight
hours. A running total less than forty hours and everthing was overtime. A
running total between forty-eight and sixty hours and everything is overtime
for that day. A running total that was more than sixty-eight hours and
everything is double-time. The rest of the possibilities all return zero in
my logic.
I have three business rules implemented in three Property Get statements
that contain the above logic. I gave up the idea of trying to run all this
each time the timesheet report is run and am keeping these numbers in a
table. My data entry form has an event which triggers a bit of VBA that
posts a new row to my totals table for each employee/project/day worked. On
the output side I use my results table to slice & dice the data to my
heart's content.
It works, it isn't perhaps the prettiest way to do this, but I am happy with
it for now. I still hope someone else out there knows what the accepted
best practice is.

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS
"Alan Webb" <kn*******@hotSPAMmail.com> wrote in message
news:fN********************@comcast.com...
Guys,
I get this:

Regular Hours are any hours less than the number of hours that can be
worked before the hours begin to be counted as overtime in the period.

Overtime Hours are any hours more than the number of hours that can be
worked as regular hours in the period.

Doubletime is similar to overtime but at a higher limit.

If we are doing this on a per day period then anything between eight and
twelve hours is overtime and anything more than twelve hours is
doubletime. This one is easy and I have three functions that work together
to give me the numbers I want for counting regular, overtime and
double-time per day.

And if we are counting by week it's still similar: regular hours are
anything less than the regular hour limit.

It's overtime and doubletime per week that is frying my brain. I tend to
overcomplicate things and at the moment I have a contorted If End if
construct that looks at four break points. The first is the regular hours
limit, the second is regular hours limit plus eight, the third is the
overtime limit less eight and the fourth is the overtime limit. I have
different arithmetic depending on how many hours that week and where that
total falls in my four break points. Is there a simplier logic &
companion arithmetic?

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS

Nov 13 '05 #5
Chuck,
Ok. I understand that. So I didn't build something thinking it would be
used to pay people with. Mostly I wanted it so I could track my hours and
get a feel for how much my next paycheck would be. Within the limited scope
of estimating my next paycheck it works well enough. I worked for a few
months with Again Technologies, who had a product that they marketed which
would do payroll for employees that were compensated with some sort of
variable pay. I am aware of the potential complexities. So, I punted and
built something that would work for me and not necessarily for a company.
Even with that limited scope it is taking me a while to debug my stuff and
get it working to my satisfaction.
--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS
"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:gr********************************@4ax.com...

Payroll software is interested, but it's almost never a "hard and
fast" set of rules. There are many, many variables, and (just so you
know) setting up "canned" payroll software can take _weeks_ of work to
implement. There are very, very few rules that translate from one
company to another.

Payroll is as unique a job path as just about any other form of
accounting, like Tax Accounting. In both cases, 1 + 1 doesn't always
= 2, or 11 for that matter. Too many other "hidden" variables apply.

On Wed, 27 Apr 2005 19:38:25 -0400, "Alan Webbed"
<kn*******@hotSPAMmail.com> wrote:
Once I get something I am happy with I'll post documentation on what I
decided. I was really hoping to have someone step up and tell me what the
typical best practice solution is. I get paid by my employer with payroll
software so at least one bunch of programmers has solved this in a way
that
works. It would be nice to know what logic my boss' software uses.

--
(A)bort, (R)etry, (S)mack The Friggin Thing

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
5
by: David Stockwell | last post by:
I'm sure this has been asked before, but I wasn't able to find it. First off I know u can't change a tuple but if I wanted to increment a time tuple by one day what is the standard method to do...
6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
3
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
6
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
3
by: cj | last post by:
If I want to check to see if it's after "11:36 pm" what would I write? I'm sure it's easy but I'm getting tired of having to work with dates and times. Sometimes I just want time or date. And...
1
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time =...
2
by: Roseanne | last post by:
We are experiencing very slow response time in our web app. We run IIS 6 - windows 2003. I ran iisstate. Here's what I got. Any ideas?? Opened log file 'F:\iisstate\output\IISState-812.log'...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.