tldm-universe/CMS/BP.CLOCK/MSD.TIME.PROOF.HOURS

773 lines
26 KiB
Plaintext
Raw Normal View History

2024-09-10 19:25:06 +00:00
* MSD.TIME.PROOF
*
* AUTHOR: SCOTT REDMOND
* DATE: 02/27/96
* PURPOSE: Report of clock users hours worked
*
*-------------------------------------------------------------------*
*
$INCLUDE GEN.COMMON
$INCLUDE USER
$INCLUDE SUPPORT.RECORD
$INCLUDE CLOCK.PAY.DATES
*
*-------------------------------------------------------------------*
*
OPEN 'USER' TO USER.FILE ELSE ABORT 201, 'USER'
OPEN 'PT' TO PT.FILE ELSE ABORT 201, 'PT'
OPEN 'CLOCKFILE' TO CLOCKFILE ELSE ABORT 201, 'CLOCKFILE'
OPEN 'CLOCK.GEN.KEYS' TO CLOCK.GEN.KEYS ELSE ABORT 201, 'CLOCK.GEN.KEYS'
OPEN 'CM' TO CM ELSE ABORT 201, 'CM'
OPEN 'HP.CONTROL' TO HP.CONTROL ELSE ABORT 201, 'HP.CONTROL'
OPEN 'CLOCK.PAY.DATES' TO CLOCK.PAY.DATES ELSE ABORT 201, 'CLOCK.PAY.DATES'
OPEN 'HP.CONTROL' TO HPC ELSE ABORT 201, 'HP.CONTROL'
OPEN 'LRTES' TO LRTES ELSE ABORT 201, 'FILE'
*-------------------------------------------------------------------*
*
USER.ADD='' ; USER.REC='' ; TODAY=DATE()
*
*-------------------------------------------------------------------*
10 *
CRT CS
HDG='MICAHTEK & IDM CLOCK PROOF REPORT (MANAGERS)'
HDL=(80 - LEN(HDG)) / 2
CRT @(0,0):CL:RV:STR(' ',80):ERV
CRT @(HDL,0):RV:HDG:ERV:
*
CRT @(8,2):CL:" This process prints a clockfile proof report to be reviewed"
CRT @(8,3):CL:" by Managers before the pay period is processed."
200 *--- enter beginning pay period date ---------------------------*
CRT @(0,22):CL:RV:" ENTER THE PAY PERIOD DATE FOR REPORT ":ERV:
CRT @(8,6):CL:RV:" PAY PERIOD DATE :":ERV:" ":
INPUT PAY.DATE,10
IF PAY.DATE='' OR PAY.DATE=PF3 THEN STOP
PAY.DATE=ICONV(PAY.DATE,'D')
IF PAY.DATE < 1 THEN GO 200
CRT @(39,6):CL:OCONV(PAY.DATE,'D2/')
*
FIRST.PERIOD=''
300 *
CRT @(8,6):CL:RV:" PAY PERIOD DATE :":ERV:" ":OCONV(PAY.DATE,'D2/')
350 *
*--- figure beginning and ending pay period date --------------------*
*
PERIOD=OCONV(PAY.DATE,'D2/') ;* default current period
PERIOD=PERIOD[7,2]:"/":PERIOD[1,2]
PERIOD.KEY=PERIOD[1,2]:PERIOD[4,2]
READ DATE.REC FROM CLOCK.PAY.DATES,PERIOD.KEY THEN
LOCATE(PAY.DATE,DATE.REC,CPD$PAY.DATE;PPD.FND) THEN
FIRST.DATE=DATE.REC<CPD$PERIOD.BEGIN,PPD.FND>
SECOND.DATE=DATE.REC<CPD$PERIOD.END,PPD.FND>
QUIT=''
END ELSE
QUIT=1
END
END ELSE
QUIT=1
END
IF QUIT THEN
CRT @(0,22):CL:BEEP:RV:" Verify pay date in MSD.PAY.DATES! <return> :":ERV:
INPUT ANY,9
STOP
END
*
375 *----- select users by department ----------------------------*
*
ALL.SW=''
CRT @(27,10):CL:RV:" 1 - SPECIAL ACCOUNTS ":ERV:
CRT @(27,11):CL:RV:" 2 - PHONE CENTER ":ERV:
CRT @(27,12):CL:RV:" 3 - WOF PROCESSING ":ERV:
CRT @(27,13):CL:RV:" 4 - WAREHOUSE ":ERV:
CRT @(27,14):CL:RV:" 5 - ADMIN. SUPPORT ":ERV:
CRT @(27,15):CL:RV:" 6 - SPECIAL ACCTS COM.":ERV:
CRT @(27,16):CL:RV:" 7 - OPERATIONS ":ERV:
CRT @(27,17):CL:RV:" 8 - ALL DEPARTMENTS ":ERV:
CRT @(0,22):CL:RV:" ENTER DEPARTMENT : ":ERV:
INPUT DEPT,9
IF DEPT='' OR DEPT=PF3 THEN RETURN
IF NUM(DEPT) ELSE GO 375
IF DEPT < 1 OR DEPT > 8 THEN GO 375
D.TABLE='' ; INDI.FLAG=''
BEGIN CASE
CASE DEPT='1'
D.TABLE='511'
CASE DEPT='2'
D.TABLE='800'
CASE DEPT='3'
D.TABLE='500':VM:'501':VM:'502':VM:'503':VM:'505':VM:'509':VM:'514':VM:'525'
CASE DEPT='4'
D.TABLE='506':VM:'507'
CASE DEPT='5'
D.TABLE='517'
CASE DEPT='6'
D.TABLE='520'
CASE DEPT='7'
D.TABLE='512'
CASE DEPT='8'
ALL.SW=1
END CASE
*
PAY.BEGIN=DATE.REC<CPD$PERIOD.BEGIN,PPD.FND>
ACTUAL.PAY.DATE=DATE.REC<CPD$PAY.DATE,PPD.FND>
*
CRT @(0,18):CR:
EXECUTE "EX PRINTER"
CRT @(0,4):CR:
2010 *--- display pay period data to screen --------------------*
*
CRT @(20,10):CL:RV:" PAY PERIOD DATE :":ERV:" ":OCONV(ACTUAL.PAY.DATE,'D')
CRT @(20,12):CL:RV:" PAY PERIOD BEGIN DATE :":ERV:" ":OCONV(PAY.BEGIN,'D')
PAY.END=DATE.REC<CPD$PERIOD.END,PPD.FND>
CRT @(20,14):CL:RV:" PAY PERIOD ENDING DATE:":ERV:" ":OCONV(PAY.END,'D')
*
CRT @(0,22):CL:RV:" ENTER 'B' TO BEGIN REPORT :":ERV:
INPUT BEGIN.ANS,5
IF BEGIN.ANS[1,1] # 'B' THEN STOP
IF PAY.END >= TODAY THEN
CRT @(0,22):CL:BEEP:RV:" ACTIVE PAY PERIOD! TRY AGAIN ON ":OCONV(PAY.END+1,'D'):" <return> :":ERV:
INPUT ANY,3
GO 10
END
*
FILE.KEY='INFO.WORK*':TIME()
OPEN FILE.KEY TO INFO.WORK ELSE
HUSH ON
EXECUTE "CREATE-FILE ":FILE.KEY:" 1 153,4"
HUSH OFF
OPEN FILE.KEY TO INFO.WORK ELSE ABORT 201, 'INFO.WORK'
END
CLEARFILE INFO.WORK
*
CRT @(0,22):CL:RV:" SELECTING FILE...PLEASE WAIT! ":ERV:
*
USER.ADD='' ; USER.REC='' ; TODAY=DATE() ; WT=0 ; FOUND=0
*
*---- determine week 1,2 & 3 for overtime calc -----------------*
INIT=''
LAST.DAY.WEEK.ONE =DATE.REC<CPD$WEEK.ONE.END,PPD.FND>
LAST.DAY.WEEK.TWO =DATE.REC<CPD$WEEK.TWO.END,PPD.FND>
LAST.DAY.WEEK.THREE=DATE.REC<CPD$WEEK.THREE.END,PPD.FND>
NUMBER.WEEKS =DATE.REC<CPD$NUM.WEEKS,PPD.FND>
2200 *---- process and accrue clockfile records-----------------*
*
*
EOF=0 ; T=0 ; FILE.ACCESS='CLOCK FILE'
SELECT CLOCKFILE
LOOP
READNEXT ID ELSE EOF=1
UNTIL EOF DO
T=T+1
IF REM(T,500)=0 THEN GOSUB 2900 ;* refresh totals
USER.KEY =OCONV(ID,'G0|1')
CLOCK.DATE=OCONV(ID,'G1|1')
IF CLOCK.DATE < PAY.BEGIN OR CLOCK.DATE > PAY.END THEN GO 2300
READ CLOCK.REC FROM CLOCKFILE,ID THEN
READ USR.REC FROM USER.FILE,USER.KEY THEN
IF USR.REC<UR$DEPT>='800' THEN ;* 800 employee?
EIGHT.EMP=1
END ELSE
EIGHT.EMP=''
END
*---- check for time clock employee only -------------*
IF USR.REC<UR$CLOCK.SYSTEM>='C' ELSE GO 2300
*
FOUND=FOUND+1
IF CLOCK.DATE <= LAST.DAY.WEEK.ONE THEN
WEEK.NUM=1
END
IF CLOCK.DATE > LAST.DAY.WEEK.ONE AND CLOCK.DATE <= LAST.DAY.WEEK.TWO THEN
WEEK.NUM=2
END
IF CLOCK.DATE > LAST.DAY.WEEK.TWO AND CLOCK.DATE <= LAST.DAY.WEEK.THREE THEN
WEEK.NUM=3
END
*----- initialize totals with each user, each day -----*
OUT.TIME=0 ; IN.TIME=0 ; DAILY.TIME=0
VAC.TOTAL=0 ; SICK.TOTAL=0 ; HOLIDAY.TOTAL=0
FUNERAL.TOTAL=0 ; JURY.TOTAL=0 ; WORKMANS.TOTAL=0
PERSONAL.TOTAL=0 ; BONUS.TOTAL=0 ; OTHER.TOTAL=0
WOF.TOTAL=0 ; EIGHT.TOTAL=0 ; IDM.TOTAL=0
*
TIMCT=DCOUNT(CLOCK.REC<1>,VM)
FOR TIM = 1 TO TIMCT ;* calc daily time
IF CLOCK.REC<2,TIM>='OFF' THEN
OUT.TIME=CLOCK.REC<1,TIM>
DAILY.TIME=DAILY.TIME+(OUT.TIME-IN.TIME)
PROJECT=OCONV(CLOCK.REC<2,TIM-1>,'G0-1')
IF PROJECT[1,3]='WOF' OR PROJECT[1,3]='800' THEN
IF PROJECT[1,3]='WOF' THEN
WOF.TOTAL=WOF.TOTAL+(OUT.TIME-IN.TIME)
END
IF PROJECT[1,3]='800' THEN
EIGHT.TOTAL=EIGHT.TOTAL+(OUT.TIME-IN.TIME)
END
END ELSE
IDM.TOTAL=IDM.TOTAL+(OUT.TIME-IN.TIME)
END
END ELSE
JOB=''
JOB=OCONV(CLOCK.REC<2,TIM>,'G1-1')
JOB.TWO=JOB[2,2]'L%3'
IF JOB[1,1]='V' THEN ;* compute vacation
VAC.TOTAL=VAC.TOTAL+JOB.TWO
END
IF JOB[1,1]='S' THEN ;* compute sick
SICK.TOTAL=SICK.TOTAL+JOB.TWO
END
IF JOB[1,1]='H' THEN ;* compute holiday
HOLIDAY.TOTAL=HOLIDAY.TOTAL+JOB.TWO
END
IF JOB[1,1]='P' THEN ;* personal
PERSONAL.TOTAL=PERSONAL.TOTAL+JOB.TWO
END
IF JOB[1,1]='F' THEN ;* funeral
FUNERAL.TOTAL=FUNERAL.TOTAL+JOB.TWO
END
IF JOB[1,1]='W' THEN ;* workmans comp.
WORKMANS.TOTAL=WORKMANS.TOTAL+JOB.TWO
END
IF JOB[1,1]='B' THEN ;* bonus day
BONUS.TOTAL=BONUS.TOTAL+JOB.TWO
END
IF JOB[1,1]='J' THEN ;* jury duty
JURY.TOTAL=JURY.TOTAL+JOB.TWO
END
IN.TIME=CLOCK.REC<1,TIM>
END
NEXT TIM
*---- convert daily time seconds to hours ---------*
DAILY.TIME =(DAILY.TIME/60)/60
DAILY.HOURS=INT(DAILY.TIME)
DAILY.DECI =OCONV(DAILY.TIME,'G1.1')[1,3]
TWO.DECI =DAILY.DECI[1,2]'L%2'
EXTRA.DECI =DAILY.DECI[3,1]
IF EXTRA.DECI >= 5 THEN
IF TWO.DECI=99 THEN
TWO.DECI='00'
DAILY.HOURS=DAILY.HOURS+1
END ELSE
TWO.DECI=TWO.DECI+1'R%2'
END
END ELSE
IF TWO.DECI=99 THEN
TWO.DECI='00'
DAILY.HOURS=DAILY.HOURS+1
END
END
OUTPUT.HOURS=DAILY.HOURS:TWO.DECI
READ INFO.REC FROM INFO.WORK,USER.KEY ELSE INFO.REC=''
INFO.REC<1,WEEK.NUM>=INFO.REC<1,WEEK.NUM>+OUTPUT.HOURS ;* add hours
INFO.REC<2,WEEK.NUM>=PAY.BEGIN ;* beginning period date
INFO.REC<3,WEEK.NUM>=PAY.END ;* ending period date
INFO.REC<4,WEEK.NUM>=INFO.REC<4,WEEK.NUM>+VAC.TOTAL ;* vacation hours
INFO.REC<5,WEEK.NUM>=INFO.REC<5,WEEK.NUM>+SICK.TOTAL ;* sick hours used
INFO.REC<6,WEEK.NUM>=INFO.REC<6,WEEK.NUM>+HOLIDAY.TOTAL ;* holiday hours
* SKIP OTHER TOTAL (CALCULATE IN SUB 2600)
INFO.REC<8,WEEK.NUM>=INFO.REC<8,WEEK.NUM>+FUNERAL.TOTAL ;* funeral hours
INFO.REC<9,WEEK.NUM>=INFO.REC<9,WEEK.NUM>+PERSONAL.TOTAL ;* personal hours
INFO.REC<10,WEEK.NUM>=INFO.REC<10,WEEK.NUM>+BONUS.TOTAL ;* bonus hours
INFO.REC<11,WEEK.NUM>=INFO.REC<11,WEEK.NUM>+JURY.TOTAL ;* jury hours
INFO.REC<12,WEEK.NUM>=INFO.REC<12,WEEK.NUM>+WORKMANS.TOTAL;* work comp hours
*
INFO.REC<25,WEEK.NUM>=INFO.REC<25,WEEK.NUM>+WOF.TOTAL;* WOF total
INFO.REC<26,WEEK.NUM>=INFO.REC<26,WEEK.NUM>+EIGHT.TOTAL;* 800 total
INFO.REC<27,WEEK.NUM>=INFO.REC<27,WEEK.NUM>+IDM.TOTAL;* IDM total
*--------------------------------------------------------------*
WRITE INFO.REC ON INFO.WORK,USER.KEY
WT=WT+1
END
END
2300 *
REPEAT
*
*
2600 *---- select file & determine hours accrued/used (non-manager)--*
*
* for clockfile users
*
EOF=0 ; T=0 ; WT=0 ; FILE.ACCESS='WORK FILE'
*
SELECT INFO.WORK
LOOP
READNEXT ID ELSE EOF=1
UNTIL EOF DO
T=T+1
IF REM(T,25)=0 THEN GOSUB 2900 ;* refresh totals
*
TOTAL.HOURS=0 ; VAC.HOURS=0 ; OT.HOURS=0
HOL.HOURS=0 ; OTHER.HOURS=0 ; ACCRUAL.HOURS=0
WORKED.HOURS=0 ; BONUS.HOURS=0 ; JURY.HOURS=0
WORKMANS.HOURS=0 ; PERSONAL.HOURS=0 ; FUNERAL.HOURS=0
FIRST.OT=0 ; SECOND.OT=0 ; REG.OUT.HOURS=0
VAC.ACCRUAL=0 ; PER.ACCRUAL=0 ; SICK.HOURS=0
WOF.TOTAL=0 ; EIGHT.TOTAL=0 ; IDM.TOTAL=0
VCALC=0 ; THIRD.OT=0
*
READ IREC FROM INFO.WORK,ID THEN
WEEK.ONE.TOTAL =IREC<1,1>
WEEK.TWO.TOTAL =IREC<1,2>
WEEK.THREE.TOTAL=IREC<1,3>
TOTAL.HOURS =SUM(IREC<1>)
VAC.HOURS =SUM(IREC<4>) ;* vacation hours used
SICK.HOURS =SUM(IREC<5>) ;* sick hours used
HOL.HOURS =SUM(IREC<6>) ;* holiday hours used
FUNERAL.HOURS =SUM(IREC<8>)
PERSONAL.HOURS =SUM(IREC<9>)
BONUS.HOURS =SUM(IREC<10>)
JURY.HOURS =SUM(IREC<11>)
WORKMANS.HOURS =SUM(IREC<12>)
WOF.TOTAL =SUM(IREC<25>)
EIGHT.TOTAL =SUM(IREC<26>)
IDM.TOTAL =SUM(IREC<27>)
GOSUB 5100 ;* convert wof hours seconds to hours
GOSUB 5150 ;* convert idm hours seconds to hours
GOSUB 5200 ;* convert 800 hours seconds to hours
FIRST.OTHER =IREC<4,1>+IREC<5,1>+IREC<6,1>+IREC<8,1>
FIRST.OTHER =FIRST.OTHER+IREC<9,1>+IREC<10,1>+IREC<11,1>+IREC<12,1>
FIRST.REG =IREC<1,1>-FIRST.OTHER
*--- figure first week overtime ------------------------*
IF FIRST.REG > 4000 THEN
FIRST.OT=FIRST.REG-4000
FIRST.REG=4000
END ELSE
FIRST.OT=0
END
*--- figure second week overtime ----------------------*
SECOND.OTHER =IREC<4,2>+IREC<5,2>+IREC<6,2>+IREC<8,2>
SECOND.OTHER =SECOND.OTHER+IREC<9,2>+IREC<10,2>+IREC<11,2>+IREC<12,2>
SECOND.REG =IREC<1,2>-SECOND.OTHER
IF SECOND.REG > 4000 THEN
SECOND.OT=SECOND.REG-4000
SECOND.REG=4000
END ELSE
SECOND.OT=0
END
*--- figure third week overtime ----------------------*
THIRD.OTHER =IREC<4,3>+IREC<5,3>+IREC<6,3>+IREC<8,3>
THIRD.OTHER =THIRD.OTHER+IREC<9,3>+IREC<10,3>+IREC<11,3>+IREC<12,3>
THIRD.REG =IREC<1,3>-THIRD.OTHER
IF THIRD.REG > 4000 THEN
THIRD.OT=THIRD.REG-4000
THIRD.REG=4000
END ELSE
THIRD.OT=0
END
IF FIRST.OT < 13 THEN FIRST.OT='00' ;* less than .25 hr = 0
IF SECOND.OT < 13 THEN SECOND.OT='00' ;* less than .25 hr = 0
IF THIRD.OT < 13 THEN THIRD.OT='00' ;* less than .25 hr = 0
OTHER.HOURS=FIRST.OTHER+SECOND.OTHER+THIRD.OTHER
OT.HOURS=FIRST.OT+SECOND.OT+THIRD.OT
*
GOSUB 5000 ;* round all hours to nearest .25
*
TOTAL.HOURS=FIRST.REG+SECOND.REG+THIRD.REG+OT.HOURS+OTHER.HOURS
*
BILL.ONE =IREC<13>
BILL.TWO =IREC<14>
BILL.THREE =IREC<15>
BILL.CLIENT =IREC<16>
BILL.CLIENT.HRS =IREC<17>
SERVICE.HOURS =IREC<18>
FREE.HOURS =IREC<19>
WORKED.HOURS=FIRST.REG+SECOND.REG+THIRD.REG+OTHER.HOURS
REG.OUT.HOURS=FIRST.REG+SECOND.REG+THIRD.REG
IF WORKED.HOURS >= 4000*NUMBER.WEEKS THEN ;* accrue based on
ACCRUAL.HOURS=4000*NUMBER.WEEKS ;* 40 hours times the
END ELSE ;* number of weeks
ACCRUAL.HOURS=WORKED.HOURS
END
ACCRUAL.HOURS=OCONV(ACCRUAL.HOURS,'MR2')
READU USERX FROM USER.FILE,ID THEN
IF ALL.SW ELSE ;* all departments selected for report
UDEPT=USERX<UR$DEPT>
LOCATE(UDEPT,D.TABLE,1;ZZQ) ELSE
DELETE INFO.WORK,ID
GO 2699 ;* go to next user
END
END
VCALC=0
IF USERX<UR$TYPE.CODE>='P' THEN PART.TIME=1 ELSE PART.TIME=''
*---------------------------------------------*
*
GOSUB 5000 ;* round all hours to nearest .25hr
*
*--- update user record with current pay period info---*
USERX<UR$REGULAR.HOURS> =REG.OUT.HOURS
USERX<70>=WEEK.ONE.TOTAL
USERX<71>=WEEK.TWO.TOTAL
USERX<72>=WEEK.THREE.TOTAL
USERX<75>=WOF.TOTAL
USERX<76>=EIGHT.TOTAL
USERX<77>=IDM.TOTAL
IF PART.TIME THEN ;* reduce but not accrue vac
USERX<UR$OT.HOURS> =OT.HOURS
USERX<UR$HOLIDAY.HOURS> =HOL.HOURS
USERX<UR$FUNERAL.HOURS> =FUNERAL.HOURS
USERX<UR$PERSONAL.HOURS>=PERSONAL.HOURS
USERX<UR$BONUS.HOURS> =BONUS.HOURS
USERX<UR$WORKMANS.HOURS>=WORKMANS.HOURS
USERX<UR$JURY.DUTY.HOURS>=JURY.HOURS
USERX<UR$VACATION.HOURS>=VAC.HOURS
USERX<UR$SICK.HOURS> =SICK.HOURS
USERX<UR$TOTAL.HOURS> =TOTAL.HOURS
USERX<UR$OTHER.HOURS> =OTHER.HOURS
USERX<UR$LAST.PAY.DATE> =ACTUAL.PAY.DATE
USERX<UR$VACATION.AVAIL>=USERX<UR$VACATION.AVAIL>-VAC.HOURS
USERX<UR$PERSONAL.AVAIL>=USERX<UR$PERSONAL.AVAIL>-PERSONAL.HOURS-BONUS.HOURS
USERX<UR$BILL.BILL> =BILL.ONE
USERX<UR$BILL.SERVICE> =BILL.TWO
USERX<UR$BILL.FREE> =BILL.THREE
USERX<UR$BILL.CLIENT> =BILL.CLIENT
USERX<UR$BILL.CLIENT.HRS>=BILL.CLIENT.HRS
USERX<UR$SERVICE.CLIENT.HRS>=SERVICE.HOURS
USERX<UR$FREE.CLIENT.HRS>=FREE.HOURS
END ELSE
USERX<UR$OT.HOURS> =OT.HOURS
USERX<UR$HOLIDAY.HOURS> =HOL.HOURS
USERX<UR$VACATION.HOURS>=VAC.HOURS
USERX<UR$SICK.HOURS> =SICK.HOURS
USERX<UR$TOTAL.HOURS> =TOTAL.HOURS
USERX<UR$FUNERAL.HOURS> =FUNERAL.HOURS
USERX<UR$PERSONAL.HOURS>=PERSONAL.HOURS
USERX<UR$BONUS.HOURS> =BONUS.HOURS
USERX<UR$WORKMANS.HOURS>=WORKMANS.HOURS
USERX<UR$JURY.DUTY.HOURS>=JURY.HOURS
USERX<UR$OTHER.HOURS> =OTHER.HOURS
USERX<UR$LAST.PAY.DATE> =ACTUAL.PAY.DATE
USERX<UR$VACATION.AVAIL>=USERX<UR$VACATION.AVAIL>+VAC.ACCRUAL-VAC.HOURS
USERX<UR$PERSONAL.AVAIL>=USERX<UR$PERSONAL.AVAIL>+PER.ACCRUAL-PERSONAL.HOURS-BONUS.HOURS
USERX<UR$BILL.BILL> =BILL.ONE
USERX<UR$BILL.SERVICE> =BILL.TWO
USERX<UR$BILL.FREE> =BILL.THREE
USERX<UR$BILL.CLIENT> =BILL.CLIENT
USERX<UR$BILL.CLIENT.HRS>=BILL.CLIENT.HRS
USERX<UR$SERVICE.CLIENT.HRS>=SERVICE.HOURS
USERX<UR$FREE.CLIENT.HRS>=FREE.HOURS
END
*----*
READ SLREC FROM LRTES,ID THEN
SSS=(SLREC<1>*1)'R26'
USERX<78>=0 ; USERX<79>=0 ; USERX<80>=0
USERX<78>=SSS*USERX<75>'R26'
USERX<79>=SSS*USERX<76>'R26'
USERX<80>=SSS*USERX<77>'R26'
FOR RXX=78 TO 80
USERX<RXX>=ICONV(USERX<RXX>,'MR2')
NEXT RXX
END
*--- write user file and history (reports run from history)
WRITE USERX ON INFO.WORK,ID ; WT=WT+1
END
RELEASE USER.FILE,ID
END
2699 *
REPEAT
*
*
GOSUB 5900 ;* print report
*
CRT @(0,22):CL:RV:" PROCESS COMPLETE <return> :":ERV:
INPUT ANY,3
HUSH ON
EXECUTE "DELETE-FILE ":FILE.KEY
HUSH OFF
STOP
*
2900 *--- refrsh processing totals ----------------------------*
LINE=''
LINE=FILE.ACCESS:" RECORDS READ :"
CRT @(20,16):CR:LINE'L#25':":":T'L,'
CRT @(20,17):CL:"RECORDS FOUND :":WT'L,'
RETURN
*
5000 *--- round all hours to nearest quarter hour (.25)--------*
TABLE=REG.OUT.HOURS:VM:TOTAL.HOURS:VM:VAC.HOURS:VM:OT.HOURS:VM:SICK.HOURS
TABLE=TABLE:VM:HOL.HOURS:VM:OTHER.HOURS:VM:ACCRUAL.HOURS
TABLE=TABLE:VM:WORKED.HOURS:VM:BONUS.HOURS:VM:JURY.HOURS
TABLE=TABLE:VM:WORKMANS.HOURS:VM:PERSONAL.HOURS:VM:FUNERAL.HOURS
TABLE=TABLE:VM:FIRST.REG:VM:SECOND.REG:VM:THIRD.REG
TABLE=TABLE:VM:WEEK.ONE.TOTAL:VM:WEEK.TWO.TOTAL:VM:WEEK.THREE.TOTAL
TABLE=TABLE:VM:WOF.TOTAL:VM:EIGHT.TOTAL:VM:IDM.TOTAL
*
NUMCT=DCOUNT(TABLE<1>,VM)
FOR KJ = 1 TO NUMCT
ADJUST.TOT=TABLE<1,KJ>
ADJUST.TOT=ADJUST.TOT'R26'
ADJUST.ONE=OCONV(ADJUST.TOT,'G0.1')
ADJUST.TWO=OCONV(ADJUST.TOT,'G1.1')
IF ADJUST.TWO < 13 THEN ADJUST.TWO='00'
IF ADJUST.TWO >= 13 AND ADJUST.TWO < 38 THEN ADJUST.TWO=25
IF ADJUST.TWO >= 38 AND ADJUST.TWO < 63 THEN ADJUST.TWO=50
IF ADJUST.TWO >= 63 AND ADJUST.TWO < 88 THEN ADJUST.TWO=75
IF ADJUST.TWO >= 88 AND ADJUST.TWO <= 99 THEN
ADJUST.TWO='00'
ADJUST.ONE=ADJUST.ONE+1
END
TABLE<1,KJ>=ADJUST.ONE:ADJUST.TWO
NEXT KJ
REG.OUT.HOURS =TABLE<1,1>
TOTAL.HOURS =TABLE<1,2>
VAC.HOURS =TABLE<1,3>
OT.HOURS =TABLE<1,4>
SICK.HOURS =TABLE<1,5>
HOL.HOURS =TABLE<1,6>
OTHER.HOURS =TABLE<1,7>
BONUS.HOURS =TABLE<1,10>
JURY.HOURS =TABLE<1,11>
WORKMANS.HOURS=TABLE<1,12>
PERSONAL.HOURS=TABLE<1,13>
FUNERAL.HOURS =TABLE<1,14>
FIRST.REG =TABLE<1,15>
SECOND.REG =TABLE<1,16>
THIRD.REG =TABLE<1,17>
WEEK.ONE.TOTAL=TABLE<1,18>
WEEK.TWO.TOTAL=TABLE<1,19>
WEEK.THREE.TOAL=TABLE<1,20>
WOF.TOTAL =TABLE<1,21>
EIGHT.TOTAL =TABLE<1,22>
IDM.TOTAL =TABLE<1,23>
RETURN
*
5100 *-- convert wof seconds to hours -------------------------*
WOF.TOTAL =(WOF.TOTAL/60)/60
WDAILY.HOURS=INT(WOF.TOTAL)
WDAILY.DECI =OCONV(WOF.TOTAL,'G1.1')[1,3]
WTWO.DECI =WDAILY.DECI[1,2]'L%2'
WEXTRA.DECI =WDAILY.DECI[3,1]
IF WEXTRA.DECI >= 5 THEN
IF WTWO.DECI=99 THEN
WTWO.DECI='00'
WDAILY.HOURS=WDAILY.HOURS+1
END ELSE
WTWO.DECI=WTWO.DECI+1'R%2'
END
END ELSE
IF WTWO.DECI=99 THEN
WTWO.DECI='00'
WDAILY.HOURS=WDAILY.HOURS+1
END
END
WOF.TOTAL=WDAILY.HOURS:WTWO.DECI
RETURN
*
*
5150 *-- convert IDM seconds to hours -------------------------*
IDM.TOTAL =(IDM.TOTAL/60)/60
IDAILY.HOURS=INT(IDM.TOTAL)
IDAILY.DECI =OCONV(IDM.TOTAL,'G1.1')[1,3]
ITWO.DECI =IDAILY.DECI[1,2]'L%2'
IEXTRA.DECI =IDAILY.DECI[3,1]
IF IEXTRA.DECI >= 5 THEN
IF ITWO.DECI=99 THEN
ITWO.DECI='00'
IDAILY.HOURS=IDAILY.HOURS+1
END ELSE
ITWO.DECI=ITWO.DECI+1'R%2'
END
END ELSE
IF ITWO.DECI=99 THEN
ITWO.DECI='00'
IDAILY.HOURS=IDAILY.HOURS+1
END
END
IDM.TOTAL=IDAILY.HOURS:ITWO.DECI
RETURN
*
5200 *-- convert 800 seconds to hours -------------------------*
EIGHT.TOTAL =(EIGHT.TOTAL/60)/60
EIGHT.HOURS=INT(EIGHT.TOTAL)
EIGHT.DECI =OCONV(EIGHT.TOTAL,'G1.1')[1,3]
ETWO.DECI =EIGHT.DECI[1,2]'L%2'
EEXTRA.DECI =EIGHT.DECI[3,1]
IF EEXTRA.DECI >= 5 THEN
IF ETWO.DECI=99 THEN
ETWO.DECI='00'
EIGHT.HOURS=EIGHT.HOURS+1
END ELSE
ETWO.DECI=ETWO.DECI+1'R%2'
END
END ELSE
IF ETWO.DECI=99 THEN
ETWO.DECI='00'
EIGHT.HOURS=EIGHT.HOURS+1
END
END
EIGHT.TOTAL=EIGHT.HOURS:ETWO.DECI
RETURN
*
*
5900 *--- print report ---------------------------------------------*
EOF=0 ; T=0 ; WT=0 ; CHANNEL.1=CHAR(12) ; PAGECNT=0 ; LNCT=99
TODAY=DATE() ; LAST.DEPT='' ; FIRST.SW=1 ; MICAHTEK.FLAG=''
TOTALS='' ; GRAND.TOTALS=''
FOR X = 1 TO 7 ;* init column totals
TOTALS<X>=0
NEXT X
*
TODAY=OCONV(DATE(),'D2/')
*--- report headings ------------------------------------------------*
H1=TODAY'L#8':SPACE(34):'MICAHTEK, MSD & IDM CLOCK PROOF REPORT (MANAGERS)'
H3A=SPACE(34):'Period Week 1 Week 2 Week 3 WOF 800'
H3A=H3A:' IDM Total'
H3='User Name':SPACE(11):' Code Dept'
H3=H3:SPACE(1):' date Hours Hours Hours Hours Hours'
H3=H3:SPACE(1):' Hours Hours'
*
FIRST.PERIOD=''
*
*--- report will automatically landscape + 16.pitch ------------------*
PRINTER ON
READ SMALL FROM HPC,'16.PITCH' ELSE SMALL=''
*READ LAND FROM HPC,'LANDSCAPE' ELSE LAND=''
READ RESET FROM HPC,'RESET' ELSE RESET=''
PRINT SMALL ;* PRINT LAND
*
H2=SPACE(48):'FOR DATE RANGE ':OCONV(FIRST.DATE,'D2/'):" TO ":OCONV(SECOND.DATE,'D2/')
*
*------ select file -------------------------------------------*
CRT @(0,22):CL:RV:" SELECTING FILE...PLEASE WAIT! ":ERV:
*
OPEN 'DICT ':FILE.KEY TO DICT ELSE ABORT 201, 'DICT ':FILE.KEY
DREC=''
DREC='A':AM:'5':AM:'DEPT':AM:AM:AM:AM:AM:AM:'R':AM:'4'
WRITE DREC ON DICT,"DEPT"
DREC=''
DREC='A':AM:'1':AM:'FNAME':AM:AM:AM:AM:AM:AM:'L':AM:'4'
WRITE DREC ON DICT,"FNAME"
DREC=''
DREC='A':AM:'2':AM:'LNAME':AM:AM:AM:AM:AM:AM:'L':AM:'4'
WRITE DREC ON DICT,"LNAME"
*
HUSH ON
EXECUTE "SSELECT ":FILE.KEY:" BY DEPT BY LNAME BY FNAME"
HUSH OFF
*
LOOP
READNEXT ID ELSE EOF=1
UNTIL EOF DO
T=T+1
USER.KEY=ID
READ UREC FROM INFO.WORK,ID THEN
UREC<78>=0 ;* do not print $ amount on managers report
UREC<79>=0
UREC<80>=0
READ SLREC FROM LRTES,ID ELSE SLREC=''
DEPART=UREC<UR$DEPT>
IF DEPT # '5' THEN ;* (5 i.e., all depts)
LOCATE(DEPART,D.TABLE,1;FND) ELSE GO 6999
END
LAST.PAY.DATE=UREC<UR$LAST.PAY.DATE>
IF LAST.PAY.DATE = PAY.DATE ELSE GO 6999
IF NOT(FIRST.SW) THEN
IF DEPART # LAST.DEPT THEN
LINE=STR('-',131)
GOSUB 8000
IF DEPART='800' THEN ;* subtotal idm then begin micahtek
IF DEPT # '4' THEN ;* more than phone center selected
MICAHTEK.FLAG=1 ;* micahtek totals will be printed
LINE='****** IDM TOTALS':SPACE(25)
GOSUB 10000 ;* print subtotals
GOSUB 8000
TOTALS=''
END
END
END
END
FIRST.SW=''
LAST.DEPT=DEPART
NAME=UREC<UR$LNAME>:", ":UREC<UR$FNAME>
LINE=NAME'L#20':SPACE(1)
LINE=LINE:USER.KEY'L#4':SPACE(2)
LINE=LINE:DEPART'R#4':SPACE(2)
LINE=LINE:OCONV(UREC<UR$LAST.PAY.DATE>,'D2/')'R#8':SPACE(2)
LINE=LINE:OCONV(UREC<70>,'MR2')'R#10':SPACE(2)
LINE=LINE:OCONV(UREC<71>,'MR2')'R#10':SPACE(2)
LINE=LINE:OCONV(UREC<72>,'MR2')'R#10':SPACE(2)
LINE=LINE:OCONV(UREC<75>,'MR2')'R#10':SPACE(2)
LINE=LINE:OCONV(UREC<76>,'MR2')'R#10':SPACE(2)
LINE=LINE:OCONV(UREC<77>,'MR2')'R#10':SPACE(2)
LINE=LINE:OCONV(UREC<UR$TOTAL.HOURS>,'MR2')'R#10':SPACE(2)
WT=WT+1
GOSUB 6000 ;* increment totals
GOSUB 6500 ;* increment grand totals
GOSUB 8000 ;* print line
END
6999 *
REPEAT
*
*CRT @(8,16):CL:"REPORT RECORDS READ :":T
*CRT @(8,17):CL:"RECORDS IN DATE RANGE :":WT
*
LINE=STR('=',131)
GOSUB 8000 ;* print totals line
*
IF MICAHTEK.FLAG THEN
LINE='**** MICAHTEK TOTALS':SPACE(21)
GOSUB 10000 ;* print micahtek totals
GOSUB 8000
END
TOTALS=GRAND.TOTALS
LINE='**** GRAND TOTALS':SPACE(24)
GOSUB 10000 ;* print totals
GOSUB 8000
GOSUB 8000
LINE='END OF REPORT'
GOSUB 8000
*
7999 *
CRT @(0,20):CR:
PRINT RESET
PRINTER CLOSE
PRINTER OFF
RETURN
*
6000 *--- total figures ----------------------------------------*
TOTALS<1>=TOTALS<1>+UREC<70>
TOTALS<2>=TOTALS<2>+UREC<71>
TOTALS<3>=TOTALS<3>+UREC<72>
TOTALS<4>=TOTALS<4>+UREC<75>
TOTALS<5>=TOTALS<5>+UREC<76>
TOTALS<6>=TOTALS<6>+UREC<77>
TOTALS<7>=TOTALS<7>+UREC<UR$TOTAL.HOURS>
RETURN
*
6500 *--- grand total figures ----------------------------------*
GRAND.TOTALS<1>=GRAND.TOTALS<1>+UREC<70>
GRAND.TOTALS<2>=GRAND.TOTALS<2>+UREC<71>
GRAND.TOTALS<3>=GRAND.TOTALS<3>+UREC<72>
GRAND.TOTALS<4>=GRAND.TOTALS<4>+UREC<75>
GRAND.TOTALS<5>=GRAND.TOTALS<5>+UREC<76>
GRAND.TOTALS<6>=GRAND.TOTALS<6>+UREC<77>
GRAND.TOTALS<7>=GRAND.TOTALS<7>+UREC<UR$TOTAL.HOURS>
RETURN
*
8000 *--- print line -------------------------------------------*
IF LNCT > 58 THEN
PRINT CHANNEL.1
PAGECNT=PAGECNT+1
H1B=H1:SPACE(32):"PAGE ":PAGECNT
PRINT H1B
PRINT H2
PRINT
PRINT H3A
PRINT H3
PRINT
LNCT=6
END
PRINT LINE
LINE=''
LNCT=LNCT+1
RETURN
*
*
10000 *---- print subtotals -----------------------------------*
*
FOR X = 1 TO 7
LINE=LINE:OCONV(TOTALS<X>,'MR2')'R#11':SPACE(1)
NEXT X
GOSUB 8000
GOSUB 8000
*
RETURN