Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truck Pay per day to calculate after all time entry is in

Status
Not open for further replies.

bailey11

Technical User
Jan 18, 2005
103
US
We enter time for each employee to multiple cost codes and projects.

We need to be able to have a function say that after all time entry for multiple emplyees is made(button that the user can click after they are done with time entry for that day), go do the following......

If COR (change order) = -1 and Phase=99 and units (for the individual entry) >=10, delete all records for this employee for this day and replace them with one record.

If COR = 0 take the individual entries, divide their units by the total units for this employee for this day and multiply it by 10 and create the record.

I am at a loss how to do this. I tried the code on the time entry form, but it looks at each entry instead of the all the entries for an employee as a group.

Help!!!!!
 
Can you provide a bit more detail?

[blue]If COR (change order) = -1 and Phase=99 and units (for the individual entry) >=10, delete all records for this employee for this day and replace them with one record.[/blue]

- Are COR, Phase and Units variables in the program? Fields in a table? Something that needs to be computed?
- Replace them with one record that contains what exactly?

[blue]If COR = 0 take the individual entries, divide their units by the total units for this employee for this day and multiply it by 10 and create the record.[/blue]

- Do we also delete the existing records when we create the new one?


Without some notion of how information is stored in your tables there's not much chance that we can recommend a process that's at all related to your actual situation.
 
COR, Phase and Units are fields created in the time entry table by the user as they enter time for each employee. COR is a check box that represents that this entry goes to a change order. Phase is a code we use and units are the hours the employee worked on this phase-COR combination.

THe only time I want to replace all fields for truckpay is if the employee has 10 or more hours on an entry that is a phase 99 and COR Yes, becuase this is then billable.

Otherwise I want to take the multiple entries for the employees and divide the individual units (hours worked) on each phase by the total hours worked for that day for that employee and multiply it by 10 (10 is the maximum number of hours for truckpay per day).

Employee, COR, Phase, Units
1,Yes,990002,11
1,No,980001,3

In this case the employee had 15 hours this day, but that wouldn't matter because more than 10 went to the COR Yes Phase 99 job and so I need to create a single entry for truckpay with the 990002 phase.


Employee, COR, Phase, Units
1,Yes,990002,6
1,No,011900,3
1,No,011900,2

In this case, I need 6 units truck to go to the 99 COR Yes job. And 4 to go to 011900 (1900 is for all units that are not COR=Yes)

Employee, COR, Phase, Units
1,Yes,990002,6
1,No,011900,3
1,Yes,010004,2

In this case, I need 6 units truck to go to the 99 COR Yes job. And 3/5*4 (3 units/totalunits for today 5 (after the 6 are gone)times (the remaining units up to 10) 4 to go to 011900 and 2/5*4 to go to 010004 (because COR=Yes here)

Otherwise, if COR=No in all entries, then units per entry / total units for the day * 10

Confusing enough?
 
Any luck on this? I tried a few other things I thought of this weekend, make table and such but I still can't get it to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top