	REMARK	*********************************************\
		*  P/R150.BAS   PAYROLL DEDUCTION REGISTER  *\
		*     3/13/79                 12 NOON       *\
		*********************************************

	DIM G2$(5),G3(5)
%INCLUDE CURSOR
	GOTO 6000
%INCLUDE SUBS1
%INCLUDE GENINFO
825	A1=59								REMARK  ****    LINE PRINTER ROUTINE    ****
	IF LINE.COUNT% < 55  THEN  RETURN				REMARK  IF SPACE REMAINS ON REPORT PAGE, RETURN
	P=P+1								REMARK  INCREMENT PAGE COUNT
	PRINT CHR$(12);
	PRINT
	PRINT TAB((A1-LEN(G2$(1)))/2);G2$(1);TAB(A1);"DATE ";		REMARK  PRINT COMPANY NAME AND REPORT DATE
	X0=G3(1):GOSUB 680.5
	PRINT
	PRINT TAB((A1-LEN(X4$))/2);X4$;TAB(A1);"PAGE ";P		REMARK  PRINT REPORT TITLE AND PAGE NUMBER
	PRINT
	PRINT " EMPLOYEE  DESCRIPTION   AMOUNT"
	PRINT
	LINE.COUNT%=6							REMARK  RESET LINE COUNTER FOR NEW PAGE
	RETURN
6000	DEF FNR(A1)=INT(A1*100+.5)/100					REMARK  ROUNDING FUNCTION
	A$="  TOTAL PAY #####.##       TOTAL DEDUCTIONS ######.##"	REMARK  SET UP PRINT MASKS
	B$="     ####  /##########/ ####.##"
	PRINT CLEAR.SCREEN$;"P/R DEDUCTION REGISTER"			REMARK  DISPLAY PROGRAM I.D. ON CRT
	PRINT "KEY RETURN TO BEGIN; CTRL-C TO EXIT"
6000.1	IF CONSTAT%=0 THEN GOTO 6000.1					REMARK  POLL KEYBOARD FOR <RETURN> OR CTRL-C
	A%=CONCHAR%
	IF A%=03H THEN GOTO 6150					REMARK  IF CTRL-C WAS PRESSED, ABORT PROGRAM
	IF A% <> 0DH THEN GOTO 6000.1					REMARK  WAIT FOR <RETURN> BEFORE EXECUTING PROGRAM
	Y9=4
	OPEN "P/R0F030.DAT" RECL 38 AS 1 BUFF 20 RECS 128		REMARK  OPEN PAYROLL DEDUCTION FILE
	OPEN "G/I0F010.DAT" RECL 200 AS Y9				REMARK  OPEN GENERAL INFORMATION FILE
	GOSUB 700							REMARK  READ GENERAL INFORMATION FILE
	LPRINTER							REMARK  SET LINE PRINTER AS OUTPUT DEVICE
	X4$="DEDUCTION REGISTER"
	LINE.COUNT%=60
	GOSUB 825							REMARK  PRINT REPORT HEADINGS
	IF END #1 THEN 6140
6035	READ #1;D1,D2,D3,D4,D1$,D5,D6
	IF D2>2 OR D4<10 THEN GOTO 6035
	GOSUB 825							REMARK  CHECK FOR END OF REPORT PAGE
	PRINT USING B$;D1,D1$,D6					REMARK  PRINT DEDUCTION FILE DETAIL
	LINE.COUNT%=LINE.COUNT%+1
	IF D2>1 THEN  A2=A2+D6						REMARK  ADD DEDUCTION AMOUNT TO REPORT TOTAL
	IF D2=1 THEN P1=P1+D6						REMARK  ADD MISCELLANEOUS INCOME TO REPORT TOTAL
	GOTO 6035
6140	REMARK	END OF PROGRAM
	PRINT
	PRINT USING A$; P1, A2						REMARK  PRINT DEDUCTION REGISTER TOTALS
6150	CONSOLE
	PRINT CLEAR.SCREEN$;"P/R DEDUCTION REGISTER LOADING MENU"
	CHAIN "P/R000"							REMARK  LOAD MENU
