home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / cpmug / cpmug087.ark / RGRPT.BAS < prev    next >
Encoding:
BASIC Source File  |  1986-10-20  |  3.6 KB  |  122 lines

  1.      rem This is the Raw Goods Inventory Report Printer
  2.  
  3. %INCLUDE ALL.BAS
  4.      RESTORE
  5. 1005 DIM N(2,20)
  6.      dim k$(3,20)
  7.      z5$="b:rg"
  8.      fmt1$="$$#,###,###.##"
  9.      fmt2$="#,###,###"
  10.      for z=1 to 130:repeat1$=repeat1$+"-":repeat2$=repeat2$+"="
  11.      repeat3$=repeat3$+"*":next z
  12. 1020 DIM H(9),S(9),T(4,9),A(16)
  13. 1025 PRINT clear$:PRINT
  14. 1050 Q$="R A W  G O O D S  (I N V E N T O R Y)  R E P O R T"
  15. 1065 L$="###,###.##"
  16. 1070 U$="#,###.#"
  17.      for z=3 to 9:read n(1,z):next z
  18.      data 7,12,24,24,8,8,10
  19. 1100 REM GET DATES ROUTINE
  20. 1145 Z9=0
  21. 1200 REM READ TAB VALUES ROUTINE
  22.     JRF%=T%(1)
  23. 1235 T%(1)=130
  24. 3000 REM READ NAME FILE SUBROUTINE
  25. 3005 a5=T%(12)
  26. 3080 Z=24:Z9=1
  27. 3090 FOR Z0=1 TO 4
  28. 3100 K$(0,Z0)=MID$(N$,Z9,Z)
  29. 3110 Z9=Z9+Z
  30. 3120 NEXT Z0
  31. 3125 REM ROUTINE TO ELIMINATE TRAILING BLANKS
  32.     l8=1
  33. 3130 FOR I=1 TO 4
  34.      l9=len(k$(0,i))
  35. 3140 for z=l9 to l8 step -1
  36. 3150 IF MID$(K$(0,I),Z,1)<>" " THEN 3170
  37. 3160 NEXT Z
  38. 3170 Z$=""
  39. 3180 FOR Z0=1 TO Z
  40. 3190 Z$=Z$+MID$(K$(0,I),Z0,1)
  41. 3200 NEXT Z0
  42. 3210 K$(0,I)="":K$(0,I)=Z$
  43. 3220 NEXT I
  44. 6000 REM PRINT RAW GOODS REPORT
  45. 6005 PRINT clear$:PRINT:PRINT "PRINTING RAW GOODS REPORT":P0=1
  46. 6010 lprinter
  47.      open z5$ recl 256 as 1
  48.     IF END#1 THEN 6060
  49.     N(2,2)=10
  50. 6020 GOSUB 9600
  51. 6030 GOSUB 9100
  52. 6040 IF P9>56 THEN GOSUB 9300
  53. 6050 IF N(2,2)<>0 THEN 6030
  54. 6060 GOSUB 9800
  55. 6070 GOTO 9900
  56. 9100 N$=""
  57. 9105 A9=A9+1
  58.      read #1,a9;n(2,1),n(2,2),n$,f0,f1,f2,f3,f4,f5,f6,f7,f8,f9
  59. 9115 Z9=1:FOR Z=3 TO 9:K$(3,Z)=MID$(N$,Z9,N(1,Z)):Z9=Z9+N(1,Z):NEXT Z
  60. 9120 IF N(2,2)=0 THEN 9295
  61. 9150 print A9;TAB(11);K$(3,9);TAB(26);F0
  62. 9152 print N(2,1);TAB(7);N(2,2);TAB(18);K$(3,3);TAB(27);
  63. 9155 print K$(3,4);TAB(41);K$(3,5);TAB(67);K$(3,6);TAB(93);K$(3,7);
  64. 9160 print TAB(105);K$(3,8)
  65. 9165 print:P9=P9+3
  66.      print using fmt1$;f1;tab(21);:print using fmt2$;f8;tab(41);
  67.      print using fmt2$;f3;tab(101);:print using fmt1$;f1*f3
  68.      print using fmt1$;f2;tab(21);:print using fmt2$;f9;tab(41);f4;\
  69.      tab(61);f5;tab(71);f6;tab(81);f7;tab(101);
  70.      print using fmt1$;f2*f3
  71. 9200 print repeat1$
  72. 9205 print:P9=P9+3
  73. 9210 T1=T1+(F1*F3):T2=T2+(F2*F3)
  74. 9295 RETURN
  75. 9300 P9=0
  76.     IF N(2,2)=0 THEN 9350
  77. 9305 print
  78. 9310 print repeat2$
  79. 9320 print "report continues on next page"
  80. 9330 print repeat2$
  81. 9340 print chr$(12)
  82.     GOSUB 9600
  83. 9350 RETURN
  84. 9600 REM PRINT PAGE HEADING SUBROUTINE
  85. 9605 IF N(2,2)=0 THEN 9795
  86. 9610 print repeat3$:p9=p9+1
  87. 9615 print:P9=P9+1
  88. 9616 print TAB((T%(1)-LEN(Q$))/2);Q$:P9=P9+1
  89. 9617 print:P9=P9+1
  90. 9620 FOR Z=2 TO 4
  91. 9625 print TAB((T%(1)-LEN(K$(0,Z)))/2);K$(0,Z):P9=P9+1
  92. 9630 NEXT Z
  93. 9635 print:P9=P9+1
  94. 9640 print TAB(T%(10));"FOR PERIOD ENDING ";D$(2);TAB(T%(11));"PAGE #";P0
  95. 9642 P9=P9+1
  96. 9645 print repeat2$:p9=p9+1
  97. 9650 print "RECORD #";TAB(11);"VEND CODE";TAB(26);"VEND TAG #"
  98. 9652 print "TAG";TAB(7);"ACCT #";TAB(18);
  99. 9655 print "ITEM #";TAB(27);"PART #";TAB(41);"DESCRIPTION";TAB(67);
  100. 9660 print "LOCATION";TAB(93);"LAST ISSUE";TAB(105);"LAST RECEIPT"
  101. 9670 print:P9=P9+3
  102. 9680 print "UNIT COST";TAB(21);"MIN QUAN";TAB(41);"QUAN ON HAND";
  103. 9685 print TAB(61);"QUANTITY ISSUED";TAB(101);"TOTAL COST":P9=P9+1
  104. 9695 print "SELLING PRICE";TAB(21);"MAX QUAN";TAB(41);"QUAN ON ORDER";
  105. 9700 print TAB(61);"MTD";TAB(71);"QTD";TAB(81);"YTD";TAB(101);"REVENUE AT LIST"
  106. 9710 print repeat2$:p9=p9+2
  107.     P0=P0+1
  108. 9795 RETURN
  109. 9800 print repeat2$
  110. 9810 print "Total Value";tab(21);:print using fmt1$;t1;tab(41);
  111. 9820 print "Total Revenue at List";tab(71);:print using fmt1$;t2;tab(91);
  112. 9830 print "Gross Profit Potential";:print using fmt1$;t2-t1
  113.      print repeat2$
  114.      print "end of report"
  115.      print repeat2$
  116. 9895 RETURN
  117. 9900    PRINT CHR$(12)
  118. 9910 close 1
  119. 9915 console
  120. 9920     T%(1)=JRF%
  121.     CHAIN "master4"
  122.