* MSD.INFO.ACCRUAL * * AUTHOR: SCOTT REDMOND * PURPOSE: UTILITY TO MAINTAIN VACATION/SICK ACCRUAL FOR EMPLOYEES * DATE: 03/28/95 * *-------------------------------------------------------------------* * $INCLUDE GEN.COMMON $INCLUDE USER * *-------------------------------------------------------------------* * OPEN 'USER.BACKUP' TO USER.BACKUP ELSE ABORT 201, 'USER.BACKUP' OPEN 'USER' TO USER.FILE ELSE ABORT 201, 'USER' *OPEN 'CUSTOMER.TRANS' TO CUSTOMER.TRANS ELSE ABORT 201, 'CUSTOMER.TRANS' OPEN 'PROJECT' TO PROJECT ELSE ABORT 201, 'PROJECT' OPEN 'INFO.ACCRUAL' TO INFO.ACCRUAL ELSE ABORT 201, 'INFO.ACCRUAL' OPEN 'PT' TO PT.FILE ELSE ABORT 201, 'PT' OPEN 'CLOCKFILE' TO CLOCKFILE ELSE ABORT 201, 'CLOCKFILE' OPEN 'CLOCK.GEN.KEYS' TO CLOCK.GEN.KEYS ELSE ABORT 201, 'CLOCK.GEN.KEYS' OPEN 'CM' TO CM ELSE ABORT 201, 'CM' OPEN 'HP.CONTROL' TO HP.CONTROL ELSE ABORT 201, 'HP.CONTROL' OPEN 'INFO.HIST' TO INFO.HIST ELSE ABORT 201, 'INFO.HIST' *OPEN 'INFO.LOG' TO INFO.LOG ELSE ABORT 201, 'INFO.LOG' * *-------------------------------------------------------------------* * USER.ADD='' ; USER.REC='' ; TODAY=DATE() * *-------------------------------------------------------------------* 5 * * 10 * CRT CS HDG='MICAHTEK & IDM TIME CLOCK ACCRUAL UTILITY' HDL=(80 - LEN(HDG)) / 2 CRT @(0,0):CL:RV:STR(' ',80):ERV CRT @(HDL,0):RV:HDG:ERV: * 100 *------ opening menu ------------------------------------------* CRT @(20,5):CL:RV:" 1 - QUICK VIEW ACCRUAL TOTALS ":ERV CRT @(20,7):CL:RV:" 2 - RUN CURRENT PAY PERIOD PROCESS ":ERV CRT @(20,9):CL:RV:" 3 - ACCRUAL REPORT BY DEPARTMENT ":ERV CRT @(20,11):CL:RV:" 4 - UPDATE MANAGERS/USERS RECORDS ":ERV CRT @(20,13):CL:RV:" 5 - PRINT DETAIL ACCRUAL REPORT ":ERV CRT @(20,15):CL:RV:" 6 - UPDATE PAY PERIOD DATES ":ERV CRT @(20,17):CL:RV:" 7 - CALCULATE FUTURE VACATION HOURS ":ERV CRT @(20,19):CL:RV:" 8 - VIEW 'NEXT' MANUAL HOURS ":ERV PASSWORD=CHAR(73):CHAR(88):CHAR(79):CHAR(89):CHAR(69) * 101 * CRT @(0,22):CL:RV:" ENTER SELECTION :":ERV: INPUT SELECTION,15 OTITLE=' ':SELECTION BEGIN CASE CASE SELECTION=1 ; OTITLE=' QUICK VIEW' CASE SELECTION=2 ; OTITLE='* RUN PAY PERIOD' CASE SELECTION=3 ; OTITLE=' ACCRUAL DEPT REPORT' CASE SELECTION=4 ; OTITLE='* USER/MGR MAINT' CASE SELECTION=5 ; OTITLE='* DETAIL REPORT' CASE SELECTION=6 ; OTITLE=' PAY PERIOD DATES' CASE SELECTION=7 ; OTITLE=' FUTURE VAC CALC' CASE SELECTION=8 ; OTITLE='* MANUAL HOURS' * CASE SELECTION='LOG' ; OTITLE=' LOG' END CASE GOSUB 21000 IF SELECTION=2 OR SELECTION=5 OR SELECTION=6 THEN CRT @(0,22):CL:RV:" ENTER PASSWORD :":ERV: HUSH ON INPUT PASS,15 HUSH OFF IF PASS # PASSWORD THEN GO 101 END BEGIN CASE CASE SELECTION=PF3 OR SELECTION='' STOP CASE SELECTION='1' GOSUB 1000 CASE SELECTION='2' GOSUB 15000 ;* backup current user file CALL MSD.TIME.ACCRUAL CASE SELECTION='3' GOSUB 3000 CASE SELECTION='4' CALL MSD.USER.MAINT CASE SELECTION='5' CALL MSD.ACCRUAL.RPT2 CASE SELECTION='6' ENTER MSD.PAY.DATES CASE SELECTION='7' GOSUB 2000 CASE SELECTION='8' EXECUTE "EX MAN.TOT" * CASE SELECTION='LOG' * EXECUTE"EX USER.LOG" CASE 1 GO 101 END CASE GO 10 * 9999 * STOP * 1000 *--- quick view accrual records ------------------------* EXECUTE "EX CLOCK.INFO" CRT @(0,22):CL:RV:" PROCESS COMPLETE :":ERV: INPUT ANY,2 RETURN * 2000 *--- calculate future accrual hours by user ------------* NOPE='' CRT @(0,0):CL:RV:STR(' ',80):ERV CRT @(HDL,0):RV:HDG:ERV: CRT @(0,1):CR: CRT @(19,3):CL:RV:" CALCULATE FUTURE ACCRUAL HOURS FOR USER ":ERV: CRT @(0,22):CL:RV:" ENTER USER CODE ":ERV: CRT @(8,5):CL:RV:" USER CODE :":ERV: INPUT REQUEST,10 IF REQUEST=PF3 OR REQUEST='' THEN RETURN IF NUM(REQUEST) THEN READ USER.REC FROM USER.FILE,REQUEST THEN CRT @(29,5):CL:USER.REC:" ":USER.REC IF USER.REC='P' THEN NOPE=1 IF USER.REC#'A' THEN NOPE=1 IF NOPE THEN CRT @(0,22):CL:BEEP:RV:" USER IS INACTIVE OR PART-TIME! :":ERV: INPUT ANY,4 ; RETURN END CRT @(8,7):CL:RV:" LAST PAY PERIOD DATE :":ERV:" ":OCONV(USER.REC,'D2/') CRT @(8,9):CL:RV:" VACATION AVAILABLE :":ERV:" ":OCONV(USER.REC,'MR2')'L#7' 2009 * CRT @(0,22):CL:RV:" ENTER THE FUTURE VACATION DATE ":ERV: CRT @(8,13):CL:RV:" FUTURE VACATION DATE :":ERV:" ": INPUT FUTURE.DATE,10 IF FUTURE.DATE='' OR FUTURE.DATE=PF3 THEN RETURN FUTURE.DATE=ICONV(FUTURE.DATE,'D') IF FUTURE.DATE < USER.REC THEN GO 2009 CRT @(8,13):CL:RV:" FUTURE VACATION DATE :":ERV:" ":OCONV(FUTURE.DATE,'D2/') ACCRUAL.DAYS=0 FOR YYZ = USER.REC TO FUTURE.DATE IF OCONV(YYZ,'DW') < 6 THEN ;* figure days M-F ACCRUAL.DAYS=ACCRUAL.DAYS+1 END NEXT YYZ ACCRUAL.HOURS=ACCRUAL.DAYS*8 CALC.FACTOR=USER.REC VAC.ACCRUAL=ACCRUAL.HOURS*CALC.FACTOR VAC.ONE=OCONV(VAC.ACCRUAL,'G0.1') VAC.TWO=OCONV(VAC.ACCRUAL,'G1.1')'L%2' FUTURE.VAC=VAC.ONE:VAC.TWO[1,2] TOTAL.VAC=(USER.REC+FUTURE.VAC)'R26' NO.DAYS=TOTAL.VAC/8 NO.DAY1=INT(NO.DAYS) NO.DAY2=OCONV(NO.DAYS,'G1.1')[1,1] NO.DAYS=NO.DAY1:".":NO.DAY2 CRT @(8,15):CL:RV:" NUMBER WORKING DAYS :":ERV:" ":ACCRUAL.DAYS CRT @(8,17):CL:RV:" FUTURE VACATION AVAIL.:":ERV:" ":OCONV(USER.REC,'MR2'):" + ":FUTURE.VAC'R26':" = ":TOTAL.VAC:" (":NO.DAYS:" days)" CRT @(0,22):CL:RV:" CALCULATE ANOTHER (Y/N) :":ERV: INPUT ANOTHER,3 IF ANOTHER='Y' THEN GO 2000 END ELSE CRT @(0,22):CL:BEEP:RV:" USER NOT ON FILE :":ERV: INPUT ANY,4 GO 2000 ;* return to prompt END END RETURN * 3000 *--- print accrual report ------------------------------* CRT @(0,0):CL:RV:STR(' ',80):ERV CRT @(HDL,0):RV:HDG:ERV: DEPT='ALL' READ LAND FROM HP.CONTROL,'LANDSCAPE' ELSE LAND='' READ SMALL FROM HP.CONTROL,'16.PITCH' ELSE SMALL='' CRT @(0,1):CR: CRT @(17,2):CL:RV:" CREATE / PRINT ACCRUAL REPORTS BY DEPARTMENT ":ERV: CRT @(27,4):CL:RV:" 1 - SPECIAL ACCOUNTS ":ERV: CRT @(27,6):CL:RV:" 2 - PERSONNEL ":ERV: CRT @(27,8):CL:RV:" 3 - PROGRAMMING ":ERV: CRT @(27,10):CL:RV:" 4 - PHONE CENTER ":ERV: CRT @(27,12):CL:RV:" 5 - WOF PROCESSING ":ERV: CRT @(27,14):CL:RV:" 6 - FULFILLMENT CENTER":ERV: CRT @(27,16):CL:RV:" 7 - ALL DEPARTMENTS ":ERV: CRT @(27,18):CL:RV:" 8 - SPECIAL ACCTS COMM":ERV: CRT @(27,20):CL:RV:" 9 - MARKETING ":ERV: CRT @(0,22):CL:RV:" ENTER DEPARTMENT : ":ERV: INPUT DEPT,9 IF DEPT='' OR DEPT=PF3 THEN RETURN IF NUM(DEPT) ELSE GO 3000 CRT @(0,22):CL:RV:" SEND REPORT TO PRINTER (Y/N) :":ERV: INPUT PRINTER.ANS,3 IF PRINTER.ANS[1,1]='Y' THEN CRT @(0,18):CR: EXECUTE "EX PRINTER" CRT @(0,18):CR: END CMD='' CMD='SORT USER ' CMD=CMD:' FNAME LNAME BREAK.ON DEPT STATUS TOTAL VAC TOTAL PERSONAL.AVAIL ' CMD=CMD:'BY DEPT BY LNAME BY FNAME' CMD=CMD:' WITH DEPT ' BEGIN CASE CASE DEPT='1' CMD=CMD:' \511\ ' CASE DEPT='2' CMD=CMD:' \517\ ' CASE DEPT='3' CMD=CMD:' \504\\512\ ' CASE DEPT='4' CMD=CMD:' \800\ ' CASE DEPT='5' CMD=CMD:' \500\\501\\502\\503\\505\\509\\514\\525\ ' CASE DEPT='6' CMD=CMD:' \506\\507\ ' CASE DEPT='7' CASE DEPT='8' CMD=CMD:' \520\ ' CASE DEPT='9' CMD=CMD:' \799\ ' END CASE IF PRINTER.ANS='Y' THEN CMD=CMD:\ HEADING "PAGE 'P' ACCRUAL REPORT BY DEPARTMENT 'D' 'L' 'L'" (P \ END ELSE CMD=CMD:\ HEADING "PAGE 'P' ACCRUAL REPORT BY DEPARTMENT 'D' 'L' 'L'" \ END *HUSH ON EXECUTE CMD *HUSH OFF CRT @(0,22):CL:RV:" REPORT COMPLETE :":ERV: INPUT ANY,2 GO 3000 RETURN * * 15000 *--- back up current user file to user.backup -----------* CRT @(0,22):CL:RV:" PLEASE WAIT.... ":ERV: CLEARFILE USER.BACKUP EOF=0 ; T=0 ; WT=0 SELECT USER.FILE LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO T=T+1 READ BAK.REC FROM USER.FILE,ID THEN WRITE BAK.REC ON USER.BACKUP,ID WT=WT+1 END REPEAT RETURN * 21000 * * IREC='' ; PORT='' ; ADD.OPER='' ; ADD.FNAME='' ; ADD.LNAME='' PORT=FIELD(OCONV(0, "U50BB")," ",1) READ PT.REC FROM PT.FILE,PORT THEN ADD.OPER=PT.REC<1> ADD.FNAME=PT.REC<2> ADD.LNAME=PT.REC<3> END ELSE ADD.OPER='UNKNOWN' ADD.LNAME='' END TIMER=TIMEDATE() IREC<1>=ADD.OPER IREC<2>=OTITLE IREC<3>=ADD.FNAME:" ":ADD.LNAME IREC<4>=TIMER IF OTITLE='' THEN RETURN READ NEXX FROM CLOCK.GEN.KEYS,"NEXT.LOG" THEN NEXX=NEXX+1 * WRITE NEXX ON CLOCK.GEN.KEYS,"NEXT.LOG" * WRITE IREC ON INFO.LOG,NEXX END RETURN