144 lines
4.7 KiB
Plaintext
144 lines
4.7 KiB
Plaintext
|
SUBROUTINE MSD.USER.MAINT
|
||
|
*
|
||
|
*
|
||
|
*-------------------------------------------------------------------*
|
||
|
*
|
||
|
$INCLUDE GEN.COMMON
|
||
|
$INCLUDE USER
|
||
|
*
|
||
|
*-------------------------------------------------------------------*
|
||
|
*
|
||
|
OPEN 'USER' TO USER.FILE ELSE ABORT 201, 'USER'
|
||
|
OPEN 'PROJECT' TO PROJECT ELSE ABORT 201, 'PROJECT'
|
||
|
OPEN 'INFO.ACCRUAL' TO INFO.ACCRUAL ELSE ABORT 201, 'INFO.ACCRUAL'
|
||
|
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 'INFO.HIST' TO INFO.HIST ELSE ABORT 201, 'INFO.HIST'
|
||
|
*
|
||
|
*-------------------------------------------------------------------*
|
||
|
*
|
||
|
USER.ADD='' ; USER.REC='' ; TODAY=DATE()
|
||
|
*
|
||
|
*-------------------------------------------------------------------*
|
||
|
5 *
|
||
|
10 *
|
||
|
CRT CS
|
||
|
HDG='UPDATE USER HOURS'
|
||
|
HDL=(80 - LEN(HDG)) / 2
|
||
|
CRT @(0,0):CL:RV:STR(' ',80):ERV
|
||
|
CRT @(HDL,0):RV:HDG:ERV:
|
||
|
|
||
|
*
|
||
|
5000 *--- update manager/user records ------------------------*
|
||
|
*
|
||
|
EOF=0 ; T=0 ;WT=0
|
||
|
EXECUTE "GET-LIST SCOTT.JAN"
|
||
|
*
|
||
|
LOOP
|
||
|
READNEXT ID ELSE EOF=1
|
||
|
UNTIL EOF DO
|
||
|
READ USER.REC FROM INFO.HIST,ID THEN
|
||
|
CRT @(0,1):CR:
|
||
|
CRT @(5,3):CL:RV:" 1. USER CODE :":ERV
|
||
|
CRT @(5,4):CL:RV:" 2. LAST NAME :":ERV
|
||
|
CRT @(5,5):CL:RV:" 3. FIRST NAME :":ERV
|
||
|
CRT @(5,6):CL:RV:" 4. DEPARTMENT :":ERV
|
||
|
CRT @(25,3):OCONV(ID,'G0*1')
|
||
|
CRT @(25,4):USER.REC<UR$LNAME>
|
||
|
CRT @(25,5):USER.REC<UR$FNAME>
|
||
|
CRT @(25,6):USER.REC<UR$DEPT>
|
||
|
CRT @(5,8):"Last Period Regular Hours : ":USER.REC<UR$REGULAR.HOURS>'R26'
|
||
|
HOLD.REG=USER.REC<UR$REGULAR.HOURS> ; DIFFER=0
|
||
|
GOSUB 8000
|
||
|
CRT @(5,10):"Last Period Overtime Hours : ":USER.REC<UR$OT.HOURS>'R26'
|
||
|
GOSUB 9000
|
||
|
GOSUB 10000
|
||
|
CRT @(0,22):CL:RV:" Enter 'E' to end, 'Q'uit, else '/' to escape :":ERV:
|
||
|
INPUT BANS,9
|
||
|
IF BANS='Q' THEN STOP
|
||
|
IF BANS='E' THEN GOSUB 7000
|
||
|
END
|
||
|
REPEAT
|
||
|
*
|
||
|
7000 *---write changes to disk ----------------------------------*
|
||
|
WRITE USER.REC ON INFO.HIST,ID
|
||
|
CRT @(0,22):CL:RV:" RECORDS HAVE BEEN UPDATED! <return> :":ERV:
|
||
|
INPUT ANY,2
|
||
|
RETURN
|
||
|
*
|
||
|
8000 *
|
||
|
CRT @(0,22):CL:RV:" ENTER THE TIME (In Quarter-hour increments, Ex. 14.25) ":ERV:
|
||
|
ONE.NUM='' ; TWO.NUM='' ; HOLD='' ; COLN='' ; REG.HRS=''
|
||
|
CRT @(5,9):"CORRECTED REGULAR HOURS :":ERV:
|
||
|
INPUT REG.HRS,7
|
||
|
IF REG.HRS='/' THEN STOP
|
||
|
COLN=INDEX(REG.HRS,":",1)
|
||
|
IF COLN > 0 THEN
|
||
|
GO 8000
|
||
|
END ELSE
|
||
|
ONE.NUM=OCONV(REG.HRS,'G0.1')
|
||
|
TWO.NUM=OCONV(REG.HRS,'G1.1')
|
||
|
REG.HRS=ONE.NUM'R%2':TWO.NUM'L%2'
|
||
|
END
|
||
|
USER.REC<UR$REGULAR.HOURS>=REG.HRS
|
||
|
CRT @(5,9):"CORRECTED REGULAR HOURS :":ERV:" ":REG.HRS'R26'
|
||
|
RETURN
|
||
|
*
|
||
|
9000 *
|
||
|
CRT @(0,22):CL:RV:" ENTER THE TIME (In Quarter-hour increments, Ex. 14.25) ":ERV:
|
||
|
ONE.NUM='' ; TWO.NUM='' ; HOLD='' ; COLN='' ; REG.HRS=''
|
||
|
CRT @(5,11):"CORRECTED OVERTIME HOURS :":ERV:
|
||
|
INPUT REG.HRS,7
|
||
|
IF REG.HRS='/' THEN STOP
|
||
|
COLN=INDEX(REG.HRS,":",1)
|
||
|
IF COLN > 0 THEN
|
||
|
GO 9000
|
||
|
END ELSE
|
||
|
ONE.NUM=OCONV(REG.HRS,'G0.1')
|
||
|
TWO.NUM=OCONV(REG.HRS,'G1.1')
|
||
|
REG.HRS=ONE.NUM'R%2':TWO.NUM'L%2'
|
||
|
END
|
||
|
USER.REC<UR$OT.HOURS>=REG.HRS
|
||
|
CRT @(5,11):"CORRECTED OVERTIME HOURS :":ERV:" ":REG.HRS'R26'
|
||
|
RETURN
|
||
|
*
|
||
|
10000 *
|
||
|
DIFFER=USER.REC<UR$REGULAR.HOURS>-HOLD.REG
|
||
|
IF DIFFER > 0 THEN
|
||
|
*--- calculate vaction accrual ---------------*
|
||
|
VCALC=USER.REC<UR$INTERNAL.CALC>
|
||
|
VAC.ACCRUAL=DIFFER*VCALC
|
||
|
VAC.ONE=OCONV(VAC.ACCRUAL,'G0.1')
|
||
|
VAC.TWO=OCONV(VAC.ACCRUAL,'G1.1')'L%2'
|
||
|
VAC.ACCRUAL=VAC.ONE:VAC.TWO[1,2]
|
||
|
CRT @(5,13):"OLD VACATION AVAIL :":USER.REC<UR$VACATION.AVAIL>'R26'
|
||
|
CRT @(5,14):"ADDITIONAL HOURS :":DIFFER'R26'
|
||
|
CRT @(5,15):"CALC FACTOR :":VCALC
|
||
|
VAC.ACCRUAL=VAC.ACCRUAL/100
|
||
|
CRT @(5,16):"ADDITIONAL VAC :":VAC.ACCRUAL'R26'
|
||
|
TOTAL=USER.REC<UR$VACATION.AVAIL>+VAC.ACCRUAL
|
||
|
USER.REC<UR$VACATION.AVAIL>=TOTAL
|
||
|
CRT @(5,17):"----------------------------"
|
||
|
CRT @(5,18):"NEW TOTAL :":USER.REC<UR$VACATION.AVAIL>'R26'
|
||
|
*
|
||
|
*--- calculate personal accrual ---------------*
|
||
|
VCALC='.011538'
|
||
|
VAC.ACCRUAL=DIFFER*VCALC
|
||
|
VAC.ONE=OCONV(VAC.ACCRUAL,'G0.1')
|
||
|
VAC.TWO=OCONV(VAC.ACCRUAL,'G1.1')'L%2'
|
||
|
VAC.ACCRUAL=VAC.ONE:VAC.TWO[1,2]
|
||
|
CRT @(42,13):"OLD PERSONAL AVAIL :":USER.REC<UR$PERSONAL.AVAIL>'R26'
|
||
|
CRT @(42,14):"ADDITIONAL HOURS :":DIFFER'R26'
|
||
|
CRT @(42,15):"CALC FACTOR :":VCALC
|
||
|
VAC.ACCRUAL=VAC.ACCRUAL/100
|
||
|
CRT @(42,16):"ADDITIONAL PER :":VAC.ACCRUAL'R26'
|
||
|
TOTAL=USER.REC<UR$PERSONAL.AVAIL>+VAC.ACCRUAL
|
||
|
USER.REC<UR$PERSONAL.AVAIL>=TOTAL
|
||
|
CRT @(42,17):"----------------------------"
|
||
|
CRT @(42,18):"NEW TOTAL :":USER.REC<UR$PERSONAL.AVAIL>'R26'
|
||
|
END
|
||
|
RETURN
|