
	REMARK	+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	REMARK	+	GENERAL LEDGER DIRECT POSTING ENTRY/PRINT	+
	REMARK	+		VERS. OF 3.00 PM	8/8/79		+
	REMARK	+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	DIM G2$(5),G3(5),D(7)
%INCLUDE CURSOR
	GOTO 6000
%INCLUDE SUBS1
%INCLUDE GENINFO
%INCLUDE ACCTFILE
%INCLUDE POSTFILE
%INCLUDE BINSERCH
%INCLUDE G/L-INFO


825	IF LINE.COUNT%<55 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
	FOR I%=1 TO 3
	PRINT"ACCOUNT SOURCE DATE     REF     AMOUNT";
	IF I%<3 THEN PRINT">-----<";
	NEXT I%
	PRINT:PRINT
	LINE.COUNT%=6
	RETURN


4020	IF EXTERNAL.POSTING.EXTENT% + DIRECT.POSTING.EXTENT% < \	REMARK	STOP PROGRAM IF POSTING FILES ARE FULL
		MAXIMUM.POSTING.RECORDS% THEN RETURN
	PRINT CURSOR.HOME$:PRINT:PRINT"FILE FULL - RUN G/L UPDATE"
	PRINT "KEY <RETURN> TO EXIT"
	X1=148:X2=1:X3=0:X4=0:GOSUB 345
	GOTO 6340


5000	X1=335:GOSUB 210						REMARK	ENTER MONTH AND DAY FOR POSTING DATE FIELD
	PRINT TAB(18)
	A1=0
	X1=336:X2=4:X3=0:X4=9999:GOSUB 345				REMARK	ENTER DATE
	IF X0=0 THEN 5040
	P3=X0/100
	A1=INT(X0/100)							REMARK	CHECK FOR VALID MONTH
	IF A1<1 OR A1>12 THEN X2$="BAD DATE":GOSUB 615:GOTO 5000
	A1=X0-A1*100							REMARK	CHECK FOR VALID DAY
	IF A1<1 OR A1>31 THEN X2$="BAD DATE":GOSUB 615:GOTO 5000
5040	X1=335:GOSUB 210						REMARK	DISPLAY MONTH/DAY
	PRINT USING "##/##";INT(P3),(P3-INT(P3))*100
	RETURN 


5060	X1=398:X2=6:X3=0:X4=999999:GOSUB 345				REMARK	ENTER REFERENCE NUMBER FIELD
	P4=X0
	RETURN 


5080	X1=457:X2=11:X3=-9999999.99:X4=9999999.99:GOSUB 345		REMARK	ENTER POSTING FIELD AMOUNT
	P5=X0
	X1=491:GOSUB 210						REMARK	DISPLAY NEW ACCOUNT BALANCE
	PRINT USING MASKA$;D(1)+P5
	RETURN 



6000	MASKA$=" #########.##"						REMARK	START OF MAIN PROGRAM
	MASKB$="#####.#   ##  ##/##  ######-#######.##"
	MASKC$="### TOTAL DIRECT POSTINGS $$#######.##"
6010	MAXIMUM.POSTING.RECORDS%=3600
	OPEN "G/I0F010.DAT" AS 1,"G/L0F110.DAT" RECL 157 AS 2,\		REMARK	OPEN FILES
	"G/L0F030.DAT" RECL 36 AS 3,\
	"G/L0F130.DAT" AS 5, "CRT" RECL 1100 AS 19
	FILE.NO%=1:GOSUB 700						REMARK	GET GENERAL INFORMATION FILE
	FILE.NO%=5:GOSUB .314						REMARK	GET G/L INFORMATION FILE
	GOSUB 4020							REMARK	CHECK POSTING FILES' RECORD LENGTHS
6040	P2=3								REMARK	SET ACCOUNT TYPE FIELD FOR DIRECT POSTINGS
	X0=2:GOSUB 260							REMARK	LOAD CRT MASK
	X2=1:X3=0:X4=2:X2$="ENTER OPERATION (0=EXIT, 1=POST, 2=PRINT)"	REMARK	REQUEST OPERATION CODE
	GOSUB 665
	ON X0+1 GOTO 6340,6060,6200					REMARK	BRANCH TO APPROPRIATE PROGRAM AREA


									REMARK	ENTER DIRECT POSTINGS
6060	X1=264:X2=7:X3=0:X4=99999.9:GOSUB 345				REMARK	ENTER ACCOUNT NUMBER
	P1=X0
	IF X0=0 THEN 6040
	RECORD.COUNT%=ACCOUNT.FILE.EXTENT%
	Y2=2
	K1=P1
	GOSUB 10.60							REMARK	CHECK ACCOUNT FILE FOR RECORD
	IF H=-1 THEN X2$="NOT ON FILE":GOSUB 615:GOTO 6060
	FILE.NO%=2:RECORD.NO%=L:GOSUB 3500				REMARK	RETREIVE ACCOUNT DATA
	P3=(INT(G3(1)/100))/100						REMARK  SET POSTING DATE TO TODAY'S DATE
	P4=0:P5=0
	X1=272:GOSUB 210						REMARK	DISPLAY ACCOUNT DATA
	PRINT L1$;TAB(64)
	GOSUB 5040
	IF L4%=2 THEN X0$="BALANCE SHEET"\
	ELSE X0$="INCOME   STMT"
	X1=348:GOSUB 210
	PRINT X0$;", ";
	IF L5%=2 THEN X0$="CREDIT"\
	ELSE X0$="DEBIT"
	PRINT X0$;" "
	X1=44:GOSUB 215
	PRINT USING MASKA$;D(1)
	GOSUB 5060							REMARK	ENTER REFERENCE
	GOSUB 5080							REMARK	ENTER AMOUNT
6140	X2=1:X3=0:X4=4:X2$="ENTER FIELD TO CHANGE (0=NONE; 4=CANCEL)"	REMARK	ALLOW CHANGES TO ENTRIES
	GOSUB 665
	IF X0=0 THEN 6160
	IF X0=4 THEN X0=2:GOSUB 260:GOTO 6060				REMARK	CANCEL THE POSTING
	ON X0 GOSUB 5000,5060,5080					REMARK	BRANCH TO CHANGE APPROPRIATE FIELD
	GOTO 6140
6160	FILE.NO%=3
	RECORD.NO% = DIRECT.POSTING.EXTENT% + 1
	GOSUB 3650							REMARK	SAVE THE POSTING
	X2$="RECORDED":GOSUB 615
	DIRECT.POSTING.EXTENT% = DIRECT.POSTING.EXTENT% + 1
	CLOSE 5
	OPEN "G/L0F130.DAT" AS 5
	FILE.NO%=5
	GOSUB .315							REMARK	SAVE NEW EXTENT ON INFORMATION FILE
	GOSUB 4020							REMARK	CHECK POSTING FILES' RECORD LENGTHS
	X0=2:GOSUB 260							REMARK	REFRESH CRT MASK
	GOTO 6060


6200	N=0:N1=0							REMARK	PRINT SECTION - INITIALIZE VARIABLES
	H1%=3
	LINE.COUNT%=60
	PAGE.COUNT%=0
	LPRINTER
	X4$="DIRECT GENERAL LEDGER POSTINGS":A1=110
	GOSUB 825
	FILE.NO%=3
	IF DIRECT.POSTING.EXTENT%=0 THEN GOTO 6040			REMARK  CHECK FOR EMPTY FILE
	FOR RECORD.NO%=1 TO DIRECT.POSTING.EXTENT%			REMARK	START PRINT ROUTINE
	GOSUB 3600							REMARK	RETRIEVE NEXT POSTING
	H1%=H1%+1
	IF H1%=4 THEN\							REMARK	THREE POSTINGS PRINTED PER LINE.
									REMARK	START FOURTH POSTING AT NEW LINE
		PRINT:\
		LINE.COUNT%=LINE.COUNT%+1:\
		X4$="DIRECT GENERAL LEDGER POSTINGS":A1=110:\
		GOSUB 825:H1%=1
	PRINT USING MASKB$;P1,P2,INT(P3),100*(P3-INT(P3)),P4,P5;	REMARK	PRINT POSTING DATA
	IF H1%<3 THEN PRINT">-----<";
	N=N+1
	N1=N1+P5
	NEXT RECORD.NO%

	PRINT:PRINT:PRINT TAB(35)
	PRINT USING MASKC$;N,N1						REMARK	PRINT TOTALS
	GOTO 6040



									REMARK	END PROGRAM
6340	X2=1:X3=0:X4=1:X2$="DO YOU WANT A DIRECT POSTING LISTING?"	REMARK	ENCOURAGE PRINTING ANY POSTINGS JUST ENTERED
	GOSUB 665
	IF X0=1 THEN 6200
	PRINT CLEAR.SCREEN$;"G/L DIRECT POSTING LOADING MENU"
	CHAIN "G/L000"							REMARK	RELOAD MENU
