271 lines
8.3 KiB
Plaintext
Executable File
271 lines
8.3 KiB
Plaintext
Executable File
* 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 - BILLABLE CLIENT HOURS REPORT ":ERV
|
|
CRT @(20,17):CL:RV:" 7 - CALCULATE FUTURE VACATION HOURS ":ERV
|
|
CRT @(20,19):CL:RV:" 8 - RESTORE FILES (PREVIOUS PERIOD) ":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=' BILLABLE REPORT'
|
|
CASE SELECTION=7 ; OTITLE=' FUTURE VAC CALC'
|
|
CASE SELECTION=8 ; OTITLE='* RESTORE FILES'
|
|
* CASE SELECTION='LOG' ; OTITLE=' LOG'
|
|
END CASE
|
|
GOSUB 21000
|
|
IF SELECTION=2 OR SELECTION=5 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'
|
|
CALL MSD.BILLING.INFO
|
|
CASE SELECTION='7'
|
|
GOSUB 2000
|
|
CASE SELECTION='8'
|
|
ENTER CLOCK.BACKUP.ONE
|
|
* 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 <return> :":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<UR$FNAME>:" ":USER.REC<UR$LNAME>
|
|
IF USER.REC<UR$TYPE.CODE>='P' THEN NOPE=1
|
|
IF USER.REC<UR$STATUS>#'A' THEN NOPE=1
|
|
IF NOPE THEN
|
|
CRT @(0,22):CL:BEEP:RV:" USER IS INACTIVE OR PART-TIME! <return> :":ERV:
|
|
INPUT ANY,4 ; RETURN
|
|
END
|
|
CRT @(8,7):CL:RV:" LAST PAY PERIOD DATE :":ERV:" ":OCONV(USER.REC<UR$LAST.PAY.DATE>,'D2/')
|
|
CRT @(8,9):CL:RV:" VACATION AVAILABLE :":ERV:" ":OCONV(USER.REC<UR$VACATION.AVAIL>,'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<UR$LAST.PAY.DATE> THEN GO 2009
|
|
CRT @(8,13):CL:RV:" FUTURE VACATION DATE :":ERV:" ":OCONV(FUTURE.DATE,'D2/')
|
|
ACCRUAL.DAYS=0
|
|
FOR YYZ = USER.REC<UR$LAST.PAY.DATE> 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<UR$INTERNAL.CALC>
|
|
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<UR$VACATION.AVAIL>+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<UR$VACATION.AVAIL>,'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 <return> :":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,3):CL:RV:" CREATE / PRINT ACCRUAL REPORTS BY DEPARTMENT ":ERV:
|
|
CRT @(27,5):CL:RV:" 1 - SPECIAL ACCOUNTS ":ERV:
|
|
CRT @(27,7):CL:RV:" 2 - PERSONNEL ":ERV:
|
|
CRT @(27,9):CL:RV:" 3 - PROGRAMMING ":ERV:
|
|
CRT @(27,11):CL:RV:" 4 - PHONE CENTER ":ERV:
|
|
CRT @(27,13):CL:RV:" 5 - WOF PROCESSING ":ERV:
|
|
CRT @(27,15):CL:RV:" 6 - FULFILLMENT CENTER":ERV:
|
|
CRT @(27,17):CL:RV:" 7 - ALL DEPARTMENTS ":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'
|
|
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 <return> :":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
|