10 PRINT CHR$(&H1A);
20 A$=" "
30 A=VARPTR(A$)
40 POKE A,52:B=&HF000
50 OPEN "R",1,"COPYRITE.GRF",52
60 FIELD 1, 52 AS B$
70 FOR X=1 TO 24
75 POKE A+1,-(B MOD 256):POKE A+2,INT(256+(B/256)):B=B+128
80 'PRINT CHR$(&H1B)"R";
90 GET 1
100 LSET A$=B$
110 NEXT X
120 A$=INPUT$(1)
130 CLOSE
140 RESET
150 CLEAR
1000 WIDTH 255
1020 DEFINT A-Z
1040 DIM ACNTCODE$(200),ACNTLBL$(200),ACNTBUDG!(200)
1050 DIM ANS1$(30),ANS2$(30)
1070 CLS$=CHR$(&H1A)
1080 ESC$=CHR$(&H1B):DARK$=ESC$+")":BRITE$=ESC$+"("
1090 STRSCR$=ESC$+"l":ENDSCR$=ESC$+"m":MVLEFT$=CHR$(8)
1100 MVRITE$=CHR$(12):MVDOWN$=CHR$(10):MVUP$=CHR$(11)
1110 CR$=CHR$(13):LF$=CHR$(10):TF$=CHR$(12)
1120 INSERT$=ESC$+"Q":DELEND$=ESC$+"T":DELINE$=ESC$+"R"
1130 DELCHA$=ESC$+"W":MOVSCR$=ESC$+"S":MOVCUR$=ESC$+"="
1140 BELL$=CHR$(7):GOSUB 1150:GOTO 1200
1150 DEF FNCENTER$(A$)=STRING$(26-LEN(A$)/2-.5," ")+A$
1160 DEF FNLCNTR$(A$)=STRING$(40-LEN(A$)/2-.5," ")+A$
1170 DEF FNVERTAB$(A)=STRING$(A!,LF$)
1180 DEF FNPRTAT$(X,Y)=CHR$(&H1B)+"="+CHR$(Y+32)+CHR$(X+32)
1190 DEF FNMONTH$(X$)=MID$("DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC",VAL(X$)*3+1,3)
1191 COMMON ANS1$(),ANS2$(),ACNTCODE$(),ACNTLBL$(),ACNTBUDG!(),NUMRECS,DATE$,NUMACCTS
1192 COMMON CLS$,DARK$,ESC$,BRITE$,STRSCR$,ENDSCR$
1193 COMMON MVLEFT$,MVRITE$,MVDOWN$,MVUP$,CR$,LF$
1194 COMMON TF$,DELEND$,DELINE$,DELCHA$,MOVSCR$
1195 COMMON MOVCUR$,BELL$
1196 RETURN
1200 PRINT CLS$
1210 PRINT FNCENTER$("B U D G E T   M A N A G E R")
1220 PRINT:PRINT FNCENTER$("Copyright January 1984")
1230 PRINT FNCENTER$("by J. G. Yoder")
1232 DF=-1:DATE$=" ":POKE VARPTR(DATE$),8
1234 POKE VARPTR(DATE$)+1,16
1236 POKE VARPTR(DATE$)+2,0
1238 GOTO 1270
1239 IF DF THEN PRINT CLS$ ELSE 1750
1240 PLIN=9:PCOL=0
1250 PROMPT$=FNCENTER$("Enter the date :00/00/00:")
1260 GOSUB 1880:LSET DATE$=ANS$
1270 IF VAL(DATE$)>0 AND VAL(DATE$)<13 THEN 1290
1280 PRINT BELL$;:GOTO 1240
1290 DUM=VAL(RIGHT$(DATE$,5))
1291 IF DUM<1 OR DUM>31 THEN 1280
1295 PRINT FNPRTAT$(0,9) DELINE$ FNCENTER$("TODAY'S DATE:")
1297 PRINT:PRINT STRING$(19,32) USING "&. ##& 19\\"; FNMONTH$(DATE$),VAL(MID$(DATE$,4,2)),",",RIGHT$(DATE$,2);
1310 OPEN "R",1,"B:RECLENTH.DAT",2
1320 FIELD 1, 2 AS RC$
1330 GET#1,VAL(DATE$)
1340 NUMRECS=CVI(RC$)
1342 IF NUMRECS>0 THEN 1358
1344 IF VAL(DATE$)=1 THEN LM=12 ELSE LM=VAL(DATE$)-1
1346 GET#1,LM
1348 IF CVI(RC$)=0 THEN 1358
1350 GOSUB 9000
1358 CLOSE
1360 NUMACCTS=0
1370 ON ERROR GOTO 1440
1380 OPEN "I", #1, "B:ACCOUNTS.DAT"
1390 ON ERROR GOTO 0
1400 IF EOF(1) THEN 1590
1410 NUMACCTS=NUMACCTS+1
1420 INPUT# 1,ACNTCODE$(NUMACCTS),ACNTLBL$(NUMACCTS),ACNTBUDG!(NUMACCTS)
1430 GOTO 1400
1440 PRINT FNPRTAT$(0,14)DELEND$"Cannot find B:ACCOUNTS.DAT"
1450 PLIN=15:PCOL=0:PROMPT$="(C)reate anew, or (G)et new disk?  :#:"
1460 GOSUB 1880
1470 IF ANS$="C" THEN 1550
1480 IF ANS$<>"G" THEN PRINT BELL$;:GOTO 1450
1490 PRINT
1500 PRINT "Insert correct disk in drive B and press return.  ";
1520 ANS$=INPUT$(1)
1530 RESET
1540 RESUME 1200
1550 OPEN "O", 1, "B:ACCOUNTS.DAT"
1560 PRINT# 1,"DP,Deposits,";0!
1570 CLOSE
1580 RESUME 1310
1590 CLOSE:GOTO 1610
1600 GOSUB 1150:DEFINT A-Z
1610 PRINT CLS$
1620 PRINT FNCENTER$("B U D G E T   M A N A G E R")
1630 PRINT:PRINT:PRINT "  "FNCENTER$(STRSCR$+"Main Menu"+ENDSCR$)
1640 PRINT
1650 PRINT FNCENTER$("(1) Record a new transaction             ")
1660 PRINT "  "FNCENTER$("("+DARK$+"2"+BRITE$+") Repair an old transaction            ")
1670 PRINT "  "FNCENTER$("("+DARK$+"3"+BRITE$+") Edit or add account labels           ")
1680 PRINT FNCENTER$("     [Prepare a monthly budget]          ")
1690 PRINT FNCENTER$("(4) Calculate and report expenses        ")
1700 PRINT FNCENTER$("(5) Compare monthly expenses with budget ")
1720 PRINT "  "FNCENTER$("("+DARK$+"6"+BRITE$+") Search for a record                  ")
1725 PRINT FNCENTER$("(7) Reset "+CHR$(34)+"today's"+CHR$(34)+" date                 ")
1727 PRINT FNCENTER$("(8) Bring balance forward from "+FNMONTH$(STR$(VAL(DATE$)-1))+" to "+FNMONTH$(DATE$))
1730 PRINT FNCENTER$("(0) Done - "+DARK$+"Don't stop without this!"+BRITE$+"  ")
1750 PLIN=20:PCOL=0
1760 PROMPT$="     What is your selection?  :1:"
1770 GOSUB 1880:IF ANS$<>"7" AND ANS$<>"4" AND ASN$<>"5" THEN DF=0
1780 DUM=VAL(ANS$):DUM=DUM+1
1790 IF DUM<1 OR DUM>9 THEN 1750
1800 ON DUM GOTO 2140,2360,5910,5940,3060,5570,5880,1239,8000
1810 YES$=INPUT$(1):YES$=CHR$(ASC(YES$)AND &HDF)
1830 IF YES$="Y" OR YES$="N" THEN PRINT YES$;:RETURN
1840 PRINT BELL$;
1850 GOTO 1810
1860 PROMPT$=PROMPT$(X)
1870 PLIN=PLIN(X):PCOL=0
1880 GOSUB 7000:PRINT FNPRTAT$(PCOL,PLIN)PROMPT$;:A=PCOL
1890 PCOL=INSTR(PROMPT$,":"):CRS=INSTR(PCOL+1,PROMPT$,":")-PCOL+1
1900 FOR XYZ=1 TO CRS
1910 ANS2$(XYZ)=MID$(PROMPT$,XYZ+PCOL-1,1)
1920 IF XYZ<>1 THEN ANS1$(XYZ-1)=ANS2$(XYZ)
1930 NEXT XYZ:IF ANS1$(1)=CHR$(160) THEN 10000 ELSE PCOL=PCOL+A
1940 LTH=CRS-2
1950 PRINT FNPRTAT$(PCOL,PLIN);:CRS=2
1960 ANS$=INPUT$(1)
1970 IF ANS$=CR$ OR ANS$=MVUP$ THEN 2060
1980 IF ANS$=MVRITE$ AND CRS<LTH+2 THEN CRS=CRS+1:PRINT ANS$;:IF ANS2$(CRS)=":" THEN 2040 ELSE IF INSTR("# 0123456789",ANS2$(CRS)) THEN 1960 ELSE 1980
1990 IF ANS$=MVLEFT$ AND CRS>1 THEN CRS=CRS-1:PRINT ANS$;:IF ANS2$(CRS)=":" THEN 2040 ELSE IF INSTR("# 0123456789",ANS2$(CRS)) THEN 1960 ELSE 1990
2000 IF ASC(ANS$)<32 THEN 2040
2010 IF ANS2$(CRS)=" " THEN 2050
2020 IF 0<>INSTR("0123456789",ANS2$(CRS)) AND 0<>INSTR("0123456789",ANS$) THEN 2050
2030 IF ANS2$(CRS)="#" AND INSTR("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ANS$) THEN 2050
2040 PRINT BELL$;:GOTO 1960
2050 ANS1$(CRS-1)=ANS$:PRINT ANS$;MVLEFT$;:ANS$=MVRITE$:GOTO 1980
2060 IF LTH=0 THEN LAST$=ANS$:ANS$="" :RETURN
2070 IF INSTR("# ",ANS1$(LTH)) THEN LTH=LTH-1:GOTO 2060
2080 LAST$=ANS$
2090 ANS$=""
2100 FOR XYZ=1 TO LTH
2110 ANS$=ANS$+ANS1$(XYZ)
2120 NEXT XYZ
2130 RETURN
2140 PRINT CLS$
2150 PRINT FNPRTAT$(0,6) "Updating B:ACCOUNTS.DAT"
2160 OPEN "O", 1, "B:ACCOUNTS.DAT"
2170 FOR X=1 TO NUMACCTS
2180 PRINT# 1,ACNTCODE$(X)","ACNTLBL$(X)","ACNTBUDG!(X)
2190 NEXT X
2200 CLOSE
2210 PRINT "Updating B:RECLENTH.DAT"
2220 OPEN "R",1,"B:RECLENTH.DAT",2
2230 FIELD 1,2 AS RC$
2240 LSET RC$=MKI$(NUMRECS)
2250 PUT 1,VAL(DATE$)
2260 CLOSE
2265 PRINT:PRINT "Be sure to BACK UP "FNMONTH$(DATE$)" for new data!"
2266 PRINT"Thank you."
2270 SYSTEM
2280 DATA "Account code ................ :  :"
2290 DATA "Check number ................ :>C ;C ;C ;C ;C:"
2300 DATA "Day of the month ............ :>C <C:"
2310 DATA "Payee or payor .............. :                    :"
2320 DATA "Item description ............ :                :"
2330 DATA "Total ammount ............... :?C =C =C =C . =C ;C:"
2340 DATA "Tax included in total ammount :=C ;C ;C ;C . <C ;C:"
2350 DATA "Deductible item (T/F-RET) ... :#:"
2360 OPEN "R", 1, "B:"+FNMONTH$(DATE$)+".DAT",49
2370 FIELD 1, 2 AS ACNTCODE$, 2 AS CHK$, 2 AS DAY$, 20 AS PAYEE$, 16 AS ITEM$, 4 AS AMNT$, 2 AS TAX$, 1 AS DFLAG$
2380 PRINT CLS$;FNCENTER$("N E W   T R A N S A C T I O N S")
2390 PRINT:PRINT FNCENTER$("Today's Date: "+DATE$)
2400 FL=6:PCOL=0
2410 RESTORE 2280
2420 FOR X=1 TO 8
2430 PLIN(X)=FL
2440 FL=FL+1
2450 READ ANS$
2460 PROMPT$(X)=ANS$
2470 NEXT X
2480 FOR X=1 TO 8
2490 PRINT FNPRTAT$(0,PLIN(X)) PROMPT$(X)
2500 NEXT X
2510 X=1
2520 PRINT FNPRTAT$(0,4)FNCENTER$("Record #"+STR$(NUMRECS+1)):ON X GOTO 2530,2810,2870,2950,3000,5970,6040,6100
2530 B=-1:PRINT FNPRTAT$(0,20) "Enter a two character account code"
2540 PRINT "or press <RETURN> to ignore and return to menu."
2550 GOSUB 1860
2560 IF ANS$="" THEN CLOSE:GOTO 1610
2570 PRINT FNPRTAT$(0,20) DELINE$ DELINE$
2580 IF INSTR(ANS$," ") THEN PRINT BELL$;:GOTO 2530
2590 XX=1
2600 WHILE XX<=NUMACCTS AND ACNTCODE$(XX)<>ANS$
2610 XX=XX+1
2620 WEND
2630 IF XX>NUMACCTS THEN 2670
2640 PRINT FNPRTAT$(0,PLIN(X)) DELEND$ "Account:  "ACNTLBL$(XX)
2650 LSET ACNTCODE$=ANS$
2660 X=X+1:GOTO 2520
2670 PRINT FNPRTAT$(0,20) DELINE$ DELINE$ "Cannot find code in account label file."
2680 IF NUMACCTS=200 THEN 2790
2690 PRINT "Do you wish to add another label?  ";
2700 GOSUB 1810
2710 PRINT FNPRTAT$(0,20) DELINE$ DELINE$;
2720 IF YES$="N" THEN 2530
2730 PRINT "Enter label for code: "ANS$" ";
2740 INPUT;"",ANS2$
2750 NUMACCTS=NUMACCTS+1
2760 ACNTCODE$(NUMACCTS)=ANS$
2770 ACNTLBL$(NUMACCTS)=ANS2$
2780 GOTO 2640
2790 PRINT "And account file cannot be be extended."
2800 FOR XX=1 TO 500:NEXT XX:GOTO 2530
2810 PRINT FNPRTAT$(0,20)DELINE$ DELINE$"Enter a check number or other identification."
2820 PRINT "Use ESC key to clear entry."
2830 GOSUB 1860
2840 PRINT FNPRTAT$(0,20) DELINE$ DELINE$
2845 IF LAST$=MVUP$ AND B THEN X=X-1:B=0:GOTO 2520 ELSE B=-1 
2848 IF VAL(ANS$)>&H7FFF THEN PRINT BELL$;:GOTO 2810
2850 LSET CHK$=MKI$(VAL(ANS$))
2860 X=X+1:GOTO 2520
2870 PRINT FNPRTAT$(0,20)"Enter the day of transaction (01-31)."
2880 PRINT "Use ESC key to clear entry."
2890 GOSUB 1860
2900 PRINT FNPRTAT$(0,20) DELINE$ DELINE$
2905 IF LAST$=MVUP$ AND B THEN X=X-1:B=0:GOTO 2520 ELSE B=-1
2910 IF VAL(ANS$)<1 OR VAL(ANS$)>31 THEN PRINT BELL$;:GOTO 2870
2920 LSET DAY$=ANS$
2930 X=X+1
2940 GOTO 2520
2950 PRINT FNPRTAT$(0,20)"Enter the name of payee or payor."
2960 PRINT "Use arrow keys to move cursor."
2970 GOSUB 1860
2971 PRINT FNPRTAT$(0,20) DELINE$ DELINE$;
2975 IF LAST$=MVUP$ AND B THEN X=X-1:B=0:GOTO 2520 ELSE B=-1
2980 LSET PAYEE$=ANS$
2990 X=X+1:GOTO 2520
3000 PRINT FNPRTAT$(0,20)"Enter a description of the transaction or item."
3010 PRINT "User arrow keys to move cursor."
3020 GOSUB 1860
3030 PRINT FNPRTAT$(0,20) DELINE$ DELINE$
3035 IF LAST$=MVUP$ AND B THEN X=X-1:B=0:GOTO 2520 ELSE B=-1
3040 LSET ITEM$=ANS$
3050 X=X+1:GOTO 2520
3060 OPEN "R",2,"B:RECLENTH.DAT",2
3070 FIELD 2, 2 AS RC$
3080 LSET RC$=MKI$(NUMRECS)
3090 PUT#2,VAL(DATE$)
3100 CLOSE 2
3105 PRFL=0
3110 PRINT CLS$
3120 PRINT:PRINT:PRINT FNCENTER$("C A L C U L A T E   A N D   R E P O R T")
3130 PRINT:PRINT "  "FNCENTER$(STRSCR$+"Report Menu"+ENDSCR$)
3140 PRINT:IF DUM=5 THEN PRINT "  "FNCENTER$(DARK$+"Printer disabled"+BRITE$)
3150 IF DUM<>5 THEN PRINT "  "FNCENTER$(DARK$+"PRINTER ENABLED"+BRITE$)
3160 PRINT
3170 PRINT FNCENTER$("(1) Toggle printer enable/disable            ")
3180 PRINT
3190 PRINT FNCENTER$("(2) Calculate expenses by account            ")
3200 PRINT FNCENTER$("(3) Calculate deductible expenses by account ")
3210 PRINT FNCENTER$("(4) Calculate expenses by payee under account")
3220 PRINT FNCENTER$("(5) Calculate expenses by item under account ")
3230 PRINT
3240 PRINT FNCENTER$("(6) Calculate expenses by payee              ")
3250 PRINT FNCENTER$("(7) Calculate expenses by account under payee")
3260 PRINT
3270 PRINT FNCENTER$("(0) Return to Main Menu                      ")
3280 PCOL=0:PLIN=22:PROMPT$=FNCENTER$("Please enter your selection :0:")
3290 GOSUB 1880
3300 IF ANS$="0" THEN IF PRFL THEN LPRINT CHR$(&H1B)"@";:GOTO 1610 ELSE 1610
3310 IF ANS$>"7" THEN PRINT BELL$;:GOTO 3280
3320 ON VAL(ANS$) GOSUB 3340,3360,4200,4380,4600,4820,5400
3330 GOTO 3110
3340 PRFL=-1:DUM=-DUM:IF DUM=5 THEN RETURN
3341 PRINT CLS$"Position printer to top of form and press <RETURN>."
3342 ANS$=INPUT$(1)
3343 LPRINT:LPRINT:LPRINT:LPRINT:LPRINT
3344 LPRINT CHR$(&H1B)"@"CHR$(&H1B)"N"CHR$(10);
3350 RETURN
3360 PRINT CLS$
3370 PRINT FNCENTER$("Calculation of Expenses by Account")
3380 PRINT:PRINT:PRINT
3390 PRINT "Expenses for all accounts?  ";
3400 GOSUB 1810
3410 IF YES$="Y" THEN ACD$="":GOTO 3520
3420 PLIN=6:PCOL=0:PROMPT$="Enter Code of desired account :  :"
3430 GOSUB 1880
3440 IF ANS$="" THEN PRINT BELL$;:GOTO 3420
3450 X=1:A=0
3460 WHILE X<=NUMACCTS AND A=0
3470 IF ACNTCODE$(X)=ANS$ THEN A=-1:GOTO 3490
3480 X=X+1
3490 WEND
3500 IF X>NUMACCTS THEN PRINT BELL$;:GOTO 3420
3510 ACD$=ANS$
3520 PE$="":IT$="":DED=0
3530 PRINT CR$ LF$"Do you want records for the whole year?  ";
3540 GOSUB 1810
3550 IF YES$="Y" THEN A=1 ELSE A=VAL(DATE$)
3560 PRINT CLS$:TOTAL!=0:TOTTAX!=0
3570 FOR MONTH=A TO VAL(DATE$)
3580 IF ACD$="" THEN 3610 ELSE ACNT=0
3590 GOSUB 3760
3595 TOTAL!=TOTAL!+SUM!:TOTTAX!=TOTTAX!+TAX!
3600 GOTO 3680
3610 FOR ACNT=1 TO NUMACCTS
3620 ACD$=ACNTCODE$(ACNT)
3630 GOSUB 3760
3640 IF ACD$="DP" THEN TOTAL!=TOTAL!+SUM!:TOTTAX!=TOTTAX!-TAX!:GOTO 3660
3650 TOTAL!=TOTAL!-SUM!:TOTTAX!=TOTTAX!+TAX!
3660 NEXT ACNT
3670 ACD$=""
3680 NEXT MONTH
3690 IF DUM=5 THEN 3710
3700 LPRINT:LPRINT USING "                                               TOTAL       $$###.##- ###.##-";TOTAL!;TOTTAX!
3705 LPRINT CHR$(12);
3710 PRINT:PRINT USING "Total deposits less expenses:  $$###.##-";TOTAL!
3720 PRINT USING       "Total taxes:                   $$###.##-";TOTTAX!
3730 PRINT:PRINT"Generate same report?  ";
3740 GOSUB 1810:IF YES$="Y" THEN 3560
3750 RETURN
3760 SUM!=0:TAX!=0
3770 U$="   \\   #####  \                  \  \                  \  $$###.##  ###.##"
3780 IF DUM=5 THEN 3910
3790 LPRINT:LPRINT "Account code:  ";ACD$
3800 IF ACNT>0 THEN 3850
3810 A=0
3820 WHILE ACNT<=NUMACCTS AND A=0
3830 ACNT=ACNT+1:IF ACD$=ACNTCODE$(ACNT) THEN A=-1
3840 WEND
3850 LPRINT "Account name:  ";ACNTLBL$(ACNT)
3860 LPRINT"Month:  "FNMONTH$(STR$(MONTH))
3870 LPRINT "Date of generation:  ";DATE$
3880 LPRINT
3890 LPRINT "  DATE  CHECK  PAYEE                 ITEM                    AMOUNT     TAX"CR$;
3900 LPRINT "  ____  _____  ____________________  ____________________  ________  ______"
3910 PRINT:PRINT:PRINT "Account code:  "ACD$,"Month:  "FNMONTH$(STR$(MONTH))
3920 IF PE$<>"" THEN PRINT "Payee:  "PE$
3930 IF IT$<>"" THEN PRINT "Item:  "IT$
3940 PRINT
3950 OPEN "R", 1, "B:"+FNMONTH$(STR$(MONTH))+".DAT",49
3960 FIELD 1, 2 AS ACNTCODE$, 2 AS CHK$, 2 AS DAY$, 20 AS PAYEE$, 16 AS ITEM$, 4 AS AMNT$, 2 AS TAX$, 1 AS DFLAG$
3970 OPEN "R",2,"B:RECLENTH.DAT",2
3980 FIELD 2, 2 AS RC$
3990 GET#2,MONTH
4000 RC=CVI(RC$)
4010 CLOSE 2
4020 FOR REC=1 TO RC
4030 GET# 1
4040 IF ACD$<>ACNTCODE$ THEN 4130
4050 IF DED THEN IF DFLAG$<>"T" THEN 4130 ELSE 4100
4060 IF PE$="" THEN 4080
4070 IF INSTR(PAYEE$,PE$) THEN 4100 ELSE 4130
4080 IF INSTR(ITEM$,IT$)=0 THEN 4130
4090 IF DFLAG$="T" THEN D$="  D" ELSE D$=""
4100 IF DUM=-5 THEN LPRINT USING U$+D$;DAY$;CVI(CHK$);PAYEE$;ITEM$;CVS(AMNT$);CVI(TAX$)/100
4110 SUM!=SUM!+CVS(AMNT$)
4120 TAX!=TAX!+CVI(TAX$)/100
4130 NEXT REC
4140 PRINT USING "Subtotal of expenses:  $$###.##";SUM!
4150 PRINT USING "Subtotal of taxes:     $$###.##";TAX!
4160 IF DUM=5 THEN 4180
4170 LPRINT USING "                                            SUBTOTAL       $$###.##  ###.##";SUM!;TAX!
4180 CLOSE
4190 RETURN
4200 PRINT CLS$
4210 PRINT FNCENTER$("Calculation of Deductible Expenses by Account")
4220 PRINT:PRINT:PRINT
4230 PRINT "Deductible expenses for all accounts?  ";
4240 GOSUB 1810
4250 IF YES$="Y" THEN ACD$="":GOTO 4360
4260 PLIN=6:PCOL=0:PROMPT$="Enter Code of desired account :  :"
4270 GOSUB 1880
4280 IF ANS$="" THEN PRINT BELL$;:GOTO 4260
4290 X=1:A=0
4300 WHILE X<=NUMACCTS AND A=0
4310 IF ACNTCODE$(X)=ANS$ THEN A=-1:GOTO 4330
4320 X=X+1
4330 WEND
4340 IF X>NUMACCTS THEN PRINT BELL$;:GOTO 4260
4350 ACD$=ANS$
4360 PE$="":IT$="":DED=-1
4370 GOTO 3530
4380 PRINT CLS$
4390 PRINT FNCENTER$("Calculation by Payee Under Account")
4400 PRINT:PRINT:PRINT
4410 PRINT "Expenses for all accounts?  ";
4420 GOSUB 1810
4430 IF YES$="Y" THEN ACD$="":GOTO 4540
4440 PLIN=6:PCOL=0:PROMPT$="Enter Code of desired account :  :"
4450 GOSUB 1880
4460 IF ANS$="" THEN PRINT BELL$;:GOTO 4440
4470 X=1:A=0
4480 WHILE X<=NUMACCTS AND A=0
4490 IF ACNTCODE$(X)=ANS$ THEN A=-1:GOTO 4510
4500 X=X+1
4510 WEND
4520 IF X>NUMACCTS THEN PRINT BELL$;:GOTO 4440
4530 ACD$=ANS$
4540 PE$="":IT$="":DED=0
4550 PLIN=7:PCOL=0:PROMPT$="Enter name of payee :                    :"
4560 GOSUB 1880
4570 IF ANS$="" THEN PRINT BELL$;:GOTO 4540
4580 PE$=ANS$
4590 GOTO 3530
4600 PRINT CLS$
4610 PRINT FNCENTER$("Calculation by Item Under Account")
4620 PRINT:PRINT:PRINT
4630 PRINT "Expenses for all accounts?  ";
4640 GOSUB 1810
4650 IF YES$="Y" THEN ACD$="":GOTO 4760
4660 PLIN=6:PCOL=0:PROMPT$="Enter Code of desired account :  :"
4670 GOSUB 1880
4680 IF ANS$="" THEN PRINT BELL$;:GOTO 4660
4690 X=1:A=0
4700 WHILE X<=NUMACCTS AND A=0
4710 IF ACNTCODE$(X)=ANS$ THEN A=-1:GOTO 4730
4720 X=X+1
4730 WEND
4740 IF X>NUMACCTS THEN PRINT BELL$;:GOTO 4660
4750 ACD$=ANS$
4760 PE$="":IT$="":DED=0
4770 PLIN=7:PCOL=0:PROMPT$="Enter name of item :                :"
4780 GOSUB 1880
4790 IF ANS$="" THEN PRINT BELL$;:GOTO 4760
4800 IT$=ANS$
4810 GOTO 3530
4820 PRINT CLS$
4830 PRINT FNCENTER$("Calculation of Expenses by Payee")
4840 PRINT:PRINT:PRINT
4850 PLIN=6:PCOL=0:PROMPT$="Enter name of desired Payee :                    :"
4860 GOSUB 1880
4870 IF ANS$="" THEN PRINT BELL$;:GOTO 4850
4880 PE$=ANS$
4890 ACD$=""
4900 PRINT CR$ LF$"Do you want records for the whole year?  ";
4910 GOSUB 1810
4920 IF YES$="Y" THEN A=1 ELSE A=VAL(DATE$)
4930 PRINT CLS$:TOTAL!=0:TOTTAX!=0
4940 FOR MONTH=A TO VAL(DATE$)
4950 GOSUB 5040:TOTAL!=TOTAL!+SUM!:TOTTAX!=TOTTAX!+TAX!
4960 NEXT MONTH
4970 IF DUM=5 THEN 4990
4980 LPRINT:LPRINT USING "                                               TOTAL       $$###.##- ###.##-";TOTAL!;TOTTAX!
4990 PRINT:PRINT USING "Total expenses:  $$###.##-";TOTAL!
5000 PRINT USING "Total taxes:     $$###.##-";TOTTAX!
5010 PRINT:PRINT"Generate same report?  ";
5020 GOSUB 1810:IF YES$="Y" THEN 4930
5030 RETURN
5040 SUM!=0:TAX!=0
5050 U$="   \\   #####  \                  \  \                  \  $$###.##  ###.##"
5060 IF DUM=5 THEN 5130
5070 LPRINT:LPRINT "Payee:  ";PE$
5080 LPRINT"Month:  "FNMONTH$(STR$(MONTH))
5090 LPRINT "Date of report:  ";DATE$
5100 LPRINT
5110 LPRINT "  DATE  CHECK  ACCOUNT               ITEM                   AMMOUNT     TAX"CR$;
5120 LPRINT "  ____  _____  ____________________  ____________________  ________  ______"
5130 PRINT:PRINT:PRINT "Payee:  "PE$,"Month:  "FNMONTH$(STR$(MONTH))
5140 IF ACD$<>"" THEN PRINT "Account:  "ACD$
5150 PRINT
5160 OPEN "R", 1, "B:"+FNMONTH$(STR$(MONTH))+".DAT",49
5170 FIELD 1, 2 AS ACNTCODE$, 2 AS CHK$, 2 AS DAY$, 20 AS PAYEE$, 16 AS ITEM$, 4 AS AMNT$, 2 AS TAX$, 1 AS DFLAG$
5180 OPEN "R",2,"B:RECLENTH.DAT",2
5190 FIELD 2, 2 AS RC$
5200 GET#2,MONTH
5210 RC=CVI(RC$)
5220 CLOSE 2
5230 FOR REC=1 TO RC
5240 GET# 1
5250 IF 0=INSTR(PAYEE$,PE$) THEN 5330
5260 IF ACD$=ACNTCODE$ THEN 5280
5270 IF ACD$<>"" THEN 5330
5280 IF DUM=5 THEN 5310
5290 IF DFLAG$="T" THEN D$="  D" ELSE D$=""
5291 AZ=1:WHILE ACNTCODE$(AZ)<>ACNTCODE$
5292 AZ=AZ+1:WEND
5300 LPRINT USING U$+D$;DAY$;CVI(CHK$);ACNTLBL$(AZ);ITEM$;CVS(AMNT$);CVI(TAX$)/100
5310 SUM!=SUM!+CVS(AMNT$)
5320 TAX!=TAX!+CVI(TAX$)/100
5330 NEXT REC
5340 PRINT USING "Subtotal of expenses:  $$###.##";SUM!
5350 PRINT USING "Subtotal of taxes:     $$###.##";TAX!
5360 IF DUM=5 THEN 5380
5370 LPRINT USING "                                            SUBTOTAL       $$###.##  ###.##";SUM!;TAX!
5380 CLOSE
5390 RETURN
5400 PRINT CLS$
5410 PRINT FNCENTER$("Calculation by Account Under Payee")
5420 PLIN=5:PCOL=0:PROMPT$="Enter code of desired account :  :"
5430 GOSUB 1880
5440 IF ANS$="" THEN PRINT BELL$;:GOTO 5420
5450 X=1:A=0
5460 WHILE X<=NUMACCTS AND A=0
5470 IF ACNTCODE$(X)=ANS$ THEN A=-1:GOTO 5490
5480 X=X+1
5490 WEND
5500 IF X>NUMACCTS THEN PRINT BELL$;:GOTO 5420
5510 ACD$=ANS$
5520 PLIN=7:PCOL=0:PROMPT$="Enter name of payee :                    :"
5530 GOSUB 1880
5540 IF ANS$="" THEN PRINT BELL$;:GOTO 5520
5550 PE$=ANS$
5560 GOTO 4900
5570 ACNT=1:PRINT CLS$;"C A L C U L A T I N G !  ";
5580 OPEN "R", 1, "B:"+FNMONTH$(DATE$)+".DAT",49
5590 FIELD 1, 2 AS ACNTCODE$, 2 AS CHK$, 2 AS DAY$, 20 AS PAYEE$, 16 AS ITEM$, 4 AS AMNT$, 2 AS TAX$, 1 AS DFLAG$
5595 DIM ACNTEX!(200)
5600 FOR REC=1 TO NUMRECS
5605 GET 1:ACNT=1
5610 WHILE ACNT<=NUMACCTS
5615 IF ACNTCODE$(ACNT)=ACNTCODE$ THEN ACNTEX!(ACNT)=ACNTEX!(ACNT)+CVS(AMNT$):ACNT=NUMACCTS
5620 ACNT=ACNT+1
5625 WEND
5630 NEXT REC:CLOSE:ACNT=1
5650 U$=" \\    \                  \   ####.##    ####.##      ####.##-"
5660 PRINT CLS$;"Send output to printer?  ";:GOSUB 1810:IF YES$="Y" THEN P=-1 ELSE P=0
5661 IF NOT P THEN 5670
5662 LPRINT FNLCNTR$("B U D G E T   R E V I E W") CR$ FNLCNTR$("_____________________________________")
5663 LPRINT FNLCNTR$("Date of generation:  "+DATE$):LPRINT:LPRINT FNLCNTR$("CODE   ACCOUNT                 BUDGET    EXPENSE    DIFFERENCE")CR$;
5664 LPRINT FNLCNTR$("____   ____________________    ______    _______    __________")
5670 PRINT CLS$ FNCENTER$("B U D G E T   R E V I E W")
5680 PRINT FNPRTAT$(0,2)"CODE   ACCOUNT                 BUDGET    EXPENSE    DIFFERENCE"
5690 PRINT "----   --------------------    ------    -------    ----------"
5700 LN=1
5710 WHILE ACNT<=NUMACCTS AND LN<11
5770 PRINT USING U$;ACNTCODE$(ACNT);ACNTLBL$(ACNT);ACNTBUDG!(ACNT);ACNTEX!(ACNT);ACNTBUDG!(ACNT)-ACNTEX!(ACNT)+.004
5775 IF NOT P THEN 5780
5776 LPRINT USING "         "+U$;ACNTCODE$(ACNT);ACNTLBL$(ACNT);ACNTBUDG!(ACNT);ACNTEX!(ACNT);ACNTBUDG!(ACNT)-ACNTEX!(ACNT)+.004
5780 LN=LN+1:ACNT=ACNT+1
5790 WEND
5795 IF P AND ACNT<=NUMACCTS THEN 5670
5800 PRINT FNPRTAT$(0,23)"Continue - 'Y' | Main Menu - 'N'  ";
5810 GOSUB 1810
5820 IF YES$= "Y" AND ACNT<=NUMACCTS THEN 5670
5825 ERASE ACNTEX!:CLOSE:GOTO 1610
5880 PRINT CLS$
5890 PRINT FNPRTAT$(0,12) FNCENTER$("LOADING SEARCH OVERLAY");
5895 PRINT FNPRTAT$(53,0);
5900 CHAIN "A:SEARCH.BAS"
5910 PRINT CLS$
5920 PRINT FNPRTAT$(0,12)FNCENTER$("LOADING RECORD EDITOR OVERLAY");
5925 PRINT FNPRTAT$(53,0);
5930 CHAIN "A:FIXTRANS.BAS"
5940 PRINT CLS$
5950 PRINT FNPRTAT$(0,12)FNCENTER$("LOADING THE BUDGET EDITOR OVERLAY");
5955 PRINT FNPRTAT$(53,0);
5960 CHAIN "A:EDITBUDG.BAS"
5970 PRINT FNPRTAT$(0,20) "Enter the amount of the transaction."
5980 PRINT "This is the total amount including tax."
5990 PRINT "Use ESC key to clear entry."
6000 GOSUB 1860
6010 PRINT FNPRTAT$(0,20) DELINE$ DELINE$ DELINE$
6015 IF LAST$=MVUP$ AND B THEN X=X-1:B=0:GOTO 2520 ELSE B=-1
6020 LSET AMNT$=MKS$(VAL(ANS$))
6030 X=X+1:GOTO 2520
6040 PRINT FNPRTAT$(0,20) "Enter the amount of tax."
6050 PRINT "Use ESC key to clear entry."
6060 GOSUB 1860
6070 PRINT FNPRTAT$(0,20) DELINE$ DELINE$
6075 IF LAST$=MVUP$ AND B THEN X=X-1:B=0:GOTO 2520 ELSE B=-1
6080 LSET TAX$=MKI$(VAL(ANS$)*100)
6090 X=X+1:GOTO 2520
6100 PRINT FNPRTAT$(0,20) "Enter 'T' for deductible items.  Enter 'F'"
6110 PRINT "or <RETURN> for nondeductible items."
6120 GOSUB 1860
6130 PRINT FNPRTAT$(0,20) DELINE$ DELINE$
6135 IF LAST$=MVUP$ AND B THEN X=X-1:B=0:GOTO 2520 ELSE B=-1
6140 LSET DFLAG$=ANS$
6150 NUMRECS=NUMRECS+1
6160 PUT 1, NUMRECS
6170 GOTO 2480
7000 IF FRE(0)>500 THEN RETURN
7010 FOR BL=1 TO 7:PRINT BELL$;:POKE &HEF6B,3
7020 PRINT FNPRTAT$(0,PLIN) DELEND$ FNCENTER$("=======> GARBAGE COLLECTION IN PROGRESS <=======");
7030 FOR BLL=1 TO 20:NEXT BLL, BL:BL=FRE(A$)
7040 PRINT CR$ DELEND$;:RETURN
8000 IF VAL(DATE$)=1 THEN LM=12 ELSE LM=VAL(DATE$)-1
8010 OPEN "R",1,"B:RECLENTH.DAT",2
8020 FIELD 1, 2 AS RC$
8030 GET#1,LM
8040 IF CVI(RC$)>0 THEN 8100
8050 PRINT FNPRTAT$(0,20)"Nothing to bring forward!  Please press <RETURN>.    ";
8060 ANS$=INPUT$(1):GOSUB 7040:CLOSE:GOTO 1750
8100 GOSUB 9000:CLOSE:GOTO 1610
9000 OLDRECS=CVI(RC$):
9010 PRINT CLS$ FNCENTER$("FOWARDING BALANCE")
9020 PRINT FNPRTAT$(0,5)"Calculating last "FNMONTH$(STR$(LM))"'s balance..."
9030 OPEN "R", 2, "B:"+FNMONTH$(STR$(LM))+".DAT",49
9040 FIELD 2, 2 AS ACNTCODE$, 2 AS CHK$, 2 AS DAY$, 20 AS PAYEE$, 16 AS ITEM$, 4 AS AMNT$, 2 AS TAX$, 1 AS DFLAG$
9050 SUM!=0
9060 FOR X=1 TO OLDRECS
9070 GET#2,X
9080 IF ACNTCODE$="DP" THEN SUM!=SUM!+CVS(AMNT$) ELSE SUM!=SUM!-CVS(AMNT$)
9090 NEXT
9100 IF SUM!<>0 THEN 9200
9110 PRINT:PRINT FNMONTH$(STR$(LM))"'s balance is zero.  Nothing to bring forward!"
9120 PRINT"Please press <RETURN>."
9125 ANS$=INPUT$(1)
9130 RETURN
9200 PRINT:PRINT"Current balance for "FNMONTH$(STR$(LM))" is ";
9210 PRINT USING"$$,###.##-";SUM!
9220 PRINT"Adjusting data files to bring balance forward..."
9300 GOSUB 9500
9310 LM=LM+1:IF LM=13 THEN LM=1
9320 SUM!=-SUM!
9330 GOSUB 9500
9340 NUMRECS=NUMRECS+1:RETURN
9500 CLOSE 2
9510 GET#1,LM
9520 NR=CVI(RC$)
9530 NR=NR+1
9540 LSET RC$=MKI$(NR)
9550 PUT#1,LM
9560 OPEN "R", 2, "B:"+FNMONTH$(STR$(LM))+".DAT",49
9570 FIELD 2, 2 AS ACNTCODE$, 2 AS CHK$, 2 AS DAY$, 20 AS PAYEE$, 16 AS ITEM$, 4 AS AMNT$, 2 AS TAX$, 1 AS DFLAG$
9580 IF SUM!>0 THEN LSET ACNTCODE$="MS" ELSE LSET ACNTCODE$="DP"
9590 LSET CHK$=MKI$(0):LSET DAY$="00"
9600 IF LM=VAL(DATE$) THEN X=LM-1 ELSE X=LM+1
9610 LSET PAYEE$=FNMONTH$(STR$(X))
9620 LSET ITEM$="BBF":LSET AMNT$=MKS$(ABS(SUM!))
9630 LSET TAX$=MKI$(0):LSET DFLAG$=" "
9640 PUT#2,NR
9650 RETURN
10000 PCOL=INSTR(PCOL+1,PROMPT$,"."):IF PCOL=0 THEN PCOL=LEN(PROMPT$) ELSE CRS=CRS-(LEN(PROMPT$)-PCOL)
10010 PCOL=PCOL+A-1:ANS2$=""
10020 PRINT FNPRTAT$(PCOL,PLIN);
10030 ANS$=INPUT$(1)
10040 IF ANS$=CR$ OR ANS$=MVUP$ THEN 10200
10050 IF ANS$=ESC$ THEN 10300
10060 IF INSTR(".0123456789",ANS$)=0 THEN 10400
10070 IF ANS$="." THEN IF ANS2$(CRS)="." THEN CRS=CRS+1:PRINT"."; ELSE 10400
10080 ANS2$=RIGHT$(ANS2$+ANS$,CRS-2)
10090 PRINT STRING$(LEN(ANS2$),8) ANS2$;
10100 IF ANS$<>"." THEN 10030
10110 ANS$=INPUT$(1)
10120 IF ANS$=CR$ OR ANS$=MVUP$ THEN 10200
10130 IF ANS$=ESC$ THEN 10300
10140 IF INSTR("0123456789",ANS$)=0 THEN 10500
10150 ANS2$=ANS2$+ANS$:PRINT STRING$(LEN(ANS2$)-1,8) ANS2$;
10160 CRS=CRS+1:IF ANS2$(CRS)=":" THEN PRINT BELL$;:GOTO 10600
10170 GOTO 10110
10200 LAST$=ANS$:ANS$=ANS2$:RETURN
10300 PCOL=A:GOTO 1880
10400 PRINT BELL$;:GOTO 10030
10500 PRINT BELL$;:GOTO 10110
10600 ANS$=INPUT$(1)
10610 IF ANS$=CR$ OR ANS$=MVUP$ THEN 10200
10620 IF ANS$=ESC$ THEN 10300
10630 PRINT BELL$;:GOTO 10600
30000 SAVE"BUDG.BAS"
0610 IF ANS$=CR$ OR ANS$=MVUP$ THEN 10200
10620 IF ANS$=ESC$ THEN 10300
10630 P