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

192 lines
5.1 KiB
Plaintext
Executable File

* IND.ABSENT.RPT
* AUTHOR : AL SURLES
* MODIFIED BY JOHN LONGLEY ON 9-17-91
* DATE : 26 AUG 91
* PURPOSE : To list the dates an individual was absent
* during a specific time period.
* 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):"IND.ABSENT.RPT" ; * PRINT PGM NAME
CRT @(24,4):RV:" THE INDIVIDUAL WHO WAS ABSENT ":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
PRINT @(0,6):CR:"Enter beginning date (MM/DD/YY) : ":
INPUT BEG.DATE
IF BEG.DATE="" OR BEG.DATE="/" THEN GO 999
UNTIL BEG.DATE MATCHES "0N/0N/0N" DO REPEAT
DATE.LIMIT1=ICONV(BEG.DATE,"D")
LOOP
PRINT @(0,10):CL:"Enter ending date (MM/DD/YY) : ":
INPUT END.DATE
IF END.DATE="" OR END.DATE="/" THEN GO 999
UNTIL END.DATE MATCHES "0N/0N/0N" DO REPEAT
DATE.LIMIT2=ICONV(END.DATE,"D")
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
*******************************************************
SPEC.DEPT.FLAG=0
USER.RESPONSE=''
CRT @(0,13):"Enter the USER's 4-digit code number (EX : 9999) : ":
INPUT USER.RESPONSE
IF USER.RESPONSE = "" OR USER.RESPONSE = PF3 THEN GO 999
DEPT=USER.RESPONSE
OUTPUT.RESPONSE=''
CRT @(10,15):" OUTPUT TO PRINTER (Y/N) : ":
INPUT OUTPUT.RESPONSE
HD='NAME OF INDIVIDUAL WHO WAS ABSENT DURING TIME SPAN'
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 ABW
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 USER.RESPONSE # 'ALL' THEN
IF USER.RESPONSE # USER.REC<0> 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.REC<5>=OCONV(TM,"MT")
WORK.TM=TM/60
WORK.REC<5>=WORK.TM/60
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
GOSUB 2000
PRINTER OFF
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,6):CR
CRT @(24,10):"NUMBER OF RECORDS CHECKED :":CHK
CRT @(24,12):"NUMBER OF RECORDS FOUND :":FND
RETURN
*******************************************************
2000 * PRINT ITEM
*EXECUTE "SPA HS"
EXECUTE "PRINTER"
PCNT=0
STR=STR("=",80)
STR1=STR("-",80)
PGCNT=1
PGHED=0
EOF=0
EXECUTE "SSELECT ABSENT.WORKFILE BY DEPT 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 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 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#10':ABW.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
*******************************************************