10 DEFINT A-Z
15 DEF FNCENTER$(A$)=STRING$(26-LEN(A$)/2-.5," ")+A$
20 DEF FNLCNTR$(A$)=STRING$(40-LEN(A$)/2-.5," ")+A$
25 DEF FNVERTAB$(A)=STRING$(A!,LF$)
30 DEF FNPRTAT$(X,Y)=CHR$(&H1B)+"="+CHR$(Y+32)+CHR$(X+32)
35 DEF FNMONTH$(X$)=MID$("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC",(VAL(X$)-1)*3+1,3)
40 COMMON ANS1$(),ANS2$(),ACNTCODE$(),ACNTLBL$(),ACNTBUDG!(),NUMRECS,DATE$,NUMACCTS
45 COMMON CLS$,DARK$,ESC$,BRITE$,STRSCR$,ENDSCR$
50 COMMON MVLEFT$,MVRITE$,MVDOWN$,MVUP$,CR$,LF$
55 COMMON TF$,DELEND$,DELINE$,DELCHA$,MOVSCR$
60 COMMON MOVCUR$,BELL$
1180 PRINT CLS$ FNCENTER$("T R A N S A C T I O N   R E P A I R")
1190 PRINT FNPRTAT$(0,6)"     This function allows you to repair mistakes"
1200 PRINT "entered into a record under the New Transactions"
1210 PRINT "routine.  Patches can be made only to the "FNMONTH$(DATE$)".DAT"
1220 PRINT "file.  To make changes to another file you must"
1230 PRINT "exit this program and enter it again.  When asked"
1240 PRINT "for the date, type in the month as the month in"
1250 PRINT "which the error exists."
1260 PRINT 
1270 PRINT "     To fix a record you must know its record"
1280 PRINT "number.  If you do not know this number, find it"
1290 PRINT "by using the Search command from the Main Menu."
1300 PRINT "If you need to do this, answer the next question"
1310 PRINT "by pressing the letter 'N.'"
1330 PRINT FNPRTAT$(0,20)"     Do you wish to continue (Y/N)?  ";
1340 GOSUB 2120
1350 IF YES$="N" THEN 2480
1360 PLIN=22:PCOL=5:PROMPT$="What is the record number to fix?  ::C 8C 8C 7C:"
1370 GOSUB 2170
1380 FIXREC=VAL(ANS$)
1390 IF FIXREC<1 OR FIXREC>NUMRECS THEN PRINT BELL$;:GOTO 1360
1400 OPEN "R", 1, "B:"+FNMONTH$(DATE$)+".DAT",49
1410 GET 1, FIXREC
1420 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$
1430 PRINT CLS$ "Record #"FIXREC"  Today's date:  " DATE$
1440 PRINT FNPRTAT$(0,2) "(1) Account code:     " ACNTCODE$
1450 '
1460 X=1
1470 WHILE X<=NUMACCTS AND ACNTCODE$(X)<>ACNTCODE$
1480	X=X+1
1490 WEND
1500 IF X>NUMACCTS THEN PRINT "Cannot find account!":GOTO 1530
1510 PRINT "    (" ACNTLBL$(X) ")"
1520 '
1530 PRINT "(2) Check number:    "  CVI(CHK$)
1540 PRINT "(3) Transaction date: " DAY$
1550 PRINT "(4) Payee:            " PAYEE$
1560 PRINT "(5) Item description: " ITEM$
1570 PRINT USING "(6) Ammount of trans:   $$##.##";CVS(AMNT$)
1580 PRINT USING "(7) Taxes included:      ###.##";CVI(TAX$)/100
1590 PRINT "(8) Deductible:       " DFLAG$
1600 '
1610 PRINT FNPRTAT$(1,16) DELINE$ DELINE$ DELINE$ "Enter the number of the field to reenter, or enter"
1620 PRINT FNCENTER$("a (9) to save changes or a (0) to ignore changes.")
1630 PROMPT$=FNCENTER$(":0:"):PLIN=18:PCOL=0
1635 GOSUB 2170
1640 DUM=VAL(ANS$)+1
1650 ON DUM GOSUB 1695,1710,1760,1810,1860,1910,1960,2010,2060,1690
1660 IF DUM>1 AND DUM<10 THEN 1440 ELSE 1330
1680 GOTO 2480
1690 PUT# 1, FIXREC
1695 CLOSE
1700 RETURN
1710 PRINT FNPRTAT$(0,16) DELINE$ DELINE$ DELINE$
1720 PLIN=16:PCOL=0:PROMPT$="Account code .... :  :"
1730 GOSUB 2170
1740 LSET ACNTCODE$=ANS$
1750 RETURN
1760 PRINT FNPRTAT$(0,16) DELINE$ DELINE$ DELINE$
1770 PLIN=16:PCOL=0:PROMPT$="Check number ... :>C ;C :C :C :C:
1780 GOSUB 2170:IF VAL(ANS$)>&H7FFF THEN PRINT BELL$;:GOTO 1760
1790 LSET CHK$=MKI$(VAL(ANS$))
1800 RETURN
1810 PRINT FNPRTAT$(0,16) DELINE$ DELINE$ DELINE$
1820 PLIN=16:PCOL=0:PROMPT$="Day of the month ... :=C ;C:"
1830 GOSUB 2170:IF VAL(ANS$)>31 OR VAL(ANS$)<0 THEN PRINT BELL$;:GOTO 1820
1840 LSET DAY$=ANS$
1850 RETURN
1860 PRINT FNPRTAT$(0,16) DELINE$ DELINE$ DELINE$
1870 PLIN=16:PCOL=0:PROMPT$="Payee or payor ... :                    :"
1880 GOSUB 2170
1890 LSET PAYEE$=ANS$
1900 RETURN
1910 PRINT FNPRTAT$(0,16) DELINE$ DELINE$ DELINE$
1920 PLIN=16:PCOL=0:PROMPT$="Item description ... :                :"
1930 GOSUB 2170
1940 LSET ITEM$=ANS$
1950 RETURN
1960 PRINT FNPRTAT$(0,16) DELINE$ DELINE$ DELINE$
1970 PLIN=16:PCOL=0:PROMPT$="Total ammount ... :=C ;C ;C ;C . <C :C:"
1980 GOSUB 2170
1990 LSET AMNT$=MKS$(VAL(ANS$))
2000 RETURN
2010 PRINT FNPRTAT$(0,16) DELINE$ DELINE$ DELINE$
2020 PLIN=16:PCOL=0:PROMPT$="Tax included ... :<C 9C 9C 9C . :C 9C:"
2030 GOSUB 2170
2040 LSET TAX$=MKI$(VAL(ANS$)*100)
2050 RETURN
2060 PRINT FNPRTAT$(0,16) DELINE$ DELINE$ DELINE$
2070 PLIN=16:PCOL=0:PROMPT$="Deductible item (T/F-RET) ... : :"
2080 GOSUB 2170
2090 IF INSTR("FT ",ANS$)=0 THEN PRINT BELL$;:GOTO 2080
2100 LSET DFLAG$=ANS$
2110 RETURN
2120 YES$=INPUT$(1)
2140 IF YES$="Y" OR YES$="N" THEN PRINT YES$;:RETURN
2150 PRINT BELL$;
2160 GOTO 2120
2170 PRINT FNPRTAT$(PCOL,PLIN)PROMPT$;:A=PCOL
2180 PCOL=INSTR(PROMPT$,":"):CRS=INSTR(PCOL+1,PROMPT$,":")-PCOL+1
2190 FOR XYZ=1 TO CRS
2200 ANS2$(XYZ)=MID$(PROMPT$,XYZ+PCOL-1,1)
2210 IF XYZ<>1 THEN ANS1$(XYZ-1)=ANS2$(XYZ)
2220 NEXT XYZ:IF ANS1$(1)=CHR$(160) THEN 10000 ELSE PCOL=A+PCOL
2230 LTH=CRS-2
2240 GOSUB 7000:PRINT FNPRTAT$(PCOL,PLIN);:CRS=2
2250 ANS$=INPUT$(1)
2260 IF ANS$=CR$ THEN 2350
2270 IF ANS$=MVRITE$ AND CRS<LTH+2 THEN CRS=CRS+1:PRINT ANS$;:IF ANS2$(CRS)=":" THEN 2330 ELSE IF INSTR("# 0123456789",ANS2$(CRS)) THEN 2250 ELSE 2270
2280 IF ANS$=MVLEFT$ AND CRS>1 THEN CRS=CRS-1:PRINT ANS$;:IF ANS2$(CRS)=":" THEN 2330 ELSE IF INSTR("# 0123456789",ANS2$(CRS)) THEN 2250 ELSE 2280
2290 IF ASC(ANS$)<32 THEN 2330
2300 IF ANS2$(CRS)=" " THEN 2340
2310 IF 0<>INSTR("0123456789",ANS2$(CRS)) AND 0<>INSTR("0123456789",ANS$) THEN 2340
2320 IF ANS2$(CRS)="#" AND INSTR("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ANS$) THEN 2340
2330 PRINT BELL$;:GOTO 2250
2340 ANS1$(CRS-1)=ANS$:PRINT ANS$;MVLEFT$;:ANS$=MVRITE$:GOTO 2270
2350 IF LTH=0 THEN ANS$="" :RETURN
2360 IF INSTR("# ",ANS1$(LTH)) THEN LTH=LTH-1:GOTO 2350
2370 LAST$=ANS$
2380 ANS$=""
2390 FOR XYZ=1 TO LTH
2400 ANS$=ANS$+ANS1$(XYZ)
2410 NEXT XYZ
2420 RETURN
2480 PRINT CLS$ FNPRTAT$(0,12) FNCENTER$("RETURNING TO MAIN MENU");
2490 PRINT FNPRTAT$(53,0);
3000 CHAIN "A:BUDG.BAS", 1600
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
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 2170
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"FIXTRANS.BAS"
 IF ANS$=CR$ OR ANS$=MVUP$ THEN 10200
10620 IF ANS$