110 DIM E$(M,2),E(M,25),P(10),NI$(1),M$(7),P$(24),T$(3)
120 X=5:GPTR=1
130 TAX$="LHPVTFD"
140 NI$(0)="ABCILMPRSTVW"
150 NI$(1)="DEFGHKNO"
160 B$=STRING$(78," "):PAYFILE$="paydata"
300 FOR J=0 TO 7:READ M$(J):NEXT
310 FOR J=0 TO 24:READ P$(J):NEXT
400 DATA SET UP NEW DATA-FILE
401 DATA ADD EMPLOYEE
402 DATA DELETE EMPLOYEE
403 DATA EMPLOYEE DETAILS
404 DATA 'P35' LISTING
405 DATA 'BLANKET' TAX CODE CHANGES
406 DATA "RECORD DATA to DISC"
407 DATA 'END'
410 DATA TAX CODE
411 DATA WEEK/MONTH 1 BASIS (Y/N)
412 DATA N.I. TABLE
413 DATA PAY/HOUR
414 DATA PAY/PERIOD
415 DATA G.P. TO DATE
416 DATA TAX TO DATE
417 DATA N.I. (EE) (NOW)
418 DATA N.I. (EE) (LAST)
419 DATA N.I. (ER) (NOW)
420 DATA N.I. (ER) (LAST)
421 DATA PENSION % (EE)
422 DATA PEN TO DATE (EE)
423 DATA PENSION % (ER)
424 DATA PEN TO DATE (ER)
425 DATA N.I. U/B (EE)
426 DATA N.I. U/B (ER)
427 DATA SSP TO DATE
428 DATA G.P. PREVIOUS
429 DATA TAX PREVIOUS
430 DATA PAID TO TAX PERIOD
431 DATA LEFT (Y/N)
432 DATA NI PAY (STD)
433 DATA NI PAY (UPPER)
434 DATA SMP TO DATE
500 CLS
520 PRINT
530 TEXT$="Micro-Aid IBM PC & COMPATIBLES PAYROLL":GOSUB 10000
540 TEXT$="PERSONNEL RECORDS":GOSUB 10000
550 PRINT
555 COLOR 4
560 FOR J=1 TO 8
570 PRINT TAB(24) J;" : ";
580 IF J=7 THEN PRINT;
590 PRINT M$(J-1):PRINT
600 NEXT
602 COLOR 1
605 PRINT:PRINT TAB(24)NE" EMPLOYEE";:IF NE>1 THEN PRINT "S";
606 PRINT TAB(40)FRE(X)"MEMORY FREE"
607 P$=" Enter choice to proceed, 1 to 8, or press any key to abort.":GOSUB 64600
608 GOSUB 61000:GOSUB 62000
610 GOSUB 11000:M$=Q$
620 IF M$="1" AND CL$<>"" THEN 800
630 IF M$>"1" AND M$<"8" AND CL$="" THEN GOSUB 40000
650 IF INSTR("Mm",Q$) THEN 500
660 ON VAL(M$) GOTO 1000,2000,3000,4000,5000,6000,7000,8000
800 CLS
810 PRINT
820 CLS
830 PRINT:PRINT"Press Ctrl and Break keys"
840 PRINT:PRINT "and re-RUN to set up new data-file"
850 PRINT:PRINT "or press 'N' to initialize data for a new tax year"
860 PRINT"or any other key to return to main menu"
870 GOSUB 11000
880 IF INSTR("Nn",Q$)=0 THEN 500
900 T=NE:NJ=1:J=1:CLS
910 IF J>NE THEN 960
920 IF E(J,21)=1 THEN J=J+1:T=T-1:GOTO 910
930 FOR H=0 TO 2:E$(NJ,H)=E$(J,H):NEXT
935 FOR H=0 TO 4:E(NJ,H)=E(J,H):NEXT
940 FOR H=5 TO 24:E(NJ,H)=0:NEXT
945 E(NJ,1)=0:E(NJ,25)=E(J,25)
950 NJ=NJ+1:J=J+1:GOTO 910
960 FOR H=0 TO 10:P(H)=0:NEXT
970 NE=T:PRINT"INITIALIZATION COMPLETE"
980 PRINT:GOSUB 10999:COLOR 1:GOTO 500
1000 CLS
1020 PRINT:INPUT "ENTER COMPANY NAME or just press RETURN to exit";CL$
1030 IF CL$="" THEN 500
1040 PRINT
1050 INPUT "No. of employees to be entered in batch ";NE$
1060 NE=INT(VAL(NE$))
1070 IF NE<1 OR NE>M THEN GOTO 1050
1080 FOR J=1 TO NE:GOSUB 1500:NEXT:GOTO 500
1500 CLS
1510 PRINT "Employee No. ",J
1520 PRINT
1530 INPUT "Name ";Q$:E$(J,0)=LEFT$(Q$,19)
1540 IF E$(J,0)="" THEN GOTO 1530
1550 PRINT
1560 INPUT "NI Number ";E$(J,1)
1570 IF E$(J,1)="" THEN E$(J,1)="N/K"
1580 PRINT
1600 FOR H=0 TO 24
1610 IF H=7 OR H=11 OR H=17 THEN CLS
1620 Q$="":PRINT P$(H);:INPUT Q$
1640 IF H<>0 THEN 1680
1650 GOSUB 20000
1660 IF F=0 THEN 1620
1670 GOTO 1790
1680 IF H<>1 AND H<>21 THEN 1710
1690 IF INSTR("Yy",Q$) THEN E(J,1)=1:GOTO 1790
1700 IF INSTR("Nn",Q$)=0 THEN 1620
1710 IF H<>2 THEN 1770
1720 GOSUB 30000
1730 IF F=0 THEN 1620
1740 E(J,2)=ASC(Q$)
1750 E(J,25)=F-1
1760 GOTO 1790
1770 E(J,H)=VAL(Q$)
1780 IF H=10 AND E(J,25)=0 THEN H=16
1790 PRINT
1800 NEXT H
1810 RETURN
2000 NE=NE+1
2010 IF NE>M THEN NE=M:GOTO 500
2020 J=NE
2030 CLS
2050 GOSUB 1500
2060 GOTO 500
3000 CLS
3020 GOSUB 3500:IF J<1 OR J>NE THEN 500
3030 CLS
3040 PRINT "Employee No. "J
3050 PRINT
3060 PRINTE$(J,0)
3070 PRINT
3080 IF E(J,21)=0 THEN PRINT"Deleted from Payroll":GOTO 3100
3090 PRINT"Has already left"
3100 E(J,21)=1
3110 PRINT
3120 GOSUB 10999
3130 GOTO 500
3500 CLS
3510 INPUT "Employee number ('N' if not known) ";Q$
3520 IF INSTR("Nn",Q$) THEN GOSUB 3600
3530 J=VAL(Q$)
3540 RETURN
3600 PRINT
3610 T$="":INPUT "Employee name ";T$
3620 IF T$="" THEN 3610
3630 FOR J=1 TO NE
3650 F=0:IF INSTR(E$(J,0),T$)<>0 THEN GOSUB 3700
3660 IF F<>0 THEN J=NE
3670 NEXT J
3680 Q$=STR$(F):RETURN
3700 CLS:PRINT "Found "E$(J,0)
3710 PRINT
3720 PRINT "Is this correct (Y/N) ?"
3730 GOSUB 11000
3740 IF INSTR("Nn",Q$) THEN RETURN
3750 IF INSTR("Yy",Q$)=0 THEN 3730
3760 F=J
3770 RETURN
4000 CLS
4020 GOSUB 3500
4030 IF J<1 OR J>NE THEN 500
4040 DV=3
4050 LOCATE 25,1:P$="Enter 'Y' if printout required else press any key.":GOSUB 64600:GOSUB 11000:IF INSTR("Yy",Q$) THEN P%=8 ELSE P%=0
4055 CLS
4080 P$=" 1: Name":GOSUB 13000
4090 IF P%=0 THEN PRINT E$(J,0), ,"EMPLOYEE NO."STR$(J) ELSE LPRINT E$(J,O), ,"EMPLOYEE NO."STR$(J)
4110 P$=" 2: N.I. Number":GOSUB 13000
4120 IF P%=0 THEN PRINT E$(J,1); ELSE IF P%=8 THEN LPRINT E$(J,1);
4123 Q$="(Contracted out)":IF E(J,25)=0 THEN Q$="(Contracted in)"
4125 T$=CHR$(E(J,2))+": "+Q$
4127 IF P%=0 THEN PRINT TAB(40);"5: ";P$(2);" "T$
4130 FOR H=0 TO 24
4140 P$=STR$(H+3)
4150 IF H>6 THEN P$=MID$(P$,2)
4160 P$=" "+P$+": "
4170 T$=STR$(E(J,H))
4180 IF H=0 THEN T$=E$(J,2)
4190 IF H=2 THEN T$=CHR$(E(J,H))
4200 IF H<>1 THEN 4250
4210 Q$="(Cumulative)"
4220 IF VAL(T$)=1 THEN Q$="(Wk.1)"
4230 IF P%=0 THEN PRINT TAB(38)P$;Q$ ELSE IF P%=8 THEN LPRINT P$;Q$
4240 GOTO 4390
4250 IF H=2 AND P%=0 THEN 4390
4255 IF H<>2 THEN 4300
4260 Q$="(Contracted out)"
4270 IF E(J,25)=0 THEN Q$="(Contracted in)"
4280 T$=T$+": "+Q$
4290 GOTO 4350
4300 IF H<>21 THEN 4350
4310 Q$="Left"
4320 IF VAL(T$)=0 THEN Q$="Current"
4325 Q$="Employee "+Q$
4330 IF P%=0 THEN PRINT ," "P$;Q$
4335 IF P%=8 THEN LPRINT ," "P$;Q$
4340 GOTO 4390
4350 P$=P$+P$(H)
4360 GOSUB 13000
4365 IF H=11 OR H=13 THEN IF P%=0 THEN PRINT TAB(33); USING "##.##";VAL(T$):GOTO 4390 ELSE IF H=11 OR H=13 THEN IF P%=8 THEN LPRINT TAB(33); USING "##.##";VAL(T$):GOTO 4390
4367 IF H=20 THEN IF P%=0 THEN PRINT TAB(33); USING "##";VAL(T$); ELSE IF H=20 THEN IF P%=8 THEN LPRINT TAB(33); USING "##";VAL(T$);
4370 IF H<3 AND P%=0 THEN PRINT T$; ELSE IF H<3 AND P%=8 THEN LPRINT T$
4372 IF H>2 AND H<>20 THEN IF P%=0 THEN PRINT TAB(26); USING "########,.##";VAL(T$); ELSE IF H<3 AND P%=0 THEN PRINT T$
4375 IF H>2 AND H<>20 THEN IF P%=8 THEN LPRINT TAB(26); USING "########,.##";VAL(T$); ELSE IF H<3 AND P%=8 THEN LPRINT T$
4380 IF H<>0 AND H<>20 AND H<>24 THEN IF P%=0 THEN PRINT ELSE IF H<>20 AND P%=8 THEN LPRINT
4500 LOCATE 16,42:COLOR 0:INPUT "Amend which field (1-27)";Q$:COLOR 4:LOCATE 16,42:PRINT " Amend field ";Q$;" ":COLOR 1
4510 Q=VAL(Q$):IF Q<1 OR Q>27 THEN 4030
4520 IF Q=4 THEN E(J,1)=-1*(E(J,1)=0):GOTO 4030
4530 IF Q=24 THEN E(J,21)=-1*(E(J,21)=0):GOTO 4030
4540 P$="Enter new data":GOSUB 64600:INPUT Q$:CLS
4550 IF Q<3 THEN E$(J,Q-1)=LEFT$(Q$,19):GOTO 4030
4560 IF Q>5 THEN 4700
4570 IF Q=5 THEN 4610
4580 GOSUB 20000
4590 IF F=0 THEN 4540
4600 GOTO 4030
4610 LOCATE 19,46:GOSUB 30000
4620 IF F=0 THEN 4540
4630 E(J,2)=ASC(Q$)
4640 E(J,25)=F-1
4650 E(J,8)=E(J,8)+E(J,7)
4660 E(J,10)=E(J,10)+E(J,9)
4670 E(J,7)=0
4680 E(J,9)=0
4690 CLS:GOTO 4030
4700 E(J,Q-3)=VAL(Q$):CLS:GOTO 4030
5000 CLS
5010 PRINT CL$;" P35 Listing":PRINT
5015 LOCATE 25,1:P$="Enter 'Y' if printout required else press any key.":GOSUB 64600:GOSUB 11000:IF INSTR("Yy",Q$) THEN P%=8 ELSE P%=0:LOCATE 25,1:P$="":GOSUB 64600:PRINT
5020 IF P%=8 THEN LPRINT CL$;" P35 Listing":LPRINT
5030 IF P%=0 THEN PRINT "No." TAB(5)"Name"SPC(24)"Tax"SPC(17)"NI"SPC(9)"SSP"SPC(9)"SMP" ELSE IF P%=8 THEN LPRINT "No." TAB(5)"Name"SPC(24)"Tax"SPC(17)"NI"SPC(9)"SSP"SPC(9)"SMP"
5040 IF P%=0 THEN PRINT ELSE IF P%=8 THEN LPRINT
5050 T1=0:T2=0:T3=0:FOR J=1 TO NE
5060 IF P%=0 THEN PRINT USING "###";J;:PRINT TAB(5); E$(J,0);:PRINT TAB(25);
5065 IF P%=8 THEN LPRINT USING "###";J;:LPRINT TAB(5); E$(J,0);
5070 T=E(J,6)-E(J,19)
5080 T$=STR$(T):GOSUB 16000:T1=T1+T
5090 IF P%=0 THEN PRINT USING "#######,.##";VAL(T$);:PRINT TAB(45);
5095 IF P%=8 THEN LPRINT USING "#######,.##";VAL(T$);:LPRINT TAB(45);
5100 T=E(J,7)+E(J,8)+E(J,9)+E(J,10)
5110 T$=STR$(T):GOSUB 16000:T2=T2+T
5120 IF P%=0 THEN PRINT USING "#######,.##";VAL(T$);:PRINT TAB(65);
5125 IF P%=8 THEN LPRINT USING "#######,.##";VAL(T$);:LPRINT TAB(65);
5130 T=E(J,17)
5140 T$=STR$(T):GOSUB 16000:T3=T3+T
5150 IF P%=0 THEN PRINT USING "#######,.##";VAL(T$)
5155 IF P%=8 THEN LPRINT USING "#######,.##";VAL(T$)
5160 NEXT:IF P%=0 THEN PRINT ELSE IF P%=8 THEN LPRINT
5170 IF P%=0 THEN PRINT "Total" TAB(25); ELSE IF P%=8 THEN LPRINT "Total" TAB(25);
5180 T$=STR$(T1):GOSUB 16000
5190 IF P%=0 THEN PRINT USING "#######,.##";VAL(T$);:PRINT TAB(45);
5195 IF P%=8 THEN LPRINT USING "#######,.##";VAL(T$);:LPRINT TAB(45);
5200 T$=STR$(T2):GOSUB 16000
5210 IF P%=0 THEN PRINT USING "#######,.##";VAL(T$);:PRINT TAB(65);
5215 IF P%=8 THEN LPRINT USING "#######,.##";VAL(T$);:LPRINT TAB(65);
5220 T$=STR$(T3):GOSUB 16000
5230 IF P%=0 THEN PRINT USING "#######,.##";VAL(T$)
5235 IF P%=8 THEN LPRINT USING "#######,.##";VAL(T$)
5240 PRINT:PRINT:GOSUB 10999:COLOR 1
5250 GOTO 500
6000 CLS
6020 PRINT
6030 PRINT"Make no changes to codes without authority from Tax Office."
6050 PRINT
6060 PRINT"(Form P7X)"
6070 PRINT
6080 PRINT"Suffix?" TAB(10)"ADD TO CODE"
6090 PRINT
6100 PRINTTAB(6)"L";TAB(12);:INPUT T$(0)
6110 PRINT TAB(6)"H";TAB(12);:INPUT T$(1)
6120 PRINT TAB(6)"P";TAB(12);:INPUT T$(2)
6130 PRINT TAB(6)"V";TAB(12);:INPUT T$(3)
6180 PRINT
6190 PRINT"Are these all correct (Y/N) ";
6200 GOSUB 11000:PRINT
6210 IF INSTR("Nn",Q$)THEN 6000
6220 IF INSTR("Yy",Q$)=0 THEN 6200
6240 PRINT:TEXT$="Data being amended":GOSUB 10000:PRINT
6250 FOR J=1 TO NE:IF E(J,21)=1 THEN 6315
6260 FOR K=0 TO 3
6270 IF RIGHT$(E$(J,2),1)<>MID$(TAX$,K+1,1) THEN 6310
8000 P$="Have you saved the data file? Press 'Y' if you have.":GOSUB 64600:GOSUB 11000
8010 IF INSTR("Yy",Q$)=0 THEN 7000
8020 RUN "selectp
10000 PRINT TAB(((80-LEN(TEXT$))/2));TEXT$
10010 RETURN
10999 P$="Press any key to continue":GOSUB 64600
11000 Q$="":WHILE Q$="": Q$=INKEY$:WEND
11010 RETURN
12000 PRINT:PRINT TAB(5);"D = to continue"
12010 PRINT TAB(5)"M = return to Main Menu"
12020 RETURN
13000 IF P%=0 THEN PRINT P$;SPC(22-LEN(P$));
13005 IF P%=8 THEN LPRINT P$;SPC(22-LEN(P$));
13010 RETURN
14000 PRINT:PRINT:RETURN
16000 IF LEN(T$)>10 THEN T$="**********":RETURN
16010 FOR L=1 TO 11-LEN(T$)
16020 T$=" "+T$
16030 NEXT:RETURN
20000 X$="":Y$=""
20010 FOR K=1 TO LEN(Q$)
20020 T$=MID$(Q$,K,1)
20030 IF T$=CHR$(32)THEN 20060
20040 IF T$<"0" OR T$>"9" THEN Y$=Y$+T$:GOTO 20060
20050 X$=X$+T$
20060 NEXT
20070 F=1:IF VAL(X$)<>0 THEN 20110
20080 IF Y$="OT"THEN E$(J,2)="OT":GOTO 20180
20090 IF Y$="BR"THEN X$="-1":E$(J,2)=Y$:GOTO 20180
20100 IF Y$="NT"THEN X$="2000":E$(J,2)=Y$:GOTO 20180
20110 F=0:FOR K=1 TO LEN(TAX$)
20120 IF Y$=MID$(TAX$,K,1)THEN F=1
20130 NEXT:IF F=0 THEN RETURN
20140 IF Y$="D" AND VAL(X$)>(X-GPTR)THEN Q$="":RETURN
20150 X$=MID$(STR$(VAL(X$)),2)
20160 E$(J,2)=X$+Y$
20170 IF Y$="D" OR Y$="F" THEN E$(J,2)=Y$+X$
20180 E(J,0)=VAL(X$)
20190 RETURN
30000 F=0
30010 IF LEN(Q$)<>1 THEN 30050
30020 FOR K=0 TO 1:FOR L=1 TO LEN(NI$(K))
30030 IF Q$=MID$(NI$(K),L,1)THEN F=K+1
30040 NEXT L:NEXT K
30050 IF Q$<>"C" THEN RETURN
30060 PRINT "Cont In/Out ?"
30070 T$=Q$
30080 GOSUB 11000
30090 IF INSTR("Ii",Q$)THEN Q$=T$:RETURN
30100 IF INSTR("Oo",Q$)=0 THEN 30080
30110 F=2:Q$=T$:RETURN
40000 CLS
40010 TEXT$="LOAD DATA":GOSUB 10000
40200 OPEN PAYFILE$ FOR INPUT AS #1
40210 INPUT #1, CL$
40220 PRINT:PRINT"LOADING ";CL$;" FILE":PRINT
40230 INPUT #1, NE
40240 FOR J=0 TO 10
40250 INPUT #1, P(J)
40260 NEXT
40270 FOR J=1 TO NE
40280 FOR K=0 TO 2
40290 INPUT #1,E$(J,K)
40300 NEXT K
40310 FOR K=0 TO 25
40320 INPUT #1,E(J,K)
40330 NEXT K,J
40340 CLOSE #1
40350 RETURN
50000 CLS
50010 TEXT$="SAVE DATA":GOSUB 10000
50030 GOSUB 12000
50040 GOSUB 11000
50050 IF INSTR("Mm",Q$) THEN RETURN
50060 IF INSTR("Dd",Q$) THEN 50080
50070 GOTO 50040
50080 OPEN "O",#1,PAYFILE$
50090 WRITE #1,CL$
50100 PRINT:PRINT"SAVING ";CL$;" FILE":PRINT
50110 WRITE #1,NE
50120 FOR J=0 TO 10
50130 WRITE #1,P(J)
50140 NEXT
50150 FOR J=1 TO NE
50160 FOR K= 0 TO 2
50170 WRITE #1,E$(J,K)
50180 NEXT K
50190 FOR K=0 TO 25
50200 WRITE #1,E(J,K)
50210 NEXT K: NEXT J
50220 CLOSE #1
50230 RETURN
60000 CLS:PRINT:PRINT "AN ERROR HAS BEEN FOUND AS FOLLOWS:_":PRINT:
60010 PRINT "PROGRAM LINE "ERL
60020 PRINT "ERROR TYPE "ERR
60030 PRINT
60040 IF ERR=53 THEN PRINT "FILE NOT FOUND - CHECK CORRECT DISC IS IN DRIVE A":PRINT:PRINT "THE FILES ON THE DISC ARE AS FOLLOWS:-":PRINT:FILES:PRINT:PRINT STRING$(80,"_"):PRINT
60045 IF ERR=25 THEN COLOR 4:PRINT "PRINTER NOT ON OR CONNECTED":COLOR 1
60050 PRINT:PRINT"Press any key to continue ";
60060 G$=INKEY$:IF G$="" THEN 60060
60070 CLS:IF ERR=25 THEN RESUME ELSE RESUME 120
61000 COLOR 2
61020 R1=1:C1=1:R2=24:C2=79
61050 FOR I=R1+1 TO R2-1
61060 LOCATE I,C1:PRINT CHR$(186);
61070 LOCATE I,C2:PRINT CHR$(186);
61080 NEXT I
61090 FOR J=C1+1 TO C2-1
61100 LOCATE R1,J:PRINT CHR$(205);
61110 LOCATE R2,J:PRINT CHR$(205);
61120 NEXT J
61130 LOCATE R1,C1:PRINT CHR$(201);
61140 LOCATE R1,C2:PRINT CHR$(187);
61150 LOCATE R2,C1:PRINT CHR$(200);
61160 LOCATE R2,C2:PRINT CHR$(188);
61170 RETURN
62000 TITLE.POS = 40 - INT(LEN(TEXT$)/2)
62020 R1=4:C1=22:R2=20:C2=58
62030 COLOR 1
62040 FOR II=R1+1 TO R2-1
62050 LOCATE II,C1:PRINT CHR$(179);
62060 LOCATE II,C2:PRINT CHR$(179);
62070 NEXT
62080 FOR JJ=C1+1 TO C2-1
62090 LOCATE R1,JJ:PRINT CHR$(196);
62100 LOCATE R2,JJ:PRINT CHR$(196);
62110 NEXT
62120 LOCATE R1,C1:PRINT CHR$(218);
62130 LOCATE R1,C2:PRINT CHR$(191);
62140 LOCATE R2,C1:PRINT CHR$(192);
62150 LOCATE R2,C2:PRINT CHR$(217);
62160 RETURN
64600 COLOR 14,0:LOCATE 25,2:PRINT STRING$(78," ");:LOCATE 25,2:PRINT TAB((78-LEN(P$))/2)P$;:COLOR 1,7:RETURN