
	REMARK	#########################################################
	REMARK	#	ACCOUNTS RECEIVABLE TRANSACTION PRINT  (A/R020)	#
	REMARK	#		VERS. OF 12.30 PM	3/4/79		#
	REMARK	#########################################################

	DIM A(6),G(7,9),L4(2),D$(2),D(20),G2$(5),G3(5)
%INCLUDE CURSOR
	GOTO 6000
%INCLUDE A/R-INFO
%INCLUDE SUBS1
%INCLUDE GENINFO
%INCLUDE A/R-INV
	DATA "NEW","INV BILLING","INV PAYMENT","PROG PAYMENT","DELETE"
	DATA"MODIFY"



825	IF LINE.COUNT%<55 AND PAGE.COUNT%>0 THEN RETURN			REMARK	LINE PRINTER ROUTINE
	PAGE.COUNT%=PAGE.COUNT%+1
	PRINT CHR$(12);TAB((A1-LEN(G2$(1)))/2);G2$(1);TAB(A1);"DATE ";
	X0=G3(1):GOSUB 680.5
	PRINT 
	PRINT TAB((A1-LEN(X4$))/2);X4$;TAB(A1);"PAGE";PAGE.COUNT%
	PRINT 
	IF LINE.COUNT%<>100 THEN PRINT "R#   CUST   INV # CUST ORDER #";:\
	PRINT"    JOB DSCRPT  BILLED  TAX";
	PRINT TAB(59);"INV AMT";TAB(72);"SHIP";TAB(81);"TAXES   INV PAY";
	PRINT"  PROG DATE PROG BILL  PROG PAY T O"
	PRINT
	LINE.COUNT%=6
	RETURN 


									REMARK	START OF MAIN PROGRAM
6000	MASKA$=" ######"
	MASKB$="  #####.#"
	MASKC$="#######.##"
	MASKD$=" #"
	MASKE$="###"
	OPEN "A/R0F130.DAT" AS 1
	FILE.NO=1: GOSUB 3.14						REMARK	RETREIVE A/R EXTENT INFORMATION
	OPEN "G/I0F010.DAT" AS 2
	Y9=2:GOSUB 700							REMARK	RETRIEVE GENERAL INFORMATION FILE DATA
	OPEN "A/R0F020.DAT" RECL 226 AS 5				REMARK	OPEN A/R TRANSACTION FILE
	IF AR.TRANFILE.EXTENT=0 THEN \
		PRINT CLEAR.SCREEN$;:\
		X2$="NO TRANSACTIONS ON FILE":\
		GOSUB 615:\
		GOTO 6240
6010	FOR I%=1 TO 6							REMARK	ZERO TOTALS
	A(I%)=0
	NEXT I%
	FOR I%=1 TO 7
	FOR J%=1 TO 9
	G(I%,J%)=0
	NEXT J%,I%
	CONSOLE
	PRINT CLEAR.SCREEN$;"A/R TRANSACTION PRINT"
	PRINT:PRINT:PRINT:PRINT"START RECORD NUMBER"
	PRINT"END RECORD NUMBER"
	PAGE.COUNT%=0:LINE.COUNT%=0
6020	X1=281:X2=3:X3=0:X4=AR.TRANFILE.EXTENT:GOSUB 345		REMARK	ENTER START RECORD NO.
	IF X0=0 THEN 6240
	F0=X0
	F1=X0-1
	X1=345:X2=3:X3=F0:X4=999:GOSUB 345				REMARK	ENTER END RECORD NO.
	F=X0
	IF F>AR.TRANFILE.EXTENT THEN F=AR.TRANFILE.EXTENT
	X2=1:X3=0:X4=1:X2$="ENTRY CORRECT?":GOSUB 665			REMARK	VERIFY ENTRY
	IF X0=0 THEN 6020
	LPRINTER


	FOR F1%=F0 TO F							REMARK	START MAIN PRINT LOOP
	FILE.NO=5:REC.NO%=F1%:GOSUB 3400				REMARK	RETRIEVE NEXT TRANSACTION
	C2=C2-INT(C2/10)*10						REMARK	STRIP TENS DIGIT (IF ANY) OFF THE OPERATION CODE
	A(C2)=A(C2)+1
	X4$="A/R TRANSACTIONS":A1=115:GOSUB 825
	FOR I%=1 TO 9
	G(C2,I%)=G(C2,I%)+D(I%)						REMARK	ACCUMULATE TOTALS
	NEXT I%
									REMARK	PRINT TRANSACTION
	PRINT USING MASKE$;F1%;
	PRINT TAB(5);W1$;TAB(11);
	PRINT USING MASKA$;L1;
	PRINT TAB(19);L1$;TAB(31);
	PRINT USING MASKA$;L2;
	PRINT TAB(39);L2$;TAB(46);
	IF L4(1)<>0 THEN X0=L4(1):GOSUB 680.5
	PRINT TAB(54);
	PRINT USING MASKD$;L6;
	FOR I%=1TO 3
	PRINT USING MASKC$;D(I%);
	NEXT I%
	PRINT USING MASKC$;D(5);
	IF D(12)<>0 THEN PRINT "CM"
	PRINT TAB(99);
	IF L4(2)<>0 THEN X0=L4(2):GOSUB 680.5
	PRINT TAB(107);
	PRINT USING MASKC$;D(8);D(9);
	PRINT USING MASKD$;B;C2
	LINE.COUNT%=LINE.COUNT%+1
	IF D(13)<>0 THEN \
		PRINT "   G/L # ";:\
		PRINT USING MASKB$;D(13):\
		LINE.COUNT%=LINE.COUNT%+1
	NEXT F1%



	IF F0=F THEN 6010						REMARK	IF ONLY ONE TRANSACTION, DON'T PRINT TOTALS
	LINE.COUNT%=100							REMARK	PRINT TOTALS
	X4$="A/R TRANSACTIONS":A1=115:GOSUB 825
	RESTORE 
	FOR I%=1 TO 6
	PRINT
	PRINT USING MASKA$;A(I%);
	READ X0$
	PRINT "  ";X0$;" TRANSACTIONS";TAB(56);
	FOR J%=1 TO 3
	PRINT USING MASKC$;G(I%,J%);
	G(7,J%)=G(7,J%)+G(I%,J%)
	NEXT J%
	PRINT USING MASKC$;G(I%,5);
	G(7,5)=G(7,5)+G(I%,5)
	PRINT TAB(107);
	PRINT USING MASKC$;G(I%,8);G(I%,9)
	G(7,8)=G(7,8)+G(I%,8)
	G(7,9)=G(7,9)+G(I%,9)
	NEXT I%
	PRINT
	PRINT TAB(15);"TOTALS";TAB(56);
	FOR I%=1 TO 3
	PRINT USING MASKC$;G(7,I%);
	NEXT I%
	PRINT USING MASKC$;G(7,5);
	PRINT TAB(107);
	PRINT USING MASKC$;G(7,8);G(7,9)
	PRINT 
	PRINT "START RECORD #",F0
	PRINT "END RECORD #",F
	PRINT "TOTAL IN FILE",AR.TRANFILE.EXTENT    
	GOTO 6010


6240	PRINT CLEAR.SCREEN$;"A/R TRANSACTION PRINT LOADING MENU"	REMARK	END PROGRAM AND RELOAD MENU
	CHAIN"A/P000"
