tldm-universe/CMS/BP.CLOCK/KC.CLOCK.RECORD
2024-09-10 15:25:06 -04:00

165 lines
3.0 KiB
Plaintext
Executable File

*
*CLOCK.RECORD.DAY
*REPORT BY TIME PERIOD BY DAY
*
$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/")
TLN=TLN:SPACE(65)
TLN=TLN:OCONV(TIME(),"MTH")
CRT @(0,0):TLN
*
HD="INTERNAL DATA MANAGEMENT"
HDLEN=LEN(HD)
X=(40-(HDLEN/2))
HD=SPACE(X):HD
CRT@(0,1):HD
*
LN0=STR("*",40)
LN0=SPACE(20):LN0
CRT@(0,2):LN0
*
H1="HOURLY RECORD BY PAY PERIOD:"
H1LEN=LEN(H1)
X=(40-(H1LEN/2))
H1=SPACE(X):H1
CRT@(0,3):H1
*
LN1=STR("*",60)
LN1=SPACE(10):LN1
CRT@(0,4):LN1
*
10*
CRT@(0,5):CR
CRT@(0,5):"ENTER FIRST DATE:":
INPUT DFIRST
CRT@(0,6):"IS THIS DATE CORRECT?(Y OR N)?":
INPUT ANSWER, 1
IF ANSWER = 'N' THEN GO 10
IF DFIRST='' OR DFIRST=PF3 THEN GO 3000
DFIRST=ICONV(DFIRST,'D')
IF REM(8533-DFIRST,14)=0 THEN
PRINT OCONV(DFIRST,"D2/")
END ELSE
CRT @(0,7):"DATE NOT VALID--ENTRY MUST BE DAY ONE OF PAY PERIOD"
SLEEP2
GO 10
END
20*
*
DLAST=DFIRST + 13
CRT @(0,7):"ENDING DATE OF TIME PERIOD IS :": OCONV(DLAST,"D2/")
SLEEP2
CRT@(0,7):CR
*
IF DLAST='' OR DLAST=PF3 THEN GO 3000
*
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,3):H2
*
LNCT=65
*
LN2="EMPLOYEE #"'L#10'
LN2=LN2:SPACE(6)
LN2=LN2:"NAME"'L#21'
LN2=LN2:SPACE(6)
LN2=LN2:"DATE"'L#8'
LN2=LN2:SPACE(4)
LN2=LN2:"HOURS"'L#5'
LN2=LN2:SPACE(2)
CRT@(0,5):LN2
*
LN3="**********"'L#10'
LN3=LN3:SPACE(6)
LN3=LN3:"****"'L#21'
LN3=LN3:SPACE(6)
LN3=LN3:"****"'L#8'
LN3=LN3:SPACE(4)
LN3=LN3:"*****"'L#5'
LN3=LN3:SPACE(2)
CRT@(0,6):LN3
*
PRINTER ON
*
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 (R,20\
EXECUTE LINE
*
100 READNEXT CLOCKFILE.KEY ELSE GO 3000
READ CLOCK.REC FROM CLOCKFILE,CLOCKFILE.KEY ELSE GO 100
GRAND = 0
*
DATE=FIELD(CLOCKFILE.KEY,'|',2)
IF DATE < DFIRST OR DATE > DLAST THEN GO 100
*CRT @(0,12):CR
ENTRY.CT=DCOUNT(CLOCK.REC<TC$TIMES>,VM)
IF ENTRY.CT=0 THEN ENTRY.CT=1
FOR X=1 TO ENTRY.CT STEP 2
INTIME = CLOCK.REC<1,X>
OUTTIME = CLOCK.REC<1,X+1>
GRAND = GRAND + (OUTTIME - INTIME)
*IF GRAND < 0 THEN GRAND=0
* CRT@(0,14):CLOCKFILE.KEY:'/':GRAND
NEXT X
USER.KEY=FIELD(CLOCKFILE.KEY,'|',1)
READ USER.REC FROM USER,USER.KEY ELSE USER.REC=''
LN=USER.REC<US$EMPNO>'L#12'
LN=LN:SPACE(2)
NAME=USER.REC<US$LNAME>:",":USER.REC<US$FNAME>[1,1]:"."
LN=LN:NAME'L#25'
LN=LN:SPACE(2)
LN=LN:OCONV(DATE,"D2/") 'L#12'
LN=LN:SPACE(2)
LN=LN:OCONV(GRAND,'MT')'L#8'
LN=LN:SPACE(2)
200 *
GOSUB 2000
GO 100
2000 *
IF LNCT > 50 THEN
PRINT CHAR(12)
PRINT TLN
PRINT HD
PRINT LN0
PRINT H2
PRINT LN1
PRINT LN2
PRINT LN3
LNCT=0
END
*CRT@(0,20):LN
PRINT LN
LNCT=LNCT+1
LN=''
RETURN
*
3000 *
CRT@(0,22):CL:"PROCESS COMPLETE - IT'S BEEN A PLEASURE - HIT RETURN:":
INPUT DUMMY
PRINTER OFF
STOP
*
*