862 lines
19 KiB
Plaintext
Executable File
862 lines
19 KiB
Plaintext
Executable File
*---------------------------- *
|
|
* PROGRAM: CLOCK.UPDATE.ACCT
|
|
* BY: D.BELL
|
|
* ON: 1/24/91
|
|
* UPDATED ON: 5-26-95 BY J. LONGLEY
|
|
* MODIFIED LINE 443 TO BEEP ONLY ONE TIME INSTEAD OF SIX TIMES
|
|
*-----------------------------*
|
|
CS=@(-1) ; CR=@(-3) ; CL=@(-4) ; RV=@(-13) ; ERV=@(-14)
|
|
VM=CHAR(253) ; SVM=CHAR(252) ; AM=CHAR(254) ; BEEP=CHAR(7)
|
|
PF1='<' ; PF2='P' ; PF3='/'
|
|
PROMPT " "; DONE=0
|
|
MAXPOS=21; MAXCOL=79
|
|
MODIFY=0
|
|
LAST.PERIOD=0
|
|
TODAY=DATE()
|
|
JRNL=''
|
|
OVERTIME.DISP=0
|
|
CRT CS
|
|
*
|
|
PORT=OCONV('','U50BB')
|
|
PORT=FIELD(PORT," ",1)
|
|
BEGIN CASE
|
|
CASE PORT='20'; ADDS=1
|
|
CASE PORT='3' ; ADDS=1
|
|
CASE 1 ; ADDS=0
|
|
END CASE
|
|
*
|
|
$INCLUDE USER
|
|
$INCLUDE CLOCK.PAY.DATES
|
|
*
|
|
OPEN 'USER' TO USER.FILE ELSE ABORT
|
|
OPEN 'PROJECT' TO PROJECT ELSE ABORT
|
|
OPEN 'JOB' TO JOB.FILE ELSE ABORT
|
|
OPEN 'CLOCKFILE' TO CLOCKFILE ELSE ABORT
|
|
OPEN 'CLOCK.PAY.DATES' TO CLOCK.PAY.DATES ELSE ABORT ;* pay period dates
|
|
*
|
|
HELP.TBL=''; GOSUB 4000 ;* LOAD PROJECT CODES INTO ARRAY
|
|
EMP.TBL=''; GOSUB 4300 ;* BUILD EMPLOYEE INDEX
|
|
LOOP
|
|
SUPER=''; GOSUB 4500 ;* VERIFY SUPERVISOR ACCESS
|
|
UNTIL SUPER # '' DO REPEAT
|
|
IF SUPER = '/' THEN STOP
|
|
*
|
|
LOOP
|
|
1000 * USER INPUT
|
|
CRT CS
|
|
COL=0; POS=0
|
|
CRT @(POS,COL):"CLOCK.UPDATE.ACCT"
|
|
CRT @(0,POS+22):"Enter the Employee Number ":CL
|
|
TSTRING="Employee # :"
|
|
TLEN=LEN(TSTRING)
|
|
CRT @(COL+5,POS+4):TSTRING:" ________"
|
|
CRT @(COL+5+TLEN,POS+4):
|
|
INPUT EMP
|
|
IF EMP='OFF' THEN STOP
|
|
IF EMP='' OR EMP='/' THEN
|
|
CRT @(0,POS+22):"Thank You - Goodbye!":CL:
|
|
DONE=1
|
|
RQM
|
|
GO 1999
|
|
END
|
|
LOCATE(EMP,EMP.TBL,1;EINDX) THEN
|
|
USER=EMP.TBL<2,EINDX>
|
|
END ELSE
|
|
USER=EMP
|
|
END
|
|
READ UREC FROM USER.FILE,USER THEN
|
|
TSTRING="User ID # :":USER
|
|
CRT @(COL+5,POS+2):TSTRING
|
|
TSTRING="User Name :":UREC<1>:" ":UREC<2>
|
|
CRT @(COL+5,POS+3):TSTRING
|
|
TSTRING="Employee #:":UREC<6>
|
|
CRT @(COL+5,POS+4):TSTRING
|
|
GOSUB 2000
|
|
END ELSE
|
|
CRT @(0,POS+22):BEEP:"INVALID USER CODE - Try Again!":CL
|
|
RQM
|
|
GO 1000
|
|
END
|
|
1999 *
|
|
UNTIL DONE DO REPEAT
|
|
STOP
|
|
*
|
|
2000 * TIMECARD HEADER
|
|
POS=6; COL=0
|
|
CRT @(COL,POS):CR
|
|
GOSUB 2225
|
|
TSTRING="##"'L#3':" DATE"'L#9':" IN/OUT"'L#9':" HOURS"'L#9':"PROJECT"'L#7'
|
|
CRT @(COL+2,POS):TSTRING
|
|
CRT @(COL+42,POS):TSTRING
|
|
*
|
|
GOSUB 2200
|
|
*
|
|
Z=0; ZCT=0; ZPOS=0; MAX=15; SW=0; POS=6; COL=2
|
|
ZRAY=''
|
|
IRAY=''
|
|
*
|
|
* ZRAY<1>=DATES ; MV
|
|
* ZRAY<2>=TIMES ; MV
|
|
* ZRAY<3>=PRJCTS; MV
|
|
*
|
|
FOR D=SDATE TO EDATE STEP -1
|
|
DKEY=USER:"|":D
|
|
READ DREC FROM CLOCKFILE,DKEY THEN
|
|
ZCT=DCOUNT(DREC<1>,VM)
|
|
FOR Z=ZCT TO 1 STEP -1
|
|
ZRAY=INSERT(ZRAY,1,1;D)
|
|
ZRAY=INSERT(ZRAY,2,1;DREC<1,Z>)
|
|
ZRAY=INSERT(ZRAY,3,1;DREC<2,Z>)
|
|
NEXT Z
|
|
END
|
|
NEXT D
|
|
CALL CLOCK.CALC(ZRAY)
|
|
*
|
|
TOT.HRS=0 ; DAILY.HRS=0 ; WEEK.ONE=0 ; WEEK.TWO=0 ;WEEK.THREE=0
|
|
ZCT=DCOUNT(ZRAY<1>,VM)
|
|
FOR Z=1 TO ZCT
|
|
QQTIME=ZRAY<4,Z>
|
|
QQDATE=ZRAY<1,Z>
|
|
IF QQTIME > 0 AND QQTIME # '?' THEN
|
|
TOT.HRS=TOT.HRS+QQTIME
|
|
END
|
|
IF QQDATE >= EDATE AND QQDATE <= WEEK.ONE.END THEN
|
|
IF QQTIME > 0 AND QQTIME # '?' THEN
|
|
WEEK.ONE=WEEK.ONE+QQTIME
|
|
END
|
|
END
|
|
IF QQDATE > WEEK.ONE.END AND QQDATE <= WEEK.TWO.END THEN
|
|
IF QQTIME > 0 AND QQTIME # '?' THEN
|
|
WEEK.TWO=WEEK.TWO+QQTIME
|
|
END
|
|
END
|
|
IF QQDATE > WEEK.TWO.END AND QQDATE <= WEEK.THREE.END THEN
|
|
IF QQTIME > 0 AND QQTIME # '?' THEN
|
|
WEEK.THREE=WEEK.THREE+QQTIME
|
|
END
|
|
END
|
|
NEXT Z
|
|
CRT @(53,1):'WEEK ONE = ':OCONV(WEEK.ONE,'MTS')
|
|
CRT @(53,2):'WEEK TWO = ':OCONV(WEEK.TWO,'MTS')
|
|
CRT @(53,3):'WEEK THREE = ':OCONV(WEEK.THREE,'MTS')
|
|
CRT @(53,4):'TOTAL = ':RV:OCONV(TOT.HRS,'MTS'):ERV:
|
|
*
|
|
01234 *
|
|
IF WEEK.ONE > 144000 OR WEEK.TWO > 144000 OR WEEK.THREE > 144000 THEN
|
|
IF NOT(OVERTIME.DISP) THEN
|
|
CRT @(0,18):CR:BEEP:RV:SPACE(79)
|
|
CRT @(0,19):SPACE(79)
|
|
CRT @(0,20):SPACE(79)
|
|
CRT @(0,21):SPACE(79)
|
|
CRT @(0,22):SPACE(79)
|
|
CRT @(0,19):"Warning - You have exceeded the maximum number of weekly hours (40) allowed!"
|
|
CRT @(0,20):" Prior written authorization from your supervisor and"
|
|
CRT @(0,21):" the EXECUTIVE department is required for overtime pay!"
|
|
CRT @(0,22):"Press 'Y' to record your understanding of this --> ":ERV:
|
|
ANS5=''
|
|
INPUT ANS5
|
|
IF ANS5 # 'Y' THEN GO 01234
|
|
CRT @(0,18):CR
|
|
OVERTIME.DISP=1
|
|
END
|
|
END
|
|
*
|
|
Z=1
|
|
LOOP UNTIL Z > ZCT DO
|
|
IF ZCT>0 THEN
|
|
FOR Z=1 TO ZCT
|
|
DATE=D
|
|
ZPOS=ZPOS+1
|
|
IF INT(ZPOS/MAX) THEN
|
|
SW=SW+1
|
|
IF REM(SW,2) THEN
|
|
COL=42
|
|
END ELSE
|
|
COL=1
|
|
GOSUB 2100
|
|
IF ANS='B' THEN GO 2000
|
|
END
|
|
ZPOS=1
|
|
END
|
|
IF ZRAY<3,Z>='OFF' THEN
|
|
ZTIME=OCONV(ZRAY<2,Z>,"MTH")
|
|
ZTIME=OCONV(ZTIME,"MCL")
|
|
ZDATE=ZRAY<1,Z>
|
|
ZHOURS=OCONV(ZRAY<4,Z>,'MT')
|
|
TSTRING=Z'L#3':OCONV(ZDATE,"D2/")'L#9':ZTIME'L#9':ZHOURS'L#9':ZRAY<3,Z>'L#7'
|
|
IF Z > 1 THEN
|
|
IF ZDATE # ZRAY<1,Z-1> THEN
|
|
IF ZPOS > 1 THEN
|
|
CRT @(COL,POS+ZPOS):STR(" ",37)
|
|
END
|
|
ZPOS=ZPOS+1
|
|
IF ZPOS >= MAX THEN
|
|
Z=Z-1
|
|
GO 2099
|
|
END
|
|
END
|
|
END
|
|
CRT @(COL,POS+ZPOS):TSTRING
|
|
END ELSE
|
|
ZTIME=OCONV(ZRAY<2,Z>,"MTH")
|
|
ZTIME=OCONV(ZTIME,"MCL")
|
|
ZDATE=ZRAY<1,Z>
|
|
TSTRING=Z'L#3':OCONV(ZDATE,"D2/")'L#9':ZTIME'L#9':SPACE(9):ZRAY<3,Z>'L#7'
|
|
IF Z > 1 THEN
|
|
IF ZDATE # ZRAY<1,Z-1> THEN
|
|
IF ZPOS > 1 THEN
|
|
CRT @(COL,POS+ZPOS):STR(" ",37)
|
|
END
|
|
ZPOS=ZPOS+1
|
|
IF ZPOS >= MAX THEN
|
|
Z=Z-1
|
|
GO 2099
|
|
END
|
|
END
|
|
END
|
|
CRT @(COL,POS+ZPOS):TSTRING
|
|
END
|
|
2099 *
|
|
NEXT Z
|
|
FOR Y=ZPOS+1 TO MAX-1
|
|
TSTRING=SPACE(37)
|
|
CRT @(COL,POS+Y):TSTRING
|
|
NEXT Y
|
|
END
|
|
REPEAT
|
|
*
|
|
GOSUB 2100
|
|
IF ANS='B' THEN GO 2000
|
|
COL=0; POS=6
|
|
CRT @(COL,POS):CR
|
|
PRJCT=''; INDX=''
|
|
RETURN
|
|
*
|
|
2100 *
|
|
LOOP
|
|
CRT @(0,22):RV:"Enter # to Adjust, A(add), N(next), B(back), P(period) else RETURN ":ERV:CL:
|
|
INPUT ANS:
|
|
BEGIN CASE
|
|
CASE ANS='P'
|
|
CRT @(0,22):CL:"Enter a date in the requested period (mm/dd/yy)":
|
|
INPUT TODAY
|
|
IF TODAY='' THEN
|
|
TODAY=DATE()
|
|
END ELSE
|
|
TODAY=ICONV(TODAY,'D')
|
|
END
|
|
ANS='B'
|
|
CASE ANS='/' OR ANS=''
|
|
GO 2199
|
|
CASE ANS > 0 AND ANS <= ZCT
|
|
MODIFY=1
|
|
IRAY<1>=ZRAY<1,ANS>
|
|
IRAY<2>=ZRAY<2,ANS>
|
|
IRAY<3>=ZRAY<3,ANS>
|
|
GOSUB 5000
|
|
ANS='B'
|
|
CASE ANS='A'
|
|
GOSUB 5000
|
|
Z=Z-(ZPOS+(MAX*6))
|
|
IF Z < 0 THEN Z=0
|
|
SW=0
|
|
ANS='B'
|
|
CASE ANS='B'
|
|
Z=Z-(ZPOS+(MAX*6))
|
|
IF Z < 0 THEN Z=0
|
|
SW=0
|
|
CASE ANS='N'
|
|
ZPOS=ZPOS-1
|
|
IF Z > ZCT THEN
|
|
CRT @(0,22):"End of list!":CL
|
|
RQM
|
|
ANS=''
|
|
END
|
|
CASE ANS='VAC'
|
|
READ JX.REC FROM USER.FILE,EMP THEN
|
|
CRT @(0,22):CL:RV:"As of ":OCONV(JX.REC<UR$LAST.PAY.DATE>,'D2/'):", ":OCONV(JX.REC<UR$FNAME>,'MCT'):" has ":JX.REC<UR$VACATION.AVAIL>'R26':" hours of vacation time available: ":ERV:
|
|
INPUT ANY,2
|
|
END
|
|
GO 2100
|
|
CASE ANS='PER'
|
|
READ JX.REC FROM USER.FILE,EMP THEN
|
|
CRT @(0,22):CL:RV:"As of ":OCONV(JX.REC<UR$LAST.PAY.DATE>,'D2/'):", ":OCONV(JX.REC<UR$FNAME>,'MCT'):" has ":JX.REC<UR$PERSONAL.AVAIL>'R26':" hours of personal time available: ":ERV:
|
|
INPUT ANY,2
|
|
END
|
|
GO 2100
|
|
CASE 1
|
|
CRT @(0,22):BEEP:"INVALID ENTRY - Try Again!":CL:
|
|
RQM
|
|
ANS=''
|
|
END CASE
|
|
UNTIL ANS # '' DO REPEAT
|
|
2199 *
|
|
COL=2; POS=6
|
|
MODIFY=0
|
|
RETURN
|
|
*
|
|
2200 * CALC DATES
|
|
EOZ=0 ;EDATE='' ; SDATE='' ; QQV=0
|
|
SELECT CLOCK.PAY.DATES
|
|
LOOP
|
|
READNEXT CID ELSE EOZ=1
|
|
UNTIL EOZ DO
|
|
READ DATE.REC FROM CLOCK.PAY.DATES,CID THEN
|
|
FOR DDZ = 1 TO 3
|
|
IF TODAY >= DATE.REC<CPD$PERIOD.BEGIN,DDZ> THEN
|
|
IF TODAY <= DATE.REC<CPD$PERIOD.END,DDZ> THEN
|
|
EDATE=DATE.REC<CPD$PERIOD.BEGIN,DDZ>
|
|
SDATE=DATE.REC<CPD$PERIOD.END,DDZ>
|
|
WEEK.ONE.END=DATE.REC<CPD$WEEK.ONE.END,DDZ>
|
|
WEEK.TWO.END=DATE.REC<CPD$WEEK.TWO.END,DDZ>
|
|
WEEK.THREE.END=DATE.REC<CPD$WEEK.THREE.END,DDZ>
|
|
EOZ=1
|
|
END
|
|
END
|
|
NEXT DZZ
|
|
END
|
|
REPEAT
|
|
IF SDATE='' OR EDATE='' THEN
|
|
CRT @(0,22):CL:BEEP:RV:" Dates must be entered in MSD.PAY.DATES! <return> :":ERV:
|
|
INPUT ANY,9
|
|
TODAY=DATE()
|
|
IF QQV THEN
|
|
STOP
|
|
END ELSE
|
|
QQV=1
|
|
GO 2200 ;* redisplay with current pay period
|
|
END
|
|
END
|
|
CRT @(44,0):RV:" PERIOD:":ERV
|
|
CRT @(53,0):OCONV(EDATE,'D2/'):" thru ":OCONV(SDATE,'D2/')
|
|
RETURN
|
|
**
|
|
2225 * DRAW BOX
|
|
IF ADDS THEN
|
|
FOR X=POS TO 21
|
|
IF X=POS THEN
|
|
TSTRING1="#"
|
|
TCOL=COL; TPOS=X; GOSUB 2275
|
|
TSTRING1="L"
|
|
TCOL=COL+39; GOSUB 2275
|
|
TSTRING1="D"
|
|
TCOL=COL+79; GOSUB 2275
|
|
END ELSE
|
|
IF X=21 THEN
|
|
TSTRING1="B":STR("<",38):"M":STR("<",39):"F"
|
|
TCOL=COL; TPOS=X; GOSUB 2275
|
|
END ELSE
|
|
TSTRING1=">"
|
|
TCOL=COL; TPOS=X; GOSUB 2275
|
|
TCOL=COL+39; GOSUB 2275
|
|
TCOL=COL+79; GOSUB 2275
|
|
END
|
|
END
|
|
NEXT X
|
|
END ELSE
|
|
FOR X=POS TO 21
|
|
IF X=POS THEN
|
|
TSTRING1="|"
|
|
TCOL=COL; TPOS=X; GOSUB 2285
|
|
TSTRING1="|"
|
|
TCOL=COL+39; GOSUB 2285
|
|
TSTRING1="|"
|
|
TCOL=COL+79; GOSUB 2285
|
|
END ELSE
|
|
IF X=21 THEN
|
|
TSTRING1=STR("~",80)
|
|
TCOL=COL; TPOS=X; GOSUB 2285
|
|
END ELSE
|
|
TSTRING1="|"
|
|
TCOL=COL; TPOS=X; GOSUB 2285
|
|
TCOL=COL+39; GOSUB 2285
|
|
TCOL=COL+79; GOSUB 2285
|
|
END
|
|
END
|
|
NEXT X
|
|
END
|
|
RETURN
|
|
2275 * PRINT GRAPHICS
|
|
CRT CHAR(27):CHAR(72):CHAR(2)
|
|
CRT @(TCOL,TPOS):TSTRING1:
|
|
CRT CHAR(27):CHAR(72):CHAR(3)
|
|
RETURN
|
|
2285 * PRINT LINE
|
|
CRT @(TCOL,TPOS):TSTRING1:
|
|
RETURN
|
|
*
|
|
3000 * HELP HEADER
|
|
POS=6; COL=0
|
|
CRT @(COL,POS):CR
|
|
GOSUB 2225
|
|
TSTRING="PROJECT"'L#9':"DESCRIPTION"'L#27'
|
|
CRT @(COL+2,POS):TSTRING
|
|
CRT @(COL+42,POS):TSTRING
|
|
*
|
|
X=0;XX=0; MAX=14; SW=0; COL=2
|
|
XCT=DCOUNT(HELP.TBL<1>,VM)
|
|
LOOP
|
|
X=X+1
|
|
XX=XX+1
|
|
TSTRING=HELP.TBL<1,X>'L#9':HELP.TBL<2,X>[1,27]'L#27'
|
|
CRT @(COL,POS+XX):TSTRING
|
|
IF INT(XX/MAX) THEN
|
|
SW=SW+1
|
|
IF REM(SW,2) THEN
|
|
COL=42
|
|
END ELSE
|
|
COL=2
|
|
GOSUB 3100
|
|
END
|
|
XX=0
|
|
END
|
|
UNTIL PRJCT # '' DO REPEAT
|
|
IF PRJCT='/' THEN PRJCT=''
|
|
RETURN
|
|
*
|
|
3100 *
|
|
CRT @(0,22):RV:"Enter Project #, N(next page), B(back page)":ERV:CL:
|
|
INPUT ANS2:
|
|
IF ANS2='' OR ANS2='/' THEN
|
|
PRJCT='/'
|
|
GO 3199
|
|
END
|
|
IF ANS2='B' THEN
|
|
X=X-(XX+(MAX*3))
|
|
IF X < 0 THEN X=0
|
|
SW=0
|
|
END ELSE
|
|
IF ANS2='N' THEN
|
|
IF X > XCT THEN
|
|
CRT @(0,22):"End of list!":CL
|
|
RQM
|
|
*X=X-(MAX*2)
|
|
GO 3100
|
|
END
|
|
END ELSE
|
|
LOCATE(ANS2,HELP.TBL,1;INDX) THEN
|
|
PRJCT=ANS2
|
|
END ELSE
|
|
CRT @(0,22):RV:BEEP:"INVALID PROJECT CODE - Try Again!":ERV:CL:
|
|
END
|
|
END
|
|
END
|
|
3199 *
|
|
RETURN
|
|
*
|
|
4000 * LOAD PROJECT TABLE
|
|
IF HELP.TBL # '' ELSE
|
|
SELECT PROJECT
|
|
LOOP
|
|
READNEXT ID ELSE ID='EOF'
|
|
UNTIL ID='EOF' DO
|
|
READ PREC FROM PROJECT,ID THEN
|
|
LOCATE(ID,HELP.TBL,1;INDX;'AR') ELSE
|
|
HELP.TBL=INSERT(HELP.TBL,1,INDX;ID)
|
|
HELP.TBL=INSERT(HELP.TBL,2,INDX;PREC<1>)
|
|
END
|
|
END
|
|
REPEAT
|
|
END
|
|
RETURN
|
|
*
|
|
4300 *
|
|
IF EMP.TBL = '' THEN
|
|
SELECT USER.FILE
|
|
LOOP
|
|
READNEXT ID ELSE ID='EOF'
|
|
UNTIL ID='EOF' DO
|
|
READ EREC FROM USER.FILE,ID THEN
|
|
IF EREC<6> # '' THEN
|
|
LOCATE(EREC<6>,EMP.TBL,1;INDX;'AR') ELSE
|
|
EMP.TBL=INSERT(EMP.TBL,1,INDX;EREC<6>)
|
|
EMP.TBL=INSERT(EMP.TBL,2,INDX;ID)
|
|
END
|
|
END
|
|
END
|
|
REPEAT
|
|
END
|
|
RETURN
|
|
*
|
|
4500 * SUPERVISOR ACCESS
|
|
GOSUB 5525 ;* DRAW BOX
|
|
CRT @(0,22):"Enter your Access Code":CL
|
|
TCOL=COL+22; TPOS=POS+2
|
|
CRT @(TCOL,TPOS):
|
|
INPUT SUPER
|
|
IF SUPER='/' ELSE
|
|
READ UREC FROM USER.FILE,SUPER THEN
|
|
TSTRING="Supervsr #:":SUPER
|
|
CRT @(TCOL,TPOS+2):TSTRING
|
|
TSTRING="User Name :":UREC<1>:" ":UREC<2>
|
|
CRT @(TCOL,TPOS+3):TSTRING
|
|
TSTRING="Employee #:":UREC<7>
|
|
CRT @(TCOL,TPOS+4):TSTRING
|
|
CRT @(0,22):"Enter TODAY's Password":
|
|
ECHO OFF
|
|
INPUT ANY
|
|
ECHO ON
|
|
TDY=OCONV(DATE(),'DW')
|
|
BEGIN CASE
|
|
CASE TDY=7 ; ANS='1SNDY7'
|
|
CASE TDY=1 ; ANS='2MNDY6'
|
|
CASE TDY=2 ; ANS='3TSDY5'
|
|
CASE TDY=3 ; ANS='4WDNSDY4'
|
|
CASE TDY=4 ; ANS='5THRSDY3'
|
|
CASE TDY=5 ; ANS='6FRDY2'
|
|
CASE TDY=6 ; ANS='7STRDY1'
|
|
END CASE
|
|
IF ANY=ANS ELSE
|
|
CRT @(0,22):BEEP:"INVALID PASSWORD - SEE YOUR SUPERVISOR INSTRUCTIONS":CL:
|
|
RQM
|
|
SUPER=''
|
|
END
|
|
END ELSE
|
|
FOR G=1 TO 1
|
|
CRT @(TCOL,TPOS+G):BEEP:" INVALID USER CODE "
|
|
RQM
|
|
RQM
|
|
NEXT G
|
|
SUPER=''
|
|
END
|
|
END
|
|
RETURN
|
|
*
|
|
5000 *
|
|
GOSUB 5525
|
|
GOSUB 5600
|
|
*
|
|
5100 *
|
|
IF MODIFY THEN GO 5200
|
|
TSTRING1='DATE ________'
|
|
TCOL=COL+22; TPOS=POS+2
|
|
CRT @(0,22):RV:"Enter Date of adjustment (mm/dd/yy)":ERV:CL
|
|
CRT @(TCOL,TPOS):TSTRING1
|
|
DATA.IO=OCONV(IRAY<1>,'D2/')
|
|
INPUT @(TCOL+5,TPOS):DATA.IO
|
|
IF DATA.IO='/' THEN GO 5400
|
|
IF DATA.IO='<' THEN GO 5400
|
|
IRAY<1>=ICONV(DATA.IO,'D')
|
|
IF NUM(IRAY<1>) AND IRAY<1>#'' ELSE
|
|
CRT @(0,22):CL:BEEP:"INVALID DATE - TRY AGAIN!"
|
|
RQM
|
|
GO 5100
|
|
END
|
|
IF IRAY<1> < EDATE OR IRAY<1> > SDATE THEN
|
|
CRT @(0,22):CL:BEEP:"That Date is NOT in this PAY PERIOD!"
|
|
RQM
|
|
GO 5100
|
|
END
|
|
CRT @(TCOL+16,TPOS):OCONV(OCONV(IRAY<1>,'DWA'),'MCT'):" ":OCONV(IRAY<1>,'D2/')
|
|
5200 *
|
|
TSTRING1='TIME _____'
|
|
TCOL=COL+22; TPOS=POS+4
|
|
CRT @(0,22):RV:"Enter the Time of the Adjustment (hh.mm), D(delete)":ERV:CL
|
|
CRT @(TCOL,TPOS):TSTRING1
|
|
DATA.IO=OCONV(IRAY<2>,'MTS')
|
|
INPUT @(TCOL+5,TPOS):DATA.IO
|
|
IF DATA.IO='D' THEN GOSUB 8000; GO 5400
|
|
IF DATA.IO='<' THEN GO 5100
|
|
IF DATA.IO='/' OR DATA.IO='' THEN GO 5400
|
|
IRAY<2>=ICONV(DATA.IO,'MT')
|
|
IF IRAY<2>#'' ELSE
|
|
CRT @(0,22):CL:BEEP:"INVALID TIME - TRY AGAIN":
|
|
RQM
|
|
GO 5200
|
|
END
|
|
CRT @(TCOL+16,TPOS):OCONV(OCONV(IRAY<2>,'MTHS'),'MCL')
|
|
5300 *
|
|
TSTRING1='PROJECT ______'
|
|
TCOL=COL+22; TPOS=POS+6
|
|
CRT @(TCOL,TPOS):TSTRING1
|
|
CRT @(0,22):RV:"Enter the Project #, 'OFF', ?(help)":ERV:CL
|
|
DATA.IO=OCONV(IRAY<3>,'G0-1')
|
|
INPUT @(TCOL+8,TPOS):DATA.IO
|
|
IF DATA.IO='<' THEN GO 5200
|
|
IF DATA.IO='?' THEN
|
|
PRJCT=''
|
|
GOSUB 3000
|
|
GOSUB 5525
|
|
GOSUB 5600
|
|
DATA.IO=PRJCT
|
|
END
|
|
IF DATA.IO='/' OR DATA.IO='' THEN GO 5400
|
|
LOCATE(DATA.IO,HELP.TBL,1;INDX) THEN
|
|
TSTRING=HELP.TBL<2,INDX>
|
|
TLEN=LEN(TSTRING)
|
|
CRT @(TCOL+16,TPOS):TSTRING'L#21'
|
|
END ELSE
|
|
IF DATA.IO ='OUT' THEN DATA.IO ='OFF'
|
|
IF DATA.IO ='OFF' ELSE
|
|
CRT @(0,22):RV:BEEP:"INVALID PROJECT CODE - Try Again!":ERV:CL
|
|
RQM
|
|
GO 5300
|
|
END
|
|
END
|
|
IRAY<3>=DATA.IO
|
|
IF DATA.IO='OFF' THEN GO 5390
|
|
5350 *
|
|
TSTRING1='JOB __'
|
|
TCOL=COL+22; TPOS=POS+8
|
|
CRT @(0,22):RV:"Enter the Job Code (default is 00)":ERV:CL
|
|
CRT @(TCOL,TPOS):TSTRING1
|
|
DATA.IO=OCONV(IRAY<3>,'G1-1')
|
|
INPUT @(TCOL+4,TPOS):DATA.IO
|
|
IF DATA.IO='<' THEN GO 5300
|
|
IF DATA.IO='/' OR DATA.IO='' THEN GO 5400
|
|
IF DATA.IO[1,1]='S' THEN
|
|
CRT @(0,22):CL:BEEP:RV:" SICK TIME IS OBSOLETE! <return> :":ERV:
|
|
INPUT ANY,4
|
|
GO 5350
|
|
END
|
|
READ ANY FROM JOB.FILE,DATA.IO THEN
|
|
JOB=DATA.IO
|
|
END ELSE
|
|
CRT @(0,22):BEEP:'INVALID JOB CODE! TRY AGAIN':
|
|
INPUT ANY
|
|
GO 5350
|
|
END
|
|
5390 *
|
|
*
|
|
CRT @(0,22):BEEP:RV:'Is This Correct? (Y/N) ':ERV:CL:
|
|
INPUT ANY
|
|
IF ANY='Y' THEN
|
|
IF MODIFY THEN
|
|
GOSUB 7000
|
|
END ELSE
|
|
GOSUB 6000
|
|
END
|
|
END ELSE
|
|
IRAY=''
|
|
END
|
|
5400 *
|
|
RETURN
|
|
5525 * 1/2 DRAW BOX
|
|
COL=0; POS=6
|
|
IF ADDS THEN
|
|
FOR X=POS TO 15
|
|
IF X=POS THEN
|
|
TSTRING1="#":STR("<",39):"D"
|
|
TCOL=COL+19; TPOS=X; GOSUB 2275
|
|
END ELSE
|
|
IF X=15 THEN
|
|
TSTRING1="B":STR("<",39):"F"
|
|
TCOL=COL+19; TPOS=X; GOSUB 2275
|
|
END ELSE
|
|
TSTRING1=">"
|
|
TCOL=COL+19; TPOS=X; GOSUB 2275
|
|
TSTRING1=STR(" ",39)
|
|
TCOL=COL+20; GOSUB 2285
|
|
TSTRING1=">"
|
|
TCOL=COL+59; GOSUB 2275
|
|
END
|
|
END
|
|
NEXT X
|
|
END ELSE
|
|
FOR X=POS TO 15
|
|
IF X=15 OR X=POS THEN
|
|
TSTRING1=RV:STR(" ",42):ERV
|
|
TCOL=COL+19; TPOS=X; GOSUB 2285
|
|
END ELSE
|
|
TSTRING1=RV:" ":ERV:STR(" ",40):RV:" ":ERV
|
|
TCOL=COL+19; TPOS=X; GOSUB 2285
|
|
END
|
|
NEXT X
|
|
END
|
|
RETURN
|
|
*
|
|
5600 *
|
|
IF IRAY='' THEN
|
|
TSTRING1='DATE ________'
|
|
END ELSE
|
|
TSTRING1='DATE ':OCONV(IRAY<1>,'D2/')
|
|
END
|
|
TCOL=COL+22; TPOS=POS+2
|
|
CRT @(TCOL,TPOS):TSTRING1
|
|
*
|
|
IF IRAY='' THEN
|
|
TSTRING1='TIME _____'
|
|
END ELSE
|
|
TSTRING1='TIME ':OCONV(IRAY<2>,'MTS')
|
|
END
|
|
TCOL=COL+22; TPOS=POS+4
|
|
CRT @(TCOL,TPOS):TSTRING1
|
|
*
|
|
IF IRAY='' THEN
|
|
TSTRING1='PROJECT ______'
|
|
END ELSE
|
|
TSTRING1='PROJECT ':OCONV(IRAY<3>,'G0-1')'L#6'
|
|
END
|
|
TCOL=COL+22; TPOS=POS+6
|
|
CRT @(TCOL,TPOS):TSTRING1
|
|
*
|
|
IF IRAY='' THEN
|
|
TSTRING1='JOB __'
|
|
END ELSE
|
|
TSTRING1='JOB ':OCONV(IRAY<3>,'G1-1')'L#2'
|
|
END
|
|
TCOL=COL+22; TPOS=POS+8
|
|
CRT @(TCOL,TPOS):TSTRING1
|
|
RETURN
|
|
**
|
|
6000 * HANDLE TIME DATA
|
|
**---------------------------------------*
|
|
** THIS PORTION OF LOGIC BUILDS THE TIMECLOCK ENTRIES
|
|
**
|
|
** CLOCKFILE RECORD LAYOUT AS FOLLOWS:
|
|
** <0> USER|DATE
|
|
** <1> TIME MV
|
|
** <2> PROJECT MV
|
|
**
|
|
**---------------------------------------*
|
|
*CRT @(0,22):CL:"AT 6000":
|
|
*INPUT ANY
|
|
CLKKEY=USER:"|":IRAY<1>
|
|
TIME=IRAY<2>
|
|
PRJCT=IRAY<3>
|
|
READ CLKREC FROM CLOCKFILE,CLKKEY THEN
|
|
LOCATE(TIME,CLKREC,1;LAST;'AR') THEN
|
|
IF CLKREC<2,LAST>='OFF' THEN
|
|
LAST=LAST+1
|
|
END
|
|
IF PRJCT='OFF' THEN
|
|
LAST=LAST+1
|
|
END
|
|
END
|
|
IF PRJCT='OFF' THEN
|
|
JRNL=SUPER:AM:DATE():AM:TIME():AM:"ADD":AM:"ADD":AM:TIME:AM:PRJCT
|
|
CLKREC=INSERT(CLKREC,1,LAST;TIME)
|
|
CLKREC=INSERT(CLKREC,2,LAST;PRJCT)
|
|
CRT @(0,22):UREC<1>:" is now OFF THE CLOCK!":CL:
|
|
RQM
|
|
END ELSE
|
|
IF NUM(JOB) THEN
|
|
JRNL=SUPER:AM:DATE():AM:TIME():AM:"ADD":AM:"ADD":AM:TIME:AM:PRJCT
|
|
CLKREC=INSERT(CLKREC,1,LAST;TIME)
|
|
CLKREC=INSERT(CLKREC,2,LAST;PRJCT:"-":JOB)
|
|
CRT @(0,22):UREC<1>:"'s record has been adjusted!":CL:
|
|
RQM
|
|
END ELSE
|
|
IF NUM(JOB) ELSE
|
|
IF NUM(JOB[2,1]) OR JOB[2,1]=0 THEN
|
|
JRNL=SUPER:AM:DATE():AM:TIME():AM:"ADD":AM:"ADD":AM:TIME:AM:PRJCT
|
|
CLKREC=INSERT(CLKREC,1,LAST;TIME:VM:TIME+(JOB[2,1]*3600))
|
|
CLKREC=INSERT(CLKREC,2,LAST;PRJCT:"-":JOB:VM:'OFF')
|
|
CRT @(0,22):UREC<1>:"'s record has been adjusted!":CL:
|
|
RQM
|
|
END
|
|
END
|
|
END
|
|
END
|
|
END ELSE
|
|
JRNL=SUPER:AM:DATE():AM:TIME():AM:"ADD":AM:"ADD":AM:TIME:AM:PRJCT
|
|
CLKREC=''
|
|
IF NUM(JOB) THEN
|
|
CLKREC=TIME
|
|
CLKREC<2>=PRJCT:'-':JOB
|
|
CRT @(0,22):UREC<1>:"'s record has been adusted!":CL:
|
|
RQM
|
|
END ELSE
|
|
IF NUM(JOB) ELSE
|
|
IF NUM(JOB[2,1]) OR JOB[2,1]=0 THEN
|
|
CLKREC=TIME:VM:TIME+(JOB[2,1]*3600)
|
|
CLKREC<2>=PRJCT:"-":JOB:VM:'OFF'
|
|
CRT @(0,22):UREC<1>:"'s record has been adjusted!":CL:
|
|
RQM
|
|
END
|
|
END
|
|
END
|
|
END
|
|
GOSUB 9000
|
|
6999 *
|
|
RETURN
|
|
*
|
|
7000 *
|
|
*CRT @(0,22):CL:"AT 7000":
|
|
*INPUT ANY
|
|
CLKKEY=USER:"|":IRAY<1>
|
|
TIME=IRAY<2>
|
|
PRJCT=IRAY<3>
|
|
READ CLKREC FROM CLOCKFILE,CLKKEY THEN
|
|
JRNL=SUPER:AM:DATE():AM:TIME():AM:CLKREC<1,ANS>:AM:CLKREC<2,ANS>:AM:TIME:AM:PRJCT
|
|
CDONE=0
|
|
CNT=DCOUNT(CLKREC<1>,VM)
|
|
FOR C=1 TO CNT UNTIL CDONE
|
|
IF CLKREC<1,C>=ZRAY<2,ANS> THEN
|
|
IF CLKREC<2,C>=ZRAY<3,ANS> THEN
|
|
CLKREC=DELETE(CLKREC,1,C)
|
|
CLKREC=DELETE(CLKREC,2,C)
|
|
CDONE=1
|
|
END
|
|
END
|
|
NEXT C
|
|
LOCATE(TIME,CLKREC,1;LAST;'AR') THEN
|
|
IF CLKREC<2,LAST>='OFF' THEN
|
|
LAST=LAST+1
|
|
END
|
|
IF PRJCT='OFF' THEN
|
|
LAST=LAST+1
|
|
END
|
|
END
|
|
IF PRJCT='OFF' THEN
|
|
CLKREC=INSERT(CLKREC,1,LAST;TIME)
|
|
CLKREC=INSERT(CLKREC,2,LAST;PRJCT)
|
|
CRT @(0,22):UREC<1>:" is now OFF THE CLOCK!":CL:
|
|
RQM
|
|
END ELSE
|
|
CLKREC=INSERT(CLKREC,1,LAST;TIME)
|
|
CLKREC=INSERT(CLKREC,2,LAST;PRJCT:"-":JOB)
|
|
CRT @(0,22):UREC<1>:"'s record has been adjusted!":CL:
|
|
RQM
|
|
END
|
|
END ELSE
|
|
CLKREC=''
|
|
CLKREC=TIME
|
|
CLKREC<2>=PRJCT:'-':JOB
|
|
CRT @(0,22):UREC<1>:"'s record has been adusted!":CL:
|
|
RQM
|
|
END
|
|
GOSUB 9000
|
|
7999 *
|
|
RETURN
|
|
*
|
|
8000 *
|
|
CRT @(0,22):BEEP:"Are you Sure??":CL:
|
|
INPUT ANY
|
|
IF ANY='Y' OR ANY='y' THEN
|
|
CLKKEY=USER:"|":IRAY<1>
|
|
TIME=IRAY<2>
|
|
PRJCT=IRAY<3>
|
|
READ CLKREC FROM CLOCKFILE,CLKKEY THEN
|
|
JRNL=SUPER:AM:DATE():AM:TIME():AM:CLKREC<1,ANS>:AM:CLKREC<2,ANS>:AM:"DEL":AM:"DEL"
|
|
CDONE=0
|
|
CNT=DCOUNT(CLKREC<1>,VM)
|
|
FOR C=1 TO CNT UNTIL CDONE
|
|
IF CLKREC<1,C>=ZRAY<2,ANS> THEN
|
|
IF CLKREC<2,C>=ZRAY<3,ANS> THEN
|
|
CLKREC=DELETE(CLKREC,1,C)
|
|
CLKREC=DELETE(CLKREC,2,C)
|
|
CDONE=1
|
|
END
|
|
END
|
|
NEXT C
|
|
GOSUB 9000
|
|
END
|
|
END
|
|
RETURN
|
|
*
|
|
9000 * TIMECLOCK JOURNAL
|
|
* THIS JOURNAL RECORD IS WRITTEN TO PROVIDE AN AUDIT TRAIL FOR SUPERVISOR
|
|
* ADJUSTMENTS TO THE TIMECLOCK RECORD.
|
|
*
|
|
*CRT @(0,22):CL:"AT 9000":
|
|
*INPUT ANY
|
|
FOR J=1 TO 7
|
|
CLKREC=INSERT(CLKREC,J+2,1;JRNL<J>)
|
|
NEXT J
|
|
WRITE CLKREC ON CLOCKFILE,CLKKEY
|
|
JRNL=''
|
|
RETURN
|
|
9999 * END OF PROCESS
|
|
STOP
|