473,808 Members | 2,775 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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*******@SPAMh otmail.com
"It's not IT, it's IS
Nov 13 '05 #1
5 2121
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*******@SPAMh otmail.com
"It's not IT, it's IS"

"Chuck Grimsby" <c.*******@worl dnet.att.net.in valid> wrote in message
news:ed******** *************** *********@4ax.c om...
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*******@SPAMh otmail.com
"It's not IT, it's IS"

"Chuck Grimsby" <c.*******@worl dnet.att.net.in valid> wrote in message
news:ed******** *************** *********@4ax.c om...
On Tue, 26 Apr 2005 21:17:13 -0400, "Alan Webb"
<kn*******@hotS PAMmail.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*******@SPAMh otmail.com
"It's not IT, it's IS"

"Chuck Grimsby" <c.*******@worl dnet.att.net.in valid> wrote in message
news:ed******** *************** *********@4ax.c om...
On Tue, 26 Apr 2005 21:17:13 -0400, "Alan Webb"
<kn*******@hotS PAMmail.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
overcomplicat e 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*******@SPAMh otmail.com
"It's not IT, it's IS
"Alan Webb" <kn*******@hotS PAMmail.com> wrote in message
news:fN******** ************@co mcast.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*******@SPAMh otmail.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*******@SPAMh otmail.com
"It's not IT, it's IS
"Chuck Grimsby" <c.*******@worl dnet.att.net.in valid> wrote in message
news:gr******** *************** *********@4ax.c om...

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*******@hotS PAMmail.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
2966
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 6 so I'm not doing the division right, any tips?
5
3653
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 that? I've tried the obvious things and haven't gotten very far. I have a time tuple that was created like this: aDate = '19920228' x = time.strptime(aDate,"%Y%m%d")
6
12956
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 here put me straight on the following: I had a look at the time() function came across this: "To clarify, it seems this function returns the time of the computer's clock and does not do any timezone adjustments to return GMT, so you are...
3
3160
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 tested timer functions capabilities with a short script: import time import os
6
2857
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 across the country. txtRaceTime will always be set to Central Time regardless of where we are in the US. At first I tried ‘Now() – “xx:xx:xx” but that produced an error. Anyway as we approach the east coast the ‘minus’ would need to be a...
3
2726
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 me and write in easier terms I would be very gratefull to all you access wizards! Here is my problem. I have a table with maybe 10 fields, It is used to imput information taken over the phone to solve patient problems in our Spanish...
3
2036
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 to be able to do comparisons on them.
1
14606
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 = '2007-03-13T15:00:00Z' I want to convert it to my local time. start_time = time.mktime(time.strptime(start_time, '%Y-%m-%dT%H:%M:
2
19589
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' *********************** Starting new log output
9
8306
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 following to try to determine which. import time # Determine if time.time is better than time.clock # The one with better resolution should be lower.
0
10631
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.