SUBROUTINE MSD.PROOF.RPT2(FILE.KEY,PAY.DATE,FIRST.DATE,SECOND.DATE,DEPT) * * AUTHOR: SCOTT REDMOND * DATE: 02/28/96 * PURPOSE: PROOF REPORT - PRINT BEFORE RUNNING PAY PERIOD * *--- includes ---------------------------------------------------* * $INCLUDE GEN.COMMON $INCLUDE USER $INCLUDE CLOCK.PAY.DATES * *---- open files ------------------------------------------------* * OPEN 'USER' TO USER.FILE ELSE ABORT 201, 'USER' OPEN 'HP.CONTROL' TO HPC ELSE ABORT 201, 'HP.CONTROL' OPEN 'CLOCK.GEN.KEYS' TO CLOCK.GEN.KEYS ELSE ABORT 201, 'CLOCK.GEN.KEYS' OPEN 'CLOCK.PAY.DATES' TO CLOCK.PAY.DATES ELSE ABORT 201, 'CLOCK.PAY.DATES' OPEN FILE.KEY TO INFO.WORK ELSE ABORT 201, 'INFO.WORK' * *---- initialize variables --------------------------------------* * EOF=0 ; T=0 ; WT=0 ; CHANNEL.1=CHAR(12) ; PAGECNT=0 ; LNCT=99 TODAY=DATE() ; LAST.DEPT='' ; FIRST.SW=1 ; MICAHTEK.FLAG='' TOTALS='' ; GRAND.TOTALS='' FOR X = 1 TO 13 ;* init column totals TOTALS=0 NEXT X * * TODAY=OCONV(DATE(),'D2/') *----------------------------------------------------------------* READ JEN.REC FROM CLOCK.GEN.KEYS,"NEXT.PAY.PERIOD" ELSE CRT @(0,22):CL:RV:" ERROR - MISSING CLOCK.GEN.KEYS ITEM! ":ERV: INPUT ANY,3 STOP END *--- report headings ------------------------------------------------* H1=TODAY'L#8':SPACE(58):'MICAHTEK, MSD & IDM USER TIME DETAIL REPORT' H3A=SPACE(46):' Period Vac Personal Reg OT Vac Holiday' H3A=H3A:' Funeral Personal Bonus W. Comp Jury Non-Reg Total' H3='User Name':SPACE(11):' Code Dept Sta Type Clk' H3=H3:SPACE(1):' date Avail Avail Work Work Used Used' H3=H3:SPACE(1):' Used Used Used Used Used Hours Hours' * 200 *--- enter beginning pay period date ---------------------------* CRT @(39,6):CL:OCONV(PAY.DATE,'D2/') * FIRST.PERIOD='' 300 * CRT @(8,6):CL:RV:" PAY PERIOD DATE :":ERV:" ":OCONV(PAY.DATE,'D2/') * 400 *---- select users by status --------------------------------* CRT @(0,11):CR: CRT @(0,22):CL:RV:" REPORT 'A'ctive users, 'I'nactive users or 'B'oth :":ERV: INPUT ACTIVE.ANS,3 IF ACTIVE.ANS='' OR ACTIVE.ANS=PF3 THEN STOP IF ACTIVE.ANS='A' OR ACTIVE.ANS='I' OR ACTIVE.ANS='B' OR ACTIVE.ANS='' OR ACTIVE.ANS=PF3 ELSE GO 200 * 405 * CRT @(0,11):CR: CRT @(0,22):CL:RV:" ENTER 'B' TO BEGIN REPORT :":ERV: INPUT BEGIN.ANS,4 IF BEGIN.ANS[1,1] # 'B' THEN STOP * *--- report will automatically landscape + 16.pitch ------------------* CRT @(8,16):CR:BEEP:RV:" This report must be sent to a laser printer! ":ERV: CRT @(0,18): EXECUTE "EX PRINTER" CRT @(0,16):CR: * PRINTER ON READ SMALL FROM HPC,'16.PITCH' ELSE SMALL='' READ LAND FROM HPC,'LANDSCAPE' ELSE LAND='' READ RESET FROM HPC,'RESET' ELSE RESET='' * H2=SPACE(69):'FOR DATE RANGE ':OCONV(FIRST.DATE,'D2/'):" TO ":OCONV(SECOND.DATE,'D2/') PRINT SMALL ; PRINT LAND * *------ select file -------------------------------------------* CRT @(0,22):CL:RV:" SELECTING FILE...PLEASE WAIT! ":ERV: HUSH ON EXECUTE "SSELECT ":FILE.KEY:" BY *A1 BY *A2 BY *A5" HUSH OFF * LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO T=T+1 IF REM(T,250)=0 THEN CRT @(8,16):CR:"REPORT RECORDS READ :":T CRT @(8,17):CL:"RECORDS IN DATE RANGE :":WT END USER.KEY=ID READ UREC FROM INFO.WORK,ID THEN DEPART=UREC IF DEPT # '5' THEN ;* (5 i.e., all depts) LOCATE(DEPART,D.TABLE,1;FND) ELSE GO 2000 END LAST.PAY.DATE=UREC IF LAST.PAY.DATE = PAY.DATE ELSE GO 2000 IF NOT(FIRST.SW) THEN IF DEPART # LAST.DEPT THEN LINE=STR('-',171) GOSUB 8000 IF DEPART='799' THEN ;* subtotal idm then begin micahtek IF DEPT # '4' THEN ;* more than phone center selected MICAHTEK.FLAG=1 ;* micahtek totals will be printed LINE='****** IDM TOTALS':SPACE(56) GOSUB 10000 ;* print subtotals GOSUB 8000 TOTALS='' END END END END FIRST.SW='' LAST.DEPT=DEPART NAME=UREC:", ":UREC LINE=NAME'L#20':SPACE(1) LINE=LINE:USER.KEY'L#4':SPACE(2) LINE=LINE:DEPART'R#4':SPACE(2) USTATUS=UREC *------ user status' for report --------* IF ACTIVE.ANS='A' THEN IF UREC > 0 ELSE GO 2000 END IF ACTIVE.ANS='I' THEN IF USTATUS # 'I' THEN GO 2000 END LINE=LINE:UREC'L#2':SPACE(2) TYPE=UREC IF TYPE='F' THEN TYPE='FULL' IF TYPE='P' THEN TYPE='PART' IF TYPE='M' THEN TYPE='MGR ' IF TYPE='O' THEN TYPE='OTHR' LINE=LINE:TYPE'L#4':SPACE(2) LINE=LINE:UREC'L#1':SPACE(2) LINE=LINE:OCONV(UREC,'D2/')'R#8':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) *--- modify: no sick time -----------------------------------* *LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) * LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) LINE=LINE:OCONV(UREC,'MR2')'R#7':SPACE(2) WT=WT+1 GOSUB 6000 ;* increment totals GOSUB 6500 ;* increment grand totals GOSUB 8000 ;* print line END 2000 * REPEAT * CRT @(8,16):CL:"REPORT RECORDS READ :":T CRT @(8,17):CL:"RECORDS IN DATE RANGE :":WT * LINE=STR('=',172) GOSUB 8000 ;* print totals line * IF MICAHTEK.FLAG THEN LINE='**** MICAHTEK TOTALS':SPACE(52) GOSUB 10000 ;* print micahtek totals GOSUB 8000 END TOTALS=GRAND.TOTALS LINE='**** GRAND TOTALS':SPACE(55) GOSUB 10000 ;* print totals GOSUB 8000 GOSUB 8000 LINE='END OF REPORT' GOSUB 8000 * 9999 * CRT @(0,20):CR: PRINT RESET PRINTER CLOSE PRINTER OFF CRT @(0,22):CL:RV:" PROCESS COMPLETE :":ERV: INPUT ANY,3 RETURN * 6000 *--- total figures ----------------------------------------* TOTALS<1>='' TOTALS<2>='' TOTALS<3>=TOTALS<3>+UREC TOTALS<4>=TOTALS<4>+UREC TOTALS<5>=TOTALS<5>+UREC TOTALS<6>=TOTALS<6>+UREC TOTALS<7>=TOTALS<7>+UREC TOTALS<8>=TOTALS<8>+UREC TOTALS<9>=TOTALS<9>+UREC TOTALS<10>=TOTALS<10>+UREC TOTALS<11>=TOTALS<11>+UREC TOTALS<12>=TOTALS<12>+UREC TOTALS<13>=TOTALS<13>+UREC RETURN * 6500 *--- grand total figures ----------------------------------* GRAND.TOTALS<1>='' GRAND.TOTALS<2>='' GRAND.TOTALS<3>=GRAND.TOTALS<3>+UREC GRAND.TOTALS<4>=GRAND.TOTALS<4>+UREC GRAND.TOTALS<5>=GRAND.TOTALS<5>+UREC GRAND.TOTALS<6>=GRAND.TOTALS<6>+UREC GRAND.TOTALS<7>=GRAND.TOTALS<7>+UREC GRAND.TOTALS<8>=GRAND.TOTALS<8>+UREC GRAND.TOTALS<9>=GRAND.TOTALS<9>+UREC GRAND.TOTALS<10>=GRAND.TOTALS<10>+UREC GRAND.TOTALS<11>=GRAND.TOTALS<11>+UREC GRAND.TOTALS<12>=GRAND.TOTALS<12>+UREC GRAND.TOTALS<13>=GRAND.TOTALS<13>+UREC RETURN * 8000 *--- print line -------------------------------------------* IF LNCT > 43 THEN PRINT CHANNEL.1 PAGECNT=PAGECNT+1 H1B=H1:SPACE(50):"PAGE ":PAGECNT PRINT H1B PRINT H2 PRINT PRINT H3A PRINT H3 PRINT LNCT=6 END PRINT LINE LINE='' LNCT=LNCT+1 RETURN * * 10000 *---- print subtotals -----------------------------------* * FOR X = 1 TO 13 IF X > 2 THEN LINE=LINE:OCONV(TOTALS,'MR2')'R#8':SPACE(1) END NEXT X GOSUB 8000 GOSUB 8000 * RETURN