home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / bus / receet.ba < prev    next >
Text File  |  2006-10-19  |  3KB  |  41 lines

  1. 0 'RECEET Cash Register Receipt Printer    Modified for the TRS-80 Model 100 by Dave Thomas; GEnie's Laptops RT.
  2. 1 'CLUB 100 Library - 415/939-1246 BBS,    937-5039 NEWSLETTER, 932-8856 VOICE
  3. 2 'This program uses the capability
  4. 3 'of a dot-matrix printer to print
  5. 4 'a register receipt.
  6. 5 'To use, review the printer control
  7. 6 'strings and sales tax rate constants
  8. 7 'at the beginning of the program
  9. 8 'and alter as necessary.
  10. 9 CLEAR1200:DIM IT$(100) 'Item Desc  Array
  11. 10 DIM IP(100) 'Item Price Array
  12. 11 LI=100 'Array Size
  13. 12 TX=.06 'Sales Tax Rate
  14. 13 ES$=CHR$(14) 'EPSON Start Expanded Print
  15. 14 EE$=CHR$(20) 'EPSON End   Expanded Print
  16. 15 TS$=CHR$(27)+"S"+CHR$(1) 'EPSON Start Tiny Print
  17. 16 TE$=CHR$(27)+"T"  'EPSON End   Tiny Print
  18. 17 L6$=CHR$(27)+"2"  'EPSON Six   Lines/Inch
  19. 18 L8$=CHR$(27)+"0"  'EPSON Eight Lines/Inch
  20. 19 IF(INP(187)AND6)<>2THENCLS:PRINTTAB(123)"Sorry, but our printer isn't ready!":END
  21. 20 CLS:PRINT:PRINTTAB(4)"Cash Register Receipt Generator":PRINT" ":PRINTTAB(18)"0    1    1":PRINTTAB(14)"....5....0....5":PRINT" Store Name ";:INPUTST$:IF(LEN(ST$)<15)THENGOSUB36
  22. 21 IF(LEN(ST$)>15)THENST$=MID$(ST$,1,15)
  23. 22 PRINT" ":PRINTTAB(14)"99/99/99   CR=";DATE$:PRINT" New Date   ";:INPUTDT$:IFDT$=""THENDT$=DATE$
  24. 23 MM$=MID$(DT$,1,2):DD$=MID$(DT$,4,2):YY$=MID$(DT$,7,2):IX=0:ITC=0
  25. 24 CLS:PRINT:PRINT" Enter + to repeat; ENTER to end"
  26. 25 PRINTTAB(18)"0    1    1":PRINTTAB(14)"....5....0....5....":PRINT" Item Desc    ";:LINEINPUTIT$(IX):IFIT$(IX)=""THEN31
  27. 26 IF(IT$(IX)="+")AND(IX>0)THENIT$(IX)=IT$(IX-1):IP(IX)=IP(IX-1):GOTO30
  28. 27 IF(LEN(IT$(IX))<19)THENGOSUB38
  29. 28 IF(LEN(IT$(IX))>19)THENIT$(IX)=MID$(IT$(IX),1,19)
  30. 29 PRINT" ":PRINTTAB(14)"9999.99":PRINT" Item Price ";:INPUTIP(IX)
  31. 30 ITC=ITC+1:IX=IX+1:IF(IX>LI)OR(IX=LI)THEN31ELSE24
  32. 31 L1$="|"+STRING$(32,45)+"|":L2$="|"+SPACE$(32)+"|":STL$="| "+ES$+ST$+EE$+" |":DTL$="| "+TS$+SPACE$(10)+MM$+"/"+DD$+"/"+YY$+SPACE$(12)+TE$+" |":LPRINTL6$;:LPRINTL1$:LPRINTL2$:LPRINTSTL$:LPRINTL2$:LPRINTDTL$:LPRINTL8$;:LPRINTL2$:TT=0
  33. 32 FORI=0TO(ITC-1):LPRINT"| ";TS$;IT$(I);:LPRINTUSING"######.##";IP(I);:LPRINT" +";TE$;" |":TT=TT+IP(I):NEXTI:LPRINTL2$:LPRINT"| ";TS$;"SUB-TOTAL";SPACE$(10);:LPRINTUSING"######.##";TT;:LPRINT" S";TE$;" |":STX=TT*TX
  34. 33 LPRINT"| ";TS$;"SALES TAX";SPACE$(10);:LPRINTUSING"######.##";STX;:LPRINT" +";TE$;" |":LPRINTL2$:TT=TT+STX:LPRINT"| ";TS$;"TOTAL";SPACE$(14);:LPRINTUSING"######.##";TT;:LPRINT" *";TE$;" |":LPRINTL6$;:LPRINTL2$
  35. 34 LPRINT"| ";ES$;"   Thank You   ";EE$;" |":LPRINTL2$:LPRINTL1$:PRINT" Do Another Receipt (Y/N)";:INPUTR$:IFR$="Y"ORR$="y"THEN20
  36. 35 LPRINTCHR$(12);:GOTO39
  37. 36 CT=15-LEN(ST$):FORI=1TOCT:IF(((I/2)-(INT(I/2)))=0)THENST$=ST$+" "ELSEST$=" "+ST$
  38. 37 NEXTI:RETURN
  39. 38 CT=19-LEN(IT$(IX)):FORI=1TOCT:IT$(IX)=IT$(IX)+" ":NEXTI:RETURN
  40. 39 END
  41.