189 lines
3.8 KiB
Plaintext
Executable File
189 lines
3.8 KiB
Plaintext
Executable File
*HOURLY.REPORT
|
|
*
|
|
*HOURLY REPORT BY TIME PERIOD
|
|
*05/22/91:DATE LAST MODIFIED
|
|
*KJC
|
|
*
|
|
$INCLUDE GEN.COMMON
|
|
*
|
|
OPEN 'CLOCKFILE' TO CLOCKFILE ELSE ABORT 201,"NO CLOCKFILE FILE"
|
|
OPEN 'USER' TO USER ELSE ABORT 201, "NO USER FILE"
|
|
*
|
|
EQU TC$KEY TO 0
|
|
EQU TC$TIMES TO 1
|
|
EQU TC$PROJECT TO 2
|
|
EQU US$KEY TO 0
|
|
EQU US$FNAME TO 1
|
|
EQU US$LNAME TO 2
|
|
EQU US$PASSWORD TO 3
|
|
EQU US$EMPNO TO 6
|
|
*
|
|
CRT CS
|
|
*****************************************************************
|
|
TLN=OCONV(DATE(),"D2/")
|
|
HD="INTERNAL DATA MANAGEMENT"
|
|
HDLEN=LEN(HD)
|
|
X=(40-(HDLEN/2))-8
|
|
TLN=TLN:SPACE(X)
|
|
TLN=TLN:HD
|
|
TLN=TLN:SPACE(X)
|
|
TLN=TLN:OCONV(TIME(),"MTH")
|
|
CRT@(0,0):TLN
|
|
*
|
|
H1="HOURLY RECORD BY PAY PERIOD:"
|
|
H1LEN=LEN(H1)
|
|
X=(40-(H1LEN/2))
|
|
H1=SPACE(X):H1
|
|
CRT@(0,1):H1
|
|
*
|
|
***************************************************************
|
|
10*
|
|
CRT@(0,5):CR
|
|
CRT@(0,5):"ENTER FIRST DATE:":
|
|
INPUT DFIRST
|
|
IF DFIRST='' OR DFIRST=PF3 THEN GO 4000
|
|
DFIRST=ICONV(DFIRST,'D')
|
|
IF REM(8533-DFIRST,14)=0 THEN
|
|
CRT@(0,5):"ENTER FIRST DATE:":OCONV(DFIRST,"D2/")
|
|
END ELSE
|
|
CRT @(0,7):"DATE NOT VALID--ENTRY MUST BE DAY ONE OF PAY PERIOD"
|
|
SLEEP2
|
|
GO 10
|
|
END
|
|
CRT@(0,5):"ENTER FIRST DATE:":OCONV(DFIRST,"D2/")
|
|
20*
|
|
*
|
|
DLAST=DFIRST + 13
|
|
CRT @(0,7):"ENDING DATE OF TIME PERIOD IS :": OCONV(DLAST,"D2/")
|
|
CRT@(0,9):"IS THIS DATE CORRECT(Y OR N)?":
|
|
INPUT ANSWER, 1
|
|
IF ANSWER = 'N' THEN GO 10
|
|
CRT @(0,11):"OUTPUT TO PRINTER (Y OR N)?":
|
|
INPUT PRINT.ANS, 1
|
|
IF PRINT.ANS = "Y" THEN
|
|
PRINTER ON
|
|
MAXCT=60
|
|
LNCT=65
|
|
END ELSE
|
|
MAXCT=18
|
|
LNCT=3
|
|
END
|
|
CRT@(0,6):CR
|
|
******************************************************************
|
|
H2="HOURLY RECORD BY PAY PERIOD: ":OCONV(DFIRST,"D2/")
|
|
H2=H2:" THROUGH ":OCONV(DLAST,"D2/")
|
|
H2LEN=LEN(H2)
|
|
X=(40-(H2LEN/2))
|
|
H2=SPACE(X):H2
|
|
CRT@(0,1):H2
|
|
*
|
|
LN2=SPACE(4)
|
|
LN2=LN2:"EMPLOYEE #"'L#10'
|
|
LN2=LN2:SPACE(5)
|
|
LN2=LN2:"USER # "'L#6'
|
|
LN2=LN2:SPACE(9)
|
|
LN2=LN2:"NAME"'L#23'
|
|
LN2=LN2:SPACE(4)
|
|
LN2=LN2:"HOURS"'L#5'
|
|
LN2=LN2:SPACE(2)
|
|
CRT@(0,2):LN2
|
|
*
|
|
LN3=STR("*",80)
|
|
CRT@(0,3):LN3
|
|
********************************************************************
|
|
LDFIRST=OCONV(DFIRST,'D2/')
|
|
LDLAST=OCONV(DLAST,'D2/')
|
|
LINE=\SSELECT CLOCKFILE WITH DATE GE "\
|
|
LINE=LINE:LDFIRST
|
|
LINE=LINE:\" AND WITH DATE LE "\
|
|
LINE=LINE:LDLAST
|
|
LINE=LINE:\" BY EMPNO BY DATE (R,20\
|
|
EXECUTE LINE
|
|
* ;*EXECUTE\GET-LIST KCC\ ;*FOR TEST PURPOSES
|
|
CRT @(0,5):CR
|
|
LAST.KEY=''
|
|
GRAND=0
|
|
*
|
|
100 READNEXT CLOCKFILE.KEY ELSE GO 3000
|
|
READ CLOCK.REC FROM CLOCKFILE,CLOCKFILE.KEY ELSE GO 100
|
|
USER.KEY=FIELD(CLOCKFILE.KEY,'|',1)
|
|
DATE=FIELD(CLOCKFILE.KEY,'|',2)
|
|
IF DATE < DFIRST OR DATE > DLAST THEN GO 100
|
|
*
|
|
IF USER.KEY#LAST.KEY AND LAST.KEY # '' THEN
|
|
GOSUB 200
|
|
GRAND=0
|
|
END
|
|
IF GRAND="INVALID" THEN GO 100
|
|
*
|
|
150*
|
|
*
|
|
LAST.KEY=USER.KEY
|
|
*
|
|
ENTRY.CT=0
|
|
ENTRY.CT=DCOUNT(CLOCK.REC<TC$TIMES>,VM)
|
|
*
|
|
*--- DO I HAVE A PROBLEM? ---*
|
|
IF REM(ENTRY.CT,2)#0 THEN
|
|
GRAND='INVALID'
|
|
GO 100
|
|
END
|
|
*
|
|
FOR X=1 TO ENTRY.CT STEP 2
|
|
INTIME = CLOCK.REC<1,X>
|
|
OUTTIME = CLOCK.REC<1,X+1>
|
|
IF NOT(OUTTIME MATCHES "0N") THEN CRT 'ERROR : ':OUTTIME:' RETURN: ': ; INPUT D
|
|
GRAND = GRAND + (OUTTIME - INTIME)
|
|
NEXT X
|
|
GO 100
|
|
*
|
|
200 *
|
|
READ USER.REC FROM USER,LAST.KEY ELSE USER.REC=''
|
|
***********************************************************
|
|
LN=SPACE(5)
|
|
LN=LN:USER.REC<US$EMPNO>'L#12'
|
|
LN=LN:SPACE(2)
|
|
LN=LN:LAST.KEY'L#10'
|
|
LN=LN:SPACE(3)
|
|
NAME=USER.REC<US$LNAME>:",":USER.REC<US$FNAME>[1,1]:"."
|
|
LN=LN:NAME'L#25'
|
|
LN=LN:SPACE(2)
|
|
*
|
|
IF GRAND='INVALID' THEN
|
|
LN=LN:"INVALID TOTAL"
|
|
LN=LN:SPACE(5)
|
|
END ELSE
|
|
LN=LN:OCONV(GRAND,'MT')'L#8'
|
|
LN=LN:SPACE(10)
|
|
END
|
|
*GOSUB 8000
|
|
*RETURN
|
|
***********************************************************
|
|
*8000 *
|
|
IF LNCT > MAXCT THEN
|
|
IF PRINT.ANS # 'Y' THEN
|
|
CRT@(0,22):"HIT RETURN TO CONTINUE":
|
|
INPUT DUMMY
|
|
END
|
|
PRINT CHAR(12)
|
|
PRINT TLN
|
|
PRINT H2
|
|
PRINT LN2
|
|
PRINT LN3
|
|
LNCT=4
|
|
END
|
|
PRINT LN
|
|
LNCT=LNCT+1
|
|
LN=''
|
|
RETURN
|
|
*
|
|
3000 *
|
|
GOSUB 200
|
|
4000 *
|
|
CRT@(0,23)CL:"PROCESS COMPLETE - IT'S BEEN A PLEASURE - HIT RETURN:":
|
|
INPUT DUMMY
|
|
IF PRINT.ANS = 'Y' THEN
|
|
PRINTER OFF
|
|
END
|
|
STOP
|