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

275 lines
7.7 KiB
Plaintext
Raw Normal View History

2024-09-10 19:25:06 +00:00
* CLOCK.ABSENT.RPT
* AUTHOR : AL SURLES
* DATE : 26 AUG 91
* PURPOSE : To list individuals who where absent in
* whole or part of a day.
* UPDATES :
* 7-1-92 BY J. LONGLEY: LINES 116-118 ADDED TO PRINT OUT HOURS & MINUTES
* 08-06-92 SRM : ADDED DEPT OR INDIVIDUAL CAPABILITY AND ALLOWED BACKUP
* TO PREVIOUS FIELD CAPABILITY, ALSO REARRANGED SCREEN
* SLIGHTLY SO COUNTER DISPLAY DOES NOT WIPE OUT CHOICES
* TAKEN.
*******************************************************
$INCLUDE BP GEN.COM2
*******************************************************
CHK=0; FND=0
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):"CLOCK.ABSENT.RPT" ; * PRINT PGM NAME
CRT @(24,4):RV:" LIST PERSONNEL WHO WERE ABSENT ":ERV
CRT @(28,5):RV:" ALL OR PART OF THE DAY ":ERV
*******************************************************
OPEN 'CLOCKFILE' TO CLF ELSE ABORT 201,"CLOCKFILE"
OPEN 'USER' TO USER ELSE ABORT 201,"USER"
OPEN 'ABSENT.WORKFILE' TO ABW ELSE
EXECUTE "CREATE-FILE DATA ABSENT.WORKFILE 11"
OPEN 'ABSENT.WORKFILE' TO ABW ELSE ABORT 201,"ABSENT.WORKFILE"
END
*******************************************************
10 *
LOOP
CRT @(0,7):CR:"Enter beginning date (MM/DD/YY) : ":
MSG="Enter '/' to Escape"; GOSUB 3000
INPUT @(40,7):BEG.DATE
IF BEG.DATE="" OR BEG.DATE="/" THEN GO 999
UNTIL ICONV(BEG.DATE,'D') # "" DO REPEAT
DATE.LIMIT1=ICONV(BEG.DATE,"D")
CRT @(40,7):OCONV(DATE.LIMIT1,'D2/'):
*******************************************************
15 *
LOOP
CRT @(0,9):CR:"Enter ending date (MM/DD/YY) : ":
MSG="Enter '/' to Escape or '<' to backup to previous field"; GOSUB 3000
INPUT @(40,9):END.DATE
IF END.DATE="" OR END.DATE="/" THEN GO 999
IF END.DATE='<' THEN GO 10
UNTIL ICONV(END.DATE,'D') # "" DO REPEAT
DATE.LIMIT2=ICONV(END.DATE,"D")
CRT @(40,9):OCONV(DATE.LIMIT2,'D2/'):
*
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
*******************************************************
20 *
DEPTINDIV="D"
LOOP
CRT @(0,11):CR:"Enter DEPT or INDIVIDUAL (D/I) : ":
MSG="Enter '/' to Escape or '<' to backup to previous field"; GOSUB 3000
INPUT @(40,11):DEPTINDIV
IF DEPTINDIV="" OR DEPTINDIV="/" THEN GO 999
IF DEPTINDIV="<" THEN GO 15
UNTIL DEPTINDIV="D" OR DEPTINDIV="I" DO REPEAT
IF DEPTINDIV='D' THEN
CRT @(40,11):"DEPARTMENT"
GO 30
END ELSE
CRT @(40,11):"INDIVIDUAL"
GO 40
END
*******************************************************
30 *
DEPT.RESPONSE=''
CRT @(0,13):CR:"Enter DEPARTMENT OR 'ALL' (EX : 504) : ":
MSG="Enter '/' to Escape or '<' to backup to previous field"; GOSUB 3000
INPUT @(40,13):DEPT.RESPONSE
IF DEPT.RESPONSE="" OR DEPT.RESPONSE="/" THEN GO 999
IF DEPT.RESPONSE="<" THEN GO 20
DEPT=DEPT.RESPONSE
GO 50
*******************************************************
40 *
INDIV=''
CRT @(0,13):CR:"Enter INDIVIDUAL USER # (EX : 9999) : ":
MSG="Enter '/' to Escape or '<' to backup to previous field"; GOSUB 3000
INPUT @(40,13):INDIV
IF INDIV="" OR INDIV="/" THEN GO 999
IF INDIV="<" THEN GO 20
READ ANY FROM USER,INDIV THEN
DISP=' ':ANY<1>:' ':ANY<2>:' '
CRT @(45,13):RV:DISP[1,23]:ERV
END ELSE
CRT @(0,22):BEEP:RV:" This is not a VALID USER # - Try Again ":ERV:
RQM; RQM
GO 40
END
GO 50
*******************************************************
50 *
OUTPUT.RESPONSE="Y"
CRT @(10,15):CR:" OUTPUT TO PRINTER (Y/N) : ":
MSG="Enter '/' to Escape or '<' to backup to previous field"; GOSUB 3000
INPUT @(40,15):OUTPUT.RESPONSE
IF OUTPUT.RESPONSE="" OR OUTPUT.RESPONSE="/" THEN GO 999
IF OUTPUT.RESPONSE="<" THEN
IF DEPTINDIV="I" THEN GO 30 ELSE GO 40
END
GOSUB 1000
*******************************************************
IF DEPTINDIV="D" THEN
HD="PERSONNEL in DEPT '":DEPT.RESPONSE:"' that were ABSENT in WHOLE or PART"
END ELSE
HD="INDIVIDUAL # '":INDIV:"' that was ABSENT in WHOLE or PART"
END
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 ":OCONV(DATE.LIMIT1,'D2/'):" - ":OCONV(DATE.LIMIT2,'D2/')
HDLN3=SPACE(60):"HOURS"
HDLN4='USER #':SPACE(4):'FULL NAME':SPACE(21):'DAY':SPACE(7):'DATE':SPACE(6):'WORKED':SPACE(3):'DEPARTMENT'
*******************************************************
CLEARFILE ABW
EOF=0
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")
KEY=OCONV(ID,"G0|1")
IF DEPTINDIV='I' THEN IF INDIV NE KEY THEN GO 100
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")
USER.REC=""
READ USER.REC FROM USER,KEY THEN
IF DEPTINDIV='D' THEN
IF DEPT.RESPONSE # 'ALL' THEN
IF DEPT.RESPONSE # USER.REC<5> THEN GO 100
END
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.REC<5>=OCONV(TM,"MT")
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 ABW,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
EXECUTE 'SP-ASSIGN HS'
END
GOSUB 2000
PRINTER OFF
PRINT
PRINT @(0,22):CL:RV:" JOB COMPLETED - HIT RETURN ":ERV:
INPUT DUMMY
999 * END OF JOB
EXECUTE "DELETE-FILE DATA ABSENT.WORKFILE"
STOP
*
*******************************************************
1000 * REFRESH SCREEN
*
CRT @(0,16):CR
CRT @(24,18):"NUMBER OF RECORDS CHECKED :":CHK
CRT @(24,20):"NUMBER OF RECORDS FOUND :":FND:
RETURN
*******************************************************
2000 * PRINT ITEM
PCNT=0
STR=STR("=",79)
STR1=STR("-",79)
PGCNT=1
PGHED=0
EOF=0
EXECUTE "SSELECT ABSENT.WORKFILE BY DEPT BY DATE"
* EXECUTE "SSELECT ABSENT.WORKFILE BY LNAME BY DATE (R,1"
LOOP
READNEXT KEY ELSE EOF=1
UNTIL EOF DO
READ ABW.REC FROM ABW,KEY THEN
* IF PCNT >=17 THEN
* PRINT CHAR(12)
* PCNT=0
* PGHED=0
* END
IF PGHED ELSE
PRINT CHAR(12)
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
PCNT=0
END
*HERE
PRINT ABW.REC<1>'L#10':ABW.REC<2>'L#30':ABW.REC<3>[1,3]'L#8':ABW.REC<4>'L#12':ABW.REC<5>'L#9':ABW.REC<6>'L#5'
PRINT
PRINT STR1
PCNT=PCNT+1
IF OUTPUT.RESPONSE="N" THEN
IF REM(PCNT,4)=0 THEN
CRT RV:" HIT RETURN TO CONTINUE ":ERV:
INPUT ANY
CRT CS
PGHED=0
END
END ELSE
IF REM(PCNT,17)=0 THEN
PGHED=0
END
END
END
REPEAT
RETURN
*******************************************************
3000 *
MSGL=(80-LEN(MSG))/2
CRT @(MSGL,20):MSG:
RETURN
*******************************************************