home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Summer / rerun-1985-summer-side-b.d64 / invoices (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  165 lines

  1. 1 rem c. by elcomp publishing inc. 1983
  2. 5 rem approval given to wozniak by elcomp to use this program
  3. 10 rem business invoice program--don't  use punctuations on customer input info
  4. 100 rem modified for individual usage-by e.s.wozniak-load "bus inv",8
  5. 110 open 1,4
  6. 180 print"[147]"
  7. 190 input"enter tax rate (%)";tr:tr=tr/100
  8. 200 input"enter date";rd$
  9. 220 input"enter first invoice no.";i1
  10. 250 input"enter account no. (0=end)";c1
  11. 260 if c1=0 then 1600
  12. 270 sc=1:dc=1:d=0:v=0
  13. 280 input"discount yes(1) no(0)";dc
  14. 290 input"shipping autom. added yes(1) no(0)";sc
  15. 300 if sc=0 then input"how much?";v
  16. 310 input"customers order no.";co$
  17. 320 input"name of customer";s1$
  18. 340 input"number and street";s2$
  19. 360 input"city*state*zip-code";s3$
  20. 370 print
  21. 380 input"1=30 days net,2=cod,3=prepaid";te
  22. 390 if te=1 then te$="30 days net"
  23. 400 if te=2 then te$="c o d"
  24. 410 if te=3 then te$="prepaid"
  25. 420 print:print"1=forwarder,2=united parcel":input"3=parcel post";sv
  26. 430 if sv=1 then sv$="forwarder"
  27. 440 if sv=2 then sv$="united parcel"
  28. 450 if sv=3 then sv$="parcel post"
  29. 460 print"[147]":prints1$:prints2$:prints3$
  30. 470 print:input"ship to same address";q$
  31. 480 if q$="y" then 510
  32. 490 print:input"name";h1$:input"no.and str.";h2$:input"c.,st.,zip";h3$
  33. 500 goto520
  34. 510 h1$=s1$:h2$=s2$:h3$=s3$
  35. 520 for q=1 to 3:print#1:next q
  36. 530 print#1,tab(29);"elcomp publishing inc."
  37. 540 print#1,tab(28);"2174 w. foothill blvd. #e"
  38. 550 print#1,tab(32);"upland, ca. 91786"
  39. 555 print#1,tab(34);"714-623-8314"
  40. 560 print#1:print#1:print#1
  41. 565 print#1,spc(55);rd$
  42. 570 print#1
  43. 575 print#1,spc(3);"account #:";c1;spc(25);"invoice #:";i1
  44. 580 print#1:print#1
  45. 585 print#1,tab(3);"sold to:-";tab(32);"ship to:-"
  46. 590 print#1,spc(6);s1$;spc(41-len(s1$));h1$
  47. 600 print#1,spc(6);s2$;spc(41-len(s2$));h2$
  48. 610 print#1,spc(6);s3$;spc(41-len(s3$));h3$
  49. 620 print#1:print#1
  50. 625 for a=1 to 80:print#1,chr$(163);:next
  51. 630 print#1,spc(3);"your order";spc(12);"terms";spc(15);"shipped via";
  52. 631 print#1,spc(8);"date shipped"
  53. 640 print#1,spc(3);co$;spc(22-len(co$));te$;spc(20-len(te$));sv$;
  54. 642 print#1,spc(19-len(sv$));rd$
  55. 645 for a=1 to 80:print#1,chr$(184);:next
  56. 650 print#1,spc(3);"order";spc(2);"ship";spc(12);"description";
  57. 651 print#1,spc(17);"price";spc(11);"total"
  58. 655 for a=1 to 80:print#1,chr$(163);:next
  59. 660 print"[147]":gosub 1130
  60. 670 gosub 830
  61. 680 goto 660
  62. 690 s1=i
  63. 700 if dc=0 then 740
  64. 710 if (s1>0) and (s1<30) then d=.25
  65. 720 if (s1>31)and (s1<60) then d=.33
  66. 730 if s1>60 then d=.4
  67. 740 if v<>0 then 800
  68. 750 if s1<15 then v=2
  69. 760 if (s1>14) and (s1<30) then v=1.25
  70. 770 if (s1>29) and (s1<50) then v=1.5
  71. 780 if (s1>49) and (s1<100) then v=2
  72. 790 if s1>99 then v=2.5
  73. 800 i1=i1+1
  74. 810 r=int(d*100+.5):r$=str$(r)
  75. 820 goto 940
  76. 830 a=o:gosub 1410
  77. 840 g$=d$:l1=l
  78. 850 c=s1*o
  79. 860 a=c:gosub 1410
  80. 870 j$=str$(n1):k$=str$(s1):kk$=str$(z1)
  81. 880 j=len(j$):k=len(k$):kk=len(kk$)
  82. 890 print#1,spc(5-kk);z1;
  83. 900 print#1,spc(6-k);s1;spc(8);n1;spc(6-j);e$;
  84. 910 print#1,spc(30-len(e$)-l1);g$;spc(17-l);d$
  85. 920 c=s1*o:t=t+c
  86. 930 return
  87. 940 d1=d*t
  88. 950 d1=int(d1*100+.5)/100
  89. 960 print#1
  90. 970 a=d1:gosub 1410
  91. 980 print#1,spc(46-len(r$));r;spc(2);"%discount= -";spc(14-l);d$
  92. 990 for p=1 to (10-zs):print#1:next p
  93. 1000 print#1,spc(23);"thank you for your order"
  94. 1003 for a=1 to 80:print#1,chr$(184);:next
  95. 1005 print#1,spc(3);"net";spc(5);"sales";spc(52);"invoice"
  96. 1006 print#1,spc(3);"am't";spc(4);"tax";spc(5);"freight";spc(42);"total"
  97. 1007 for a=1 to 80:print#1,chr$(163);:next
  98. 1020 a=t-d1:gosub 1410
  99. 1030 g$=d$:l1=l
  100. 1040 a=v:gosub 1410
  101. 1050 h$=d$
  102. 1060 m1=(t-d1+v)*tr:rem to exclude sales tax on freight use m1=(t-d1)*tr
  103. 1070 a=t-d1+m1+v:gosub 1410
  104. 1080 j$=d$:l2=l
  105. 1090 a=m1:gosub 1410
  106. 1100 print#1,spc(8-l1);g$;spc(7-l);d$;spc(3);h$;spc(51-l2);j$
  107. 1105 for a=1 to 80:print#1,chr$(184);:next
  108. 1110 print#1:print#1
  109. 1120 gosub 1290:i=0:t=0:goto 250
  110. 1130 input"which item no.";n1
  111. 1150 if n1=0 then 690
  112. 1160 restore
  113. 1170 read n,e$,o
  114. 1180 if n=0 then 1210
  115. 1190 if n=n1 then 1230
  116. 1200 goto 1170
  117. 1210 print"item no. not found !"
  118. 1220 print:print:print:goto 1130
  119. 1230 input"enter quantity ordered ";z1
  120. 1250 input"enter quantity shipped ";s1
  121. 1270 i=i+s1:zs=zs+1
  122. 1280 return
  123. 1290 print#1,spc(3);"from:->";tab(45);"remarks:-"
  124. 1298 print#1
  125. 1300 print#1,spc(5);"elcomp publishing inc."
  126. 1310 print#1,spc(5);"2174 w. foothill blvd. #e"
  127. 1320 print#1,spc(5);"upland, ca. 91786"
  128. 1330 for zv=1 to 3:print#1
  129. 1340 next zv
  130. 1345 print#1,spc(3);"to:->"
  131. 1348 print#1
  132. 1350 print#1,spc(5);h1$
  133. 1360 print#1,spc(5);h2$
  134. 1370 print#1,spc(5);h3$
  135. 1380 print"[147]"
  136. 1390 zs=0:s1=0:t=0:i=0
  137. 1400 return
  138. 1405 rem decimal align subroutine
  139. 1410 k1$="0"
  140. 1420 k2$=".00"
  141. 1430 b=int(a*100+.5)/100
  142. 1440 d1$=str$(b)
  143. 1450 d0=b*10
  144. 1460 d2=int(d0)
  145. 1470 d3=d0-d2
  146. 1480 if d3<.09 then 1510
  147. 1490 d$=d1$
  148. 1500 goto 1570
  149. 1510 d4=int(b)
  150. 1520 d5=b-d4
  151. 1530 if d5<.09 then 1560
  152. 1540 d$=d1$+k1$
  153. 1550 goto 1570
  154. 1560 d$=d1$+k2$
  155. 1570 l=len(d$)
  156. 1580 return
  157. 1600 close1:end
  158. 2000 rem data statements start here for product stock # and unit price
  159. 2010 data 100,product no.1,2.25
  160. 2020 data 200,product no.2,1.50
  161. 2030 data 300,product no.3,3.75
  162. 2040 data 400,product no.4,2.50
  163. 2050 data 0,0,0
  164. 2060 rem last statement has to contain 0,0,0
  165.