home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / bus / plrg.do < prev    next >
Text File  |  2006-10-19  |  6KB  |  124 lines

  1. CLUB 100 Library - 415/939-1246 BBS  
  2. 937-5039 NEWSLETTER, 932-8856 VOICE
  3.  
  4. PLRG.BAS   (Parts List Report Generator)
  5. --------
  6.  
  7. Written by Tony B. Anderson
  8.  
  9.  
  10. The occasion arose where I had to create some parts lists for some projects I
  11. am involved in building at work.  The list had to be suitable for a "Gofer" to
  12. go out and buy the parts locally, and to include as part of a final report on
  13. the development of the project.  ("Gofer" is a term which refers to someone who
  14. "goes fer" stuff; no derogatory conotation is intended.)
  15.  
  16. I decided to use TEXT for input of the parts list, which could also be used to
  17. make corrections easily to the final list which would be submitted with the
  18. "Finished" report.  TEXT could also be used to edit the list, in the case of
  19. part substitutions, or to update the prices on the original list.
  20.  
  21. I started the parts list for each project with a standard header which could be
  22. pasted into the top of each file, with the project description added to the top
  23. line, in the following form:  (The three dots indicate the top and bottom of
  24. each file, used here for clarity, they are not included in the actual files.)
  25.  
  26. ...
  27. Parts List for
  28. Project assigned to
  29.  
  30. Part #        Qty    Description                Unit pr.  Total
  31. -------------------------------------------------------------------------------
  32.  
  33. ...
  34.  
  35.  
  36. Note that each column heading coincides with the normal TAB spacing in the TEXT
  37. program.  That would make it easy to TAB between columns when entering data.
  38.  
  39. Here is a copy of the complete file, in it's final form:  (80-column printout
  40. required - This file contains a parts list for a cable tester box we built.)
  41.  
  42.  
  43. ...
  44. Parts List for Cable Tester Box Project:
  45. Project assigned to Howard
  46.  
  47. Part #        Qty    Description                Unit pr.  Total
  48. -------------------------------------------------------------------------------
  49.  
  50. 270-223        1    Blue Project Box                $  2.69
  51. 276-041        3    Red Jumbo LED's                2/69    $  1.38
  52. 276-080        3    Jumbo LED Holders            2/119    $  2.38
  53. 274-013        1    Cannon D3F Connector                $  3.69
  54.         1    Cannon D3M Connector                $  3.52
  55. 270-326        1    9-volt battery clamp            2/59    $   .59
  56. 270-325        1    9-volt battery clip            5/99    $   .99
  57. 274-312        2    3-cond Phone Jacks                $  1.99
  58. 274-346        2    RCA Phono Jacks                4/199    $  1.99
  59. 274-249        2    1/8" Phone Jacks            2/159    $  1.59
  60. 278-212        2    F-61 Chassis Connectors            2/89    $   .89
  61.         2    BNC Chassis connectors            1.33    $  2.66
  62.         2    Cannon Mounting Templates        8.50    $ 17.00
  63. SW-961        3    Switchcraft Pushbuttons            2.72    $  8.16
  64. ...
  65.  
  66.  
  67. A simple Shift-Print hardcopy could be used as a purchasing list at the local
  68. Radio Shack Store, or other parts dealers.  In fact, the parts numbers shown
  69. above, (with the 200-series numbers) and the prices of most items were taken
  70. directly from the current Radio Shack catalog.  (It's amazing how fast the
  71. Radio Shack people can locate the right parts on the racks, when you have a
  72. nicely formatted list of the parts numbers!)  Those items without parts numbers
  73. had to be purchased from other sources.  You could also list specific item part
  74. numbers there, as in the case for the Switchcraft pushbuttons, which we did not
  75. want substituted.  Note also a column for package prices... Radio Shack often
  76. packages several like items in a package at a package price.  In the case of
  77. the LED's and holders, we only needed three of each, but they come in packages
  78. in multiples of two.  So the total price paid indicates how much we actually
  79. paid for the parts, regardless of any parts we may have had left over.  While
  80. not entirely accurate, this method does reflect the amount of money actually
  81. spent on the project.
  82.  
  83. After the parts were purchased, the parts list file was updated with the prices
  84. actually charged for various items, and the following program is run, which
  85. prints the final report copy for the department head.  The program is simple;
  86. it simply gets the name of your file, prints a header for the report, then
  87. reads the file line by line, printing each line as it goes, and adding up the
  88. prices in the last column.  At then end of the file, the program draws a line,
  89. prints sub-total, sales tax, and the total amount spent on the project.  The
  90. program will run on any model, and should print to any printer.  It expects the
  91. parts list file to be in RAM, but if you have it on disk, and an appropriate
  92. DOS, you can access files directly from the disk.
  93.  
  94. As an added feature, which you may want to delete, after printing the final
  95. project report, the program opens the file, and adds a final line which
  96. indicates the total project cost at the end of the file.  This is useful when
  97. you archive the file to disk, and need to refer to it later, without rerunning
  98. the report generator to add up the totals.  However, if you run the report
  99. generator program again, once that final line has been added to the file, the
  100. report program will pick up that amount, and add it to the total again, giving
  101. you a false total.  If you don't need or want this feature, simply delete lines
  102. 150 and 160.
  103.  
  104.  
  105. 0 ' PLRG.BAS  (Report Generator for         project parts lists)
  106. 2 ' Copyright 1988 Tony B. Anderson         All Rights Reserved
  107. 10 CLS:PRINT:INPUT" Name of the partlist file";F$
  108. 20 FORA=1TOLEN(F$):B=ASC(MID$(F$,A,1)):IFB>95THENMID$(F$,A,1)=CHR$(B-32)
  109. 30 NEXT:OPENF$FORINPUTAS1
  110. 40 PRINT:PRINT" Working..."
  111. 50 LPRINT"Parts List Report for the "F$" file."TAB(70)DATE$:LPRINTTAB(70)LEFT$(TIME$,5):LPRINT:LPRINT
  112. 60 IFEOF(1)THEN110
  113. 70 LINEINPUT#1,A$
  114. 80 IFA$=""THEN100
  115. 90 IFINSTR(A$,"$")THENB$=RIGHT$(A$,6):T=T+VAL(B$)
  116. 100 LPRINTA$:GOTO60
  117. 110 LPRINTTAB(70)STRING$(9,45):LPRINTTAB(55)"Subtotal:"TAB(70);:LPRINTUSING"$ ####.##";T
  118. 120 LPRINTTAB(55)"Sales Tax:"TAB(70);:TX=T*.06:LPRINTUSING"$ ####.##";TX
  119. 130 LPRINT:LPRINTTAB(55)"GRAND TOTAL:"TAB(70);:LPRINTUSING"$ ####.##";T+TX
  120. 140 LPRINTCHR$(12)
  121. 150 CLOSE:T1=INT((T+TX)*100)/100
  122. 160 OPENF$FORAPPENDAS1:PRINT#1,:PRINT#1,DATE$"  Total Price to date: $"T1
  123. 170 MENU
  124.