tldm-universe/CMS/BP.CLOCK/PRESENT.RPT

207 lines
5.7 KiB
Plaintext
Raw Normal View History

2024-09-10 19:25:06 +00:00
* JRL.PRESENT.RPT
* AUTHOR : AL SURLES
* DATE : 26 AUG 91
* MODIFIED ON JUNE 26, 1992 BY JOHN LONGLEY
* REPLACED CODE TO IMPUTE BEGIN AND ENDING DATES
* PURPOSE : To list individuals who where present in
* whole or part of a day.
* UPDATES :
*******************************************************
$INCLUDE BP GEN.COM2
*******************************************************
WHO=ICONV('','U50BB')
OPR=FIELD(WHO,' ',2)
PORT=FIELD(WHO,' ',1)
HD="** CLOCK.MASTER **"
HDL=(80-LEN(HD))/2
HD2=TIMEDATE()
HDL2=79-LEN(TIMEDATE())
STR80=STR('=',80)
CRT @(-1) ; * CLEAR SCREEN
CRT @(HDL,0):HD ; * PRINT ACCT NAME IN HL
CRT @(0,0):"MASTER SOFTWARE DESIGN, INC."
CRT @(HDL2,0):HD2 ; * PRINT TIME AND DATE
CRT @(0,1):STR80 ; * PRINT "=" 80 TIMES
CRT @(0,2):"JRL.PRESENT.RPT" ; * PRINT PGM NAME
CRT @(24,4):RV:" LIST PERSONNEL WHO WERE PRESENT ":ERV
*******************************************************
OPEN 'CLOCKFILE' TO CLF ELSE ABORT 201,"CLOCKFILE"
OPEN 'USER' TO USER ELSE ABORT 201,"USER"
OPEN 'PRESENT.WORKFILE' TO PRW ELSE
EXECUTE "CREATE-FILE DATA PRESENT.WORKFILE 11"
OPEN 'PRESENT.WORKFILE' TO PRW ELSE ABORT 201,"PRESENT.WORKFILE"
END
*******************************************************
*10 *
* LOOP
* PRINT @(0,6):CR:"Enter beginning date (MM/DD/YY) : ":
* INPUT BEG.DATE
* IF BEG.DATE="" OR BEG.DATE="/" THEN GO 999
* UNTIL ICONV(BEG.DATE,'DJ') # "" DO REPEAT
DATE.LIMIT1=ICONV(LIMIT1,"DJ")
* LOOP
* PRINT @(0,10):CL:"Enter ending date (MM/DD/YY) : ":
* INPUT END.DATE
* UNTIL ICONV(END.DATE,'DJ') # "" DO REPEAT
DATE.LIMIT2=ICONV(LIMIT2,"DJ")
* IF DATE.LIMIT1 > DATE.LIMIT2 THEN
* CRT @(0,22):BEEP:RV:" The beginning date is greater than ending date - error ":ERV
* RQM ; RQM
* GO 10
*END
*******************************************************
10 *
CRT @(0,8):"Enter Beginning Date: ":
INPUT BEG.DATE
IF BEG.DATE="/" THEN STOP ELSE IF ICONV(BEG.DATE,"DJ")="" THEN GO 10
BEG.DATE=ICONV(BEG.DATE,"DJ")
PRINT @(22,8):OCONV(BEG.DATE,"D2/")
20 *
CRT @(0,10):"Enter Ending Date: ":
INPUT END.DATE
IF END.DATE="/" THEN STOP ELSE IF ICONV(END.DATE,"DJ")="" THEN GO 20
END.DATE=ICONV(END.DATE,"DJ")
PRINT @(19,10):OCONV(END.DATE,"D2/")
IF END.DATE < BEG.DATE THEN GO 10
*******************************************************
SPEC.DEPT.FLAG=0
DEPT.RESPONSE=''
CRT @(0,13):"Enter DEPARTMENT OR 'ALL' (EX : 500) : ":
INPUT DEPT.RESPONSE
IF DEPT.RESPONSE = "" OR DEPT.RESPONSE = PF3 THEN GO 999
DEPT=DEPT.RESPONSE
OUTPUT.RESPONSE=''
CRT @(10,15):" OUTPUT TO PRINTER (Y/N) : ":
INPUT OUTPUT.RESPONSE
HD='LIST OF PERSONNEL THAT WERE PRESENT PART OF THE DAY'
LNG=LEN(HD)
XLNG=63-LNG
YLNG=XLNG/2
XLNG=YLNG
IF XLNG+YLNG+LNG > 80 THEN YLNG=YLNG-1 ; * IN CASE IS 1 TO LONG
HDLN1=SPACE(28):"INTERNAL DATA MANAGEMENT"
HDLN2=SPACE(24):"FROM ":BEG.DATE:" - ":END.DATE
HDLN3=SPACE(60):"HOURS"
HDLN4='USER #':SPACE(4):'FULL NAME':SPACE(21):'DAY':SPACE(7):'DATE':SPACE(6):'WORKED':SPACE(4):'DEPARTMENT'
*******************************************************
CLEARFILE PRW
EOF=0
FND=0
CHK=0
*GO 99
SELECT CLF
LOOP
READNEXT ID ELSE EOF=1
UNTIL EOF DO
TM=0
CHK=CHK+1
CLF.REC=""
READ CLF.REC FROM CLF,ID THEN
REC.DATE=OCONV(ID,"G1|1")
IF REC.DATE >= DATE.LIMIT1 AND REC.DATE <= DATE.LIMIT2 THEN
TR.CNT=DCOUNT(CLF.REC<1>,VM)
FOR B=1 TO TR.CNT
Y=B+1
FOR Z=Y TO TR.CNT
IF CLF.REC<2,Z> = "OFF" THEN
TM=TM+(CLF.REC<1,Z>-CLF.REC<1,B>)
B=Z
Z=9999
END
NEXT Z
NEXT B
IF TM < 25200 THEN
KEY=OCONV(ID,"G0|1")
USR.REC=""
USER.REC=""
READ USER.REC FROM USER,KEY THEN
IF DEPT.RESPONSE # 'ALL' THEN
IF DEPT.RESPONSE # USER.REC<5> THEN GO 100
END
WORK.REC=""
WORK.REC<1>=KEY
WORK.REC<2>=TRIM(USER.REC<1>:" ":USER.REC<2>)
WORK.REC<3>=OCONV(REC.DATE,"DWA")
WORK.REC<4>=OCONV(REC.DATE,"D2/")
WORK.TM=TM/60
WORK.REC<5>=WORK.TM/60
TEMP=WORK.REC<5>-INT(WORK.REC<5>)
TEMP=INT(TEMP*60)
WORK.REC<5>=INT(WORK.REC<5>): ":" : TEMP'R%2'
WORK.REC<6>=USER.REC<5>
WRITE WORK.REC ON PRW,ID
FND=FND+1
END
END
END
END
100 *
IF REM(CHK,500)=0 THEN GOSUB 1000
REPEAT
GOSUB 1000
99 *
IF OUTPUT.RESPONSE="Y" THEN PRINTER ON
GOSUB 2000
PRINTER OFF
PRINT @(0,22):CL:RV:" JOB COMPLETED - HIT RETURN ":ERV:
INPUT DUMMY
999 * END OF JOB
EXECUTE "DELETE-FILE DATA PRESENT.WORKFILE"
STOP
*
*******************************************************
1000 * REFRESH SCREEN
*
CRT @(0,6):CR
CRT @(24,10):"NUMBER OF RECORDS CHECKED :":CHK
CRT @(24,12):"NUMBER OF RECORDS FOUND :":FND
RETURN
*******************************************************
2000 * PRINT ITEM
EXECUTE "SP-ASSIGN HS"
PCNT=0
STR=STR("=",80)
STR1=STR("-",80)
PGCNT=1
PGHED=0
EOF=0
EXECUTE "SSELECT PRESENT.WORKFILE BY DEPT BY DATE (R,1"
LOOP
READNEXT KEY ELSE EOF=1
UNTIL EOF DO
READ PRW.REC FROM PRW,KEY THEN
IF PCNT >=17 THEN
PRINT CHAR(12)
PCNT=0
PGHED=0
END
IF PGHED ELSE
PRINT HDLN1
PRINT
HDLN=OCONV(DATE(),"D2"):SPACE(XLNG):HD:SPACE(YLNG):"PAGE ":PGCNT'R#3'
PRINT HDLN
PRINT HDLN2
PRINT
PRINT HDLN3
PRINT HDLN4
PRINT STR
PRINT
PGCNT=PGCNT+1
PGHED=1
END
PRINT PRW.REC<1>'L#10':PRW.REC<2>'L#30':PRW.REC<3>[1,3]'L#8':PRW.REC<4>'L#12':PRW.REC<5>'L#10':PRW.REC<6>'L#10'
PRINT
PRINT STR1
PCNT=PCNT+1
IF OUTPUT.RESPONSE = "N" THEN
IF REM(PCNT,10)=0 THEN
PRINT @(0,22):CL:RV:" HIT RETURN TO CONTINUE ":ERV:
INPUT DUMMY
END
END
END
REPEAT
PRINT CHAR(12)
RETURN
*******************************************************