ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

210 lines
8.0 KiB

  1. 1 rem This is the Check Receipt Posting Program
  2. %INCLUDE ALL.BAS
  3. 500 dim n(2,20),k$(3,20)
  4. first=8:last=18
  5. fa$="DATE /...5../ /...5...10...15...20.../ "
  6. fa$=fa$+" PAGE ####"
  7. fb$=" *** CASH/CHECK RECEIPTS ***"
  8. fb1$=" ---------------------------"
  9. fc$=" CUST # DATE DESCRIPTION ACCOUNT #"
  10. fc$=fc$+" AMOUNT NET"
  11. fd$="######## /...5../ /...5...10...15...20.../ ##########"
  12. fd$=fd$+" ###,###.##-"
  13. fd1$=" /...5../ /...5...10...15...20.../ ##########"
  14. fd1$=fd1$+" ###,###.##-"
  15. fd2$="######## /...5../ /...5...10...15...20.../ "
  16. fd2$=fd2$+" ###,###.##-"
  17. fe$=" ##########"
  18. fe$=fe$+" ###,###.##-"
  19. fe1$=" ##########"
  20. fe1$=fe1$+" ###,###.##- ###,###.##-"
  21. ff$=" /...5...10...1/"
  22. ff$=ff$+" ##,###,###.##-*"
  23. fg$="DATE /...5../ /...5...10...15...20.../ "
  24. fg$=fg$+" PAGE ####"
  25. fh$=" *** GENERAL LEDGER ***"
  26. fh1$=" ----------------------"
  27. fi$=" ACCOUNT # DESCRIPTION REF # "
  28. fi$=fi$+"BAL.FWRD. CURRENT BALANCE"
  29. fj$="########## /...5...10...15...20...25...3/ ##,###,###.##-"
  30. fk$=" /.../ /...5...10...15...20.../ ######## "
  31. fk$=fk$+" ##,###,###.##-"
  32. fl$=" "
  33. fl$=fl$+" ##,###,###.##-* ##,###,###.##-"
  34. 1000 PRINT clear$:PRINT
  35. 1002 PRINT "BEFORE PROCEEDING, IT IS A GOOD PRACTICE TO BACK UP"
  36. 1005 PRINT "BOTH THE GENERAL LEDGER FILE AND THE CHECK RECEIPTS FILE"
  37. 1010 PRINT "BY MAKING COPIES USING THE DISKCOPY FACILITY OF YOUR DOS."
  38. 1015 PRINT:PRINT"IF YOU ARE UNFAMILIAR WITH THE PROCESS, ASK YOUR"
  39. 1020 PRINT "SYSTEM SUPERVISOR FOR HELP.":PRINT
  40. 1025 PRINT "IF THIS HAS BEEN DONE; TYPE Y TO CONTINUE!"
  41. 1030 INPUT line temp$
  42. 1035 IF left$(temp$,1)<>"y" and left$(temp$,1)<>"Y" THEN CHAIN "master12"
  43. 1540 PRINT clear$:PRINT
  44. 1545 PRINT "PUT THE GENERAL LEDGER DISK IN DRIVE B":PRINT
  45. 1550 PRINT "PUT THE CHECK RECEIPTS DISK IN DRIVE A":PRINT
  46. 1555 PRINT "TYPE RETURN WHEN READY":INPUT line temp$
  47. initialize
  48. 2000 PRINT clear$:PRINT
  49. 2005 PRINT "LOADING ACCOUNT NUMBER TABLES":PRINT
  50. 2010 PRINT "*** PLEASE WAIT ***"
  51. 2020 open "glref" as 1
  52. read #1;z2
  53. zn%=z2+2
  54. dim h(zn%),ref%(zn%)
  55. for z=1 to z2
  56. read #1;h(z)
  57. next z
  58. close 1
  59. 3070 N(2,1)=8:N(2,2)=24:N(2,3)=24:N(2,4)=1
  60. 4000 REM THIS IS THE ACTUAL POSTING PROGRAM
  61. 4010 open "gl" recl 138 as 1
  62. open "glck" recl 250 as 2
  63. 4015 P9=100:PAGE=0
  64. 4030 GOSUB 20000
  65. 4100 LPRINTER
  66. 4500 I=1
  67. 4505 read #2,i;N(0,1),N(0,2),Q$,N(0,7),N(0,8),N(0,9), N(0,10),N(0,11),N(0,12),N(0,13),N(0,14),N(0,15),N(0,16), N(0,17),N(0,18),N(0,19),FLAG$
  68. 4510 IF N(0,2)=0 THEN GOTO 10000 rem Get out when finished
  69. 4515 IF FLAG$="P" THEN 4540
  70. 4525 IF P9>60 THEN GOSUB 9000
  71. 4530 GOSUB 5000
  72. 4531 IF FLAG.CR<>1 THEN GOSUB 9100
  73. 4532 IF P9>60 THEN GOSUB 9000
  74. 4534 GOSUB 5100
  75. 4536 IF P9>60 THEN GOSUB 9000
  76. 4540 I=I+1:GOTO 4505
  77. 5000 REM SUBROUTINE TO POST AND PRINT TOTALS
  78. 5002 IF N(0,2)=0 THEN 5050
  79. 5003 FOR Z4=1 TO Z2
  80. 5004 IF N(0,2)=H(Z4) THEN read #1,z4;n(1,1),n(1,2),r$,n(1,4),n(1,5), n(1,6),n(1,7),n(1,8),n(1,9),n(1,10):goto 5006
  81. 5005 NEXT Z4
  82. 5006 FOR X=4 TO 6:N(1,X)=N(1,X)+N(0,7):NEXT X
  83. 5050 RETURN
  84. 5100 NU.LEFT%=0:NU.TRAN%=0:NET.AMT=0
  85. FOR B=FIRST TO LAST STEP 2
  86. IF N(0,B)<>0 THEN NU.TRAN%=NU.TRAN%+1: NET.AMT=NET.AMT+N(0,B+1)
  87. NEXT B
  88. 5110 IF N(0,7)=0 THEN PRINT USING FD2$;N(0,1),LEFT$(Q$,8), MID$(Q$,9,24),N(0,7):P9=P9+1:GOTO 5235
  89. 5115 FOR J=first to last STEP 2
  90. 5120 IF N(0,J)=0 THEN 5220
  91. 5125 FOR Z4=1 TO Z2
  92. 5130 IF N(0,j)=H(Z4) THEN read #1,z4;n(1,1),n(1,2),r$,n(1,4),n(1,5), n(1,6),n(1,7),n(1,8),n(1,9),n(1,10):goto 5140
  93. 5135 NEXT Z4
  94. 5140 IF NU.TRAN%>1 THEN GOSUB 5400 ELSE GOTO 5142
  95. GOTO 5145
  96. 5142 PRINT USING FD$;N(0,1),LEFT$(Q$,8),MID$(Q$,9,24),N(0,J),N(0,J+1)
  97. 5145 P9=P9+1
  98. 5170 FOR X=4 TO 6:N(1,X)=N(1,X)+N(0,J+1):NEXT X
  99. 5220 NEXT J
  100. 5225 IF N(0,7)=0 THEN PRINT USING FD2$;N(0,1),LEFT$(Q$,8), MID$(Q$,9,24),N(0,7):P9=P9+1
  101. 5235 RETURN
  102. 5400 IF NU.LEFT%=1 THEN PRINT USING FE1$;N(0,J),N(0,J+1),NET.AMT: NU.LEFT%=NU.LEFT%-1:RETURN
  103. 5420 IF NU.LEFT%>1 THEN PRINT USING FE$;N(0,J),N(0,J+1): NU.LEFT%=NU.LEFT%-1:RETURN
  104. 5430 PRINT USING FD$;N(0,1),LEFT$(Q$,8),MID$(Q$,9,24), N(0,J),N(0,J+1):NU.LEFT%=NU.TRAN%-1
  105. 5440 RETURN
  106. 9000 P9=0:PAGE=PAGE+1
  107. 9005 PRINT CHR$(12)
  108. 9010 PRINT USING FA$;D$(4),MID$(CO.NAME$,25,24),PAGE
  109. 9015 PRINT FB$
  110. 9020 PRINT FB1$
  111. 9025 PRINT FC$
  112. 9030 PRINT:P9=P9+6
  113. 9095 RETURN
  114. 9100 PRINT USING FD1$;D$(4),"CHECK RECEIPTS",ACCT.NUM,CASH.OUT
  115. 9105 FLAG.CR=1
  116. 9195 RETURN
  117. 10000 dr$="TOTAL DEBITS":cr$="TOTAL CREDITS"
  118. 10010 PRINT USING FF$;dr$,DEBIT
  119. 10020 PRINT USING FF$;cr$,CREDIT
  120. 10030 GOSUB 30000
  121. 10040 console
  122. 10050 CLOSE 1:CLOSE 2
  123. 10100 PRINT "PUT DISK #1 BACK IN DRIVE A - TYPE <cr> TO CONTINUE"
  124. 10105 INPUT line temp$
  125. if size("master12.int")<1 then 10100
  126. 10110 lprinter
  127. 10115 print chr$(12):for z=1 to 100:next z:print chr$(12)
  128. 10120 console
  129. 10195 chain"master12"
  130. 20000 console:PRINT clear$:PRINT
  131. 20010 PRINT "*** VALIDATING ACCOUNT NUMBERS ***"
  132. 20020 PRINT:PRINT "PLEASE WAIT"
  133. 20030 I=1
  134. 20040 read #2,i;N(0,1),N(0,2),Q$,N(0,7),N(0,8),N(0,9), N(0,10),N(0,11),N(0,12),N(0,13),N(0,14),N(0,15),N(0,16), N(0,17),N(0,18),N(0,19),FLAG$
  135. 20050 IF N(0,2)=0 THEN 29975
  136. 20055 IF FLAG$="P" THEN 21010
  137. 20062 FOR Z4=1 TO Z2
  138. IF N(0,2)=H(Z4) THEN 20070
  139. NEXT Z4
  140. 20064 J=2:GOTO 20500
  141. 20070 CASH.OUT=CASH.OUT+N(0,7):ACCT.NUM=N(0,2)
  142. 20072 IF N(0,7)<0 THEN CREDIT=CREDIT+N(0,7):REF%(Z4)=REF%(Z4)+1
  143. 20074 IF N(0,7)>0 THEN DEBIT=DEBIT+N(0,7):REF%(Z4)=REF%(Z4)+1
  144. 20076 FOR J=first to last STEP 2
  145. 20080 FOR Z4=1 TO Z2
  146. 20085 IF N(0,J)=0 THEN 21000
  147. 20090 IF N(0,J)=H(Z4) THEN 21000
  148. 20100 NEXT Z4
  149. 20500 lprinter
  150. print:print n(0,j);" in record ";i;" is not a VALID account number!"
  151. abort = 1
  152. console
  153. IF J=2 THEN 20076
  154. 21000 IF N(0,J+1)<0 THEN CREDIT=CREDIT+N(0,J+1):REF%(Z4)=REF%(Z4)+1
  155. 21002 IF N(0,J+1)>0 THEN DEBIT=DEBIT+N(0,J+1):REF%(Z4)=REF%(Z4)+1
  156. 21004 NEXT J
  157. 21010 I=I+1
  158. 21020 GOTO 20040
  159. 29975 PRINT clear$:PRINT
  160. if abort = 1 then print "*** POSTING ABORTED !!! ***":GOTO 10050
  161. 29980 PRINT "*** POSTING ***"
  162. 29985 PRINT:PRINT "PLEASE WAIT"
  163. 29995 RETURN
  164. 30000 P9=100:PAGE=0
  165. 30005 IF P9>60 THEN GOSUB 31000
  166. 30010 OPEN "GLCKSIZE" AS 20:READ #20;LIMIT,DUMMY:CLOSE 20
  167. LIMIT=LIMIT-1
  168. 30100 FOR I=1 TO Z2
  169. 30200 IF REF%(I)=0 THEN 30795
  170. 30300 READ #1,I;N(1,1),N(1,2),R$,N(1,4),N(1,5),N(1,6),N(1,7), N(1,8),N(1,9),N(1,10)
  171. 30305 PRINT USING FJ$;N(1,2),R$,N(1,6):P9=P9+1
  172. 30310 CURRENT=0
  173. 30500 FOR K=1 TO LIMIT
  174. 30510 read #2,K;N(0,1),N(0,2),Q$,N(0,7),N(0,8),N(0,9), N(0,10),N(0,11),N(0,12),N(0,13),N(0,14),N(0,15),N(0,16), N(0,17),N(0,18),N(0,19),FLAG$
  175. 30512 IF FLAG$="P" THEN 30580
  176. 30515 IF N(0,2)=N(1,2) AND N(0,7)<>0 THEN PRINT USING FK$;LEFT$(Q$,5), MID$(Q$,9,24),N(0,1),N(0,7):FOR X=4 TO 6:N(1,X)=N(1,X)+N(0,7):NEXT X: CURRENT=CURRENT+N(0,7):P9=P9+1:REF%(I)=REF%(I)-1
  177. 30520 IF P9>60 THEN GOSUB 31000
  178. 30530 IF REF%(I)=0 THEN K=LIMIT:GOTO 30580
  179. 30550 FOR J1=FIRST TO LAST STEP 2
  180. 30555 IF N(0,J1)=N(1,2) AND N(0,J1+1)<>0 THEN PRINT USING FK$;LEFT$(Q$,5), MID$(Q$,9,24),N(0,1),N(0,J1+1):FOR X=4 TO 6:N(1,X)=N(1,X)+N(0,J1+1): NEXT X:CURRENT=CURRENT+N(0,J1+1):P9=P9+1:REF%(I)=REF%(I)-1
  181. 30560 IF P9>60 THEN GOSUB 31000
  182. 30566 IF REF%(I)=0 THEN K=LIMIT:GOTO 30580
  183. 30570 NEXT J1
  184. 30580 NEXT K
  185. 30600 PRINT USING FL$;CURRENT,N(1,6):P9=P9+1
  186. 30650 PRINT #1,I;N(1,1),N(1,2),R$,N(1,4),N(1,5),N(1,6),N(1,7), N(1,8),N(1,9),N(1,10)
  187. 30655 PRINT:PRINT:P9=P9+2
  188. 30660 IF P9>60 THEN GOSUB 31000
  189. 30795 NEXT I
  190. 30800 FOR I=1 TO LIMIT
  191. 30810 read #2,I;N(0,1),N(0,2),Q$,N(0,7),N(0,8),N(0,9), N(0,10),N(0,11),N(0,12),N(0,13),N(0,14),N(0,15),N(0,16), N(0,17),N(0,18),N(0,19),FLAG$
  192. 30815 FLAG$="P"
  193. 30820 print #2,I;N(0,1),N(0,2),Q$,N(0,7),N(0,8),N(0,9), N(0,10),N(0,11),N(0,12),N(0,13),N(0,14),N(0,15),N(0,16), N(0,17),N(0,18),N(0,19),FLAG$
  194. 30825 NEXT I
  195. 30995 RETURN
  196. 31000 PRINT CHR$(12):P9=0:PAGE=PAGE+1
  197. 31005 PRINT USING FG$;D$(4),MID$(CO.NAME$,25,24),PAGE
  198. 31010 PRINT FH$
  199. 31015 PRINT FH1$
  200. 31020 PRINT FI$
  201. 31025 PRINT:P9=P9+6
  202. 31095 RETURN