'OPTION _EXPLICIT
TYPE InventoryDataStructure
'STOCKUPC = 9, more corrupts the barcode print out.
DIM SHARED pos1
, pos2
, linepos
, Title$
, Author$: pos1
= 2: linepos
= 1: pos2
= 30
'Product Constants future rewrite
TYPE ProductDataStructure
ProductInventoryEmployeeScan
AS STRING * 4 ProductInventoryEmployeename
AS STRING * 60'DIM shared ProductPurchase AS ProductDataStructure
'OPEN ProductInventoryUPCFile$ FOR RANDOM AS #freefile LEN = LEN(ProductPurchase)
1
COLOR 15, 7 'Foreground, Background colors Author$ = "Written by Chris Owen on 6-20-2019, Email: chris.owen09@gmail.com"
Title$ = "A1 Powder Coat"
EmployeeFile$ = "Employee File.csv"
ProductInventoryDBase$ = "Product Inventory Stock.RND"
ProductInventoryUPCFile$ = "Product Inventory File.csv"
Printer1$ = "Brother QL-500"
Printer2$ = "Lexmark C500"
Printer3$ = "Microsoft Print to PDF"
position = 3
choice$ = ""
LOCATE 13 + position
, 1:
PRINT "E Edit Employee File " + EmployeeFile$
LOCATE 23, 1:
PRINT "ESC to exit" ' Lock in here no lower choice$
= UCASE$(INKEY$) 'change any user key press to uppercase
SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$
+ "' call setdefaultprinter" CALL Part
(choice$
, ProductInventoryDBase$
, EmployeeFile$
, ProductInventoryUPCFile$
, Printer$
) SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$
+ "' call setdefaultprinter"
SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$
+ "' call setdefaultprinter" CALL Part
(choice$
, ProductInventoryDBase$
, EmployeeFile$
, ProductInventoryUPCFile$
, Printer$
) SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$
+ "' call setdefaultprinter"
SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$
+ "' call setdefaultprinter" CALL SEARCH
(choice$
, ProductInventoryDBase$
, EmployeeFile$
, ProductInventoryUPCFile$
, Printer$
) SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$
+ "' call setdefaultprinter"
SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$
+ "' call setdefaultprinter" CALL SEARCH
(choice$
, ProductInventoryDBase$
, EmployeeFile$
, ProductInventoryUPCFile$
, Printer$
) SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$
+ "' call setdefaultprinter"
SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$
+ "' call setdefaultprinter" CALL SEARCH
(choice$
, ProductInventoryDBase$
, EmployeeFile$
, ProductInventoryUPCFile$
, Printer$
) SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$
+ "' call setdefaultprinter"
IF choice$
= "C" THEN CALL CodeCreator
(Printer1$
, Printer2$
, Printer3$
) IF choice$
= "E" THEN CALL Employee
(EmployeeScan$
, EmployeeName$
, EmployeeFile$
):
GOTO 1
IF choice$
= "P" THEN CALL Select_Printer
(Printer$
)
choice$ = ""
SUB SEARCH
(choice$
, ProductInventoryDBase$
, EmployeeFile$
, ProductInventoryUPCFile$
, Printer$
) pos1 = 2: linepos = 2: pos2 = 30
NumRecords%
= LOF(5) \
LEN(ProductInventory
)
600
choice$ = ""
LOCATE 1, 15:
PRINT Title$
+ " Single Entry";
" Records " + STR$(NumRecords%
)
LOCATE 1, 15:
PRINT Title$
+ " Multiple Entry";
" Records " + STR$(NumRecords%
)
601
choice$ = ""
LOCATE linepos
+ 21, pos1:
PRINT "ESC key plus Enter to exit"
611
CALL Employee
(EmployeeScan$
, EmployeeName$
, EmployeeFile$
) (ProductInventory.EmployeeScan) = EmployeeScan$
(ProductInventory.Employeename) = EmployeeName$
LOCATE linepos
+ 3, pos1:
PRINT "Captured Employee Scan #" + RTRIM$(ProductInventory.EmployeeScan
) + " " + RTRIM$(ProductInventory.Employeename
)
612
LOCATE linepos
+ 4, pos2:
INPUT ProductInventoryStockUPC$
614
IF LEN(ProductInventoryStockUPC$
) <> 10 THEN ProductInventoryStockUPC$
= "0" + ProductInventoryStockUPC$:
GOTO 614
NumRecords = NumRecords + 1
GET #5, NumRecords
, ProductInventory
LOCATE linepos
+ 3, pos1:
PRINT "Captured Employee Scan #" + RTRIM$(ProductInventory.EmployeeScan
) + " " + RTRIM$(ProductInventory.Employeename
) LOCATE linepos
+ 10, pos1:
PRINT "Expiration Date ":
LOCATE linepos
+ 10, pos2:
PRINT ProductInventory.ExpirationDate
LOCATE linepos
+ 11, pos1:
PRINT "Type of Product ":
LOCATE linepos
+ 11, pos2:
PRINT ProductInventory.TypeofProductInventory
IF choice$
= "OUT" THEN LOCATE linepos
+ 16, pos1:
PRINT "Check Out Weight":
LOCATE linepos
+ 16, pos2:
INPUT ProductInventory.WeightCheckOut
613
DT$ = ""
akey$ = ""
64000
ProductInventory.TM
= TIME$: ProductInventory.DT
= DATE$ 'IF Check$ = "OUT" THEN LOCATE linepos + 15, pos2: PRINT "? " + ProductInventory.DT
'IF Check$ = "IN" THEN LOCATE linepos + 15, pos2: PRINT "? " + ProductInventory.TM
'LOCATE linepos + 15, pos2 + 13: PRINT "Correct N/Y ?"
'DO UNTIL akey$ <> ""
'akey$ = INKEY$
'IF UCASE$(akey$) = "N" THEN LOCATE linepos + 15, pos2: PRINT " ": GOTO 613
'IF UCASE$(akey$) = CHR$(12) THEN akey$ = ""
'IF UCASE$(akey$) <> "Y" THEN akey$ = ""
'IF UCASE$(akey$) = CHR$(27) THEN GOTO 631
'LOOP
LOCATE linepos
+ 21, pos1:
PRINT "Only C Cancels Entry anything else to save" akey$ = ""
LOCATE linepos
+ 21, pos1:
PRINT "ESC to Save Last Entry and Exit" akey$ = ""
'Add Inventory
'NumRecords% = LOF(5) \ LEN(ProductInventory)
PUT #5, NumRecords%
+ 1, ProductInventory
' Barcode Printout
IF Check$
= "IN" OR Check$
= "REPRINT" THEN Datapass1$ = ProductInventory.StockUPC
DATAPASS2$ = ProductInventory.ExpirationDate
DATAPASS3$ = ProductInventory.UnitName
DATAPASS4$ = ProductInventory.Number
IF Check$
= "IN" THEN DATAPASS5
= ProductInventory.WeightCheckIn
'rep
IF Check$
= "REPRINT" THEN DATAPASS5
= ProductInventory.WeightBegin
CALL Barcode
(Datapass1$
, DATAPASS3$
, DATAPASS4$
, DATAPASS2$
, DATAPASS5
) 631
SUB Part
(choice$
, ProductInventoryDBase$
, EmployeeFile$
, ProductInventoryUPCFile$
, Printer$
) pos1 = 2: linepos = 2: pos2 = 30
NumRecords%
= LOF(5) \
LEN(ProductInventory
)
400
choice$ = ""
LOCATE 3, 15:
PRINT Title$
+ " Single Entry";
" Records " + STR$(NumRecords%
)
LOCATE 3, 15:
PRINT Title$
+ " Multiple Entry";
" Records " + STR$(NumRecords%
)
LOCATE linepos
+ 21, pos1:
PRINT "ESC key plus Enter to exit" 'LOCATE linepos + 21, pos2: PRINT "Default Printer " + Printerdisplay$
411
CALL Employee
(EmployeeScan$
, EmployeeName$
, EmployeeFile$
) (ProductInventory.EmployeeScan) = EmployeeScan$
(ProductInventory.Employeename) = EmployeeName$
LOCATE linepos
+ 3, pos1:
PRINT "Captured Employee Scan #" + RTRIM$(ProductInventory.EmployeeScan
) + " " + RTRIM$(ProductInventory.Employeename
)
412
LOCATE linepos
+ 4, pos1:
PRINT "ProductInventory UPC Code" LOCATE linepos
+ 4, pos2:
INPUT ProductInventoryUPCCode$
CALL ProductInventoryFile
(ProductInventoryUPCCode$
, ProductInventoryBrand$
, ProductInventoryNumber$
, ProductInventoryName$
, ProductInventoryUPCFile$
, linepos
, pos1
, pos2
)
CALL SerialGen
(Serial$
): ProductInventory.StockUPC
= Serial$
LOCATE linepos
+ 11, pos1:
PRINT "Measured as Gallon or Pound" LOCATE linepos
+ 12, pos1:
PRINT "Weight/Quanity/Amount"
LOCATE linepos
+ 9, pos2:
INPUT ProductInventory.BatchNumber
LOCATE linepos
+ 10, pos2:
INPUT ProductInventory.BoxNumber
422
421
ProductInventory.GallonorPound = GallonorPound$
LOCATE linepos
+ 12, pos2:
INPUT ProductInventory.WeightBegin
LOCATE linepos
+ 14, pos1:
PRINT "Purchase/Received Date"
LOCATE linepos
+ 16, pos1:
PRINT "Type of Product Dry or Wet"
413 DT$ = ""
akey$ = ""
44000
ProductInventory.PurchaseDate = DT$
LOCATE linepos
+ 14, pos2:
PRINT "? " + ProductInventory.PurchaseDate
414 DT$ = ""
akey$ = ""
44001
ProductInventory.ExpirationDate = DT$
LOCATE linepos
+ 15, pos2:
PRINT "? " + ProductInventory.ExpirationDate
'LOCATE linepos + 12, pos2: INPUT ProductInventory.WeightCheckOut
'LOCATE linepos + 12, pos2: INPUT ProductInventory.WeightCheckIn
423
424
ProductInventory.TypeofProductInventory = TypeOf$
LOCATE linepos
+ 16, pos2:
PRINT ProductInventory.TypeofProductInventory
ProductInventory.Room
= UCASE$(ProductInventory.Room
)
ProductInventory.Rack
= UCASE$(ProductInventory.Rack
)
LOCATE linepos
+ 19, pos2:
INPUT ProductInventory.Shelf
ProductInventory.Shelf
= UCASE$(ProductInventory.Shelf
) LOCATE linepos
+ 19, pos2:
PRINT ProductInventory.Shelf
ProductInventory.Bin
= UCASE$(ProductInventory.Bin
) ProductInventory.INorOut = "IN"
LOCATE linepos
+ 21, pos1:
PRINT "Only C Cancels Entry anything else to save" akey$ = ""
LOCATE linepos
+ 21, pos1:
PRINT "ESC to Save Last Entry and Exit" akey$ = ""
ProductInventory.TM
= TIME$: ProductInventory.DT
= DATE$
'Add Inventory
NumRecords%
= LOF(5) \
LEN(ProductInventory
) PUT #5, NumRecords%
+ 1, ProductInventory
' Barcode Printout
Datapass1$ = ProductInventory.StockUPC
DATAPASS2$ = ProductInventory.ExpirationDate
DATAPASS3$ = ProductInventory.UnitName
DATAPASS4$ = ProductInventory.Number
Datapass5 = ProductInventory.WeightBegin
CALL Barcode
(Datapass1$
, DATAPASS3$
, DATAPASS4$
, DATAPASS2$
, Datapass5
)
431
ProductInventory.INorOut = ""
SUB Select_Printer
(Printer$
) Pos10 = 15
SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt" OPEN "I", 10, "impresora.txt" n% = 0
n% = n% + 1
dato$
= MID$(dato$
, a%
+ 1) dato$
= LEFT$(dato$
, a%
- 1) dato$
= LEFT$(dato$
, a%
- 1) + MID$(dato$
, a%
+ 1) a%
= INSTR(dato$
, "FALSE"): b%
= INSTR(dato$
, "TRUE") loca% = n%
impresora(n%) = dato$
LOCATE 8, Pos10
- 1:
PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" LOCATE 10, Pos10
- 1:
PRINT "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹" a$ = "@"
a$ = impresora(loca%)
loca% = loca% - 1
loca% = loca% + 1
PRINT #44, "cmd/c wmic printer where name='" + a$
+ "' call setdefaultprinter" SHELL _HIDE "cmd/c wmic printer where name='" + a$
+ "' call setdefaultprinter" PRINT "Selected printer: "; a$
PRINT "The printer has not been modified" impridatos:
y% = 1
FOR n%
= loca%
- 2 TO loca%
+ 2 y% = y% + 1
700
choice$ = ""
GetLocalIP$
= MID$(ipline$
, INSTR(ipline$
, ":") + 2) IF GetLocalIP$
= "127.0.0.1" THEN GetLocalIP$
= "offline":
GOTO 778 IF GetLocalIP$
= "" THEN GetLocalIP$
= "offline":
GOTO 778 ' CLOSE #A
' KILL "IPconfig.tmp" 'kill the messenger?
778
KILL "IPconfig.tmp" 'kill the messenger?
' Shell to ping and get results 0 up 1 down
INPUT "Host to ping? ", ip$
result&
= _SHELLHIDE("ping " + ip$
+ " -n 1 -w 100") 'success
REM PRINT #2, DATE$ + " " + TIME$ + " " + "Ping (" + ip$
+ ") (" + desc$
+ ")" + " Down": flag
= 1: set
= 0 flag = 1: set = 0
777
SUB Employee
(EmployeeScan$
, EmployeeName$
, EmployeeFile$
)
LinepPos = 5
651
'LOCATE linepos + 11, pos2: INPUT "Number ", EmployeeScan$
EmployeeName$ = B$
ProductInventory.EmployeeScan = EmployeeScan$
ProductInventory.Employeename = EmployeeName$
652
LOCATE linepos
+ 11, pos2:
PRINT "Number ", EmployeeScan$
LOCATE linepos
+ 12, pos2:
PRINT "Name ", EmployeeName$
LOCATE linepos
+ 14, pos2:
PRINT "Do you need to Edit?" LOCATE linepos
+ 15, pos2:
PRINT " (A)dd Restart, (N)umber Scan, (E)mployee Name, then finaly (S)ave, (ESC) all changes"
653
LOCATE linepos
+ 10, pos2:
PRINT "Change Employee Number" LOCATE linepos
+ 11, pos2:
INPUT "Number ", EmployeeScan$
LOCATE linepos
+ 12, pos2:
PRINT "Name ", EmployeeName$
654
LOCATE linepos
+ 10, pos2:
PRINT "Change Employee Name" LOCATE linepos
+ 11, pos2:
PRINT "Number ", EmployeeScan$
LOCATE linepos
+ 12, pos2:
INPUT "Name ", EmployeeName$
655
LOCATE linepos
+ 11, pos2:
INPUT "Number ", EmployeeScan$
LOCATE linepos
+ 12, pos2:
INPUT "Name ", EmployeeName$
656
WRITE #EF
, EmployeeScan$
, EmployeeName$
657
SUB ProductInventoryFile
(ProductInventoryUPCCode$
, ProductInventoryBrand$
, ProductInventoryNumber$
, ProductInventoryName$
, ProductInventoryUPCFile$
, linepos
, pos1
, pos2
) pos1 = 2: linepos = 2: pos2 = 30
553
INPUT #PIF
, A$
, B$
, C$
, D$
IF ProductInventoryUPCCode$
= A$
THEN ProductInventoryBrand$ = B$
ProductInventoryNumber$ = C$
ProductInventoryName$ = D$
555
LOCATE linepos
+ 5, pos1:
PRINT "ProductInventory Brand ":
LOCATE linepos
+ 5, pos2:
PRINT ProductInventory.Brand
LOCATE linepos
+ 6, pos1:
PRINT "ProductInventory Name ":
LOCATE linepos
+ 6, pos2:
PRINT ProductInventory.UnitName
LOCATE linepos
+ 7, pos2:
INPUT ProductInventoryNumber$
WRITE #PIF
, ProductInventoryUPCCode$
, ProductInventoryBrand$
, ProductInventoryNumber$
, ProductInventoryName$
554
ProductInventory.UPCCode = ProductInventoryUPCCode$
ProductInventory.Brand = ProductInventoryBrand$
ProductInventory.Number = ProductInventoryNumber$
ProductInventory.UnitName = ProductInventoryName$
SUB Barcode
(DATAPASS1$
, DATAPASS3$
, DATAPASS4$
, DATAPASS2$
, Datapass5
) DATAPASS1$
= "*" + RTRIM$(DATAPASS1$
) + "*"
PRINT "--------------------------------------------------------------" PRINT "Serial " + DATAPASS1$
+ " Use By "; DATAPASS2$
PRINT DATAPASS3$
+ " Weight " + STR$(Datapass5
) PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||" PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||" PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||" PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||" PRINT "--------------------------------------------------------------"
'Label designer for the Brother 201 (29mm x 90mm or 1-1/7" x 3-1/2") / Zebra ZDesigner LP 2844 looks compatible.
FFONT$ = "free3of9.ttf": FFSize = 170 '170 for label
EFONT$ = "Arial.ttf": EFSize = 40
AFONT$ = "Arial.ttf": AFSize = 40
PageWidth = 110 * 10 'maximized tweaks for whole label
PageHeight = 29 * 10 'Max is already set do not change.
Colum = 10
keep
= LEN(DATAPASS1$
): DATAPASS1$
= MID$(DATAPASS1$
, 2, keep
- 2) COLOR _RGB(1, 1, 1), _RGB(256, 256, 256):
_PRINTSTRING (Colum
, 0), "Serial " + DATAPASS1$
' Print upc bar information above bar scan font
serial$ = "000000000"
SSerial$
= LEFT$(serial$
, 1) ISerial = ISerial + 1:
ISerial$ = "0" + ISerial$
serial$ = SSerial$ + ISerial$
Pos10 = 15
SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt" OPEN "I", 10, "impresora.txt" n% = 0
n% = n% + 1
dato$
= MID$(dato$
, a%
+ 1) dato$
= LEFT$(dato$
, a%
- 1) dato$
= LEFT$(dato$
, a%
- 1) + MID$(dato$
, a%
+ 1) a%
= INSTR(dato$
, "FALSE"): b%
= INSTR(dato$
, "TRUE")
Printerdisplay$ = dato$
loca% = n%
impresora(n%) = dato$
SUB CodeCreator
(Printer1$
, Printer2$
, Printer3$
) 'SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$ + "' call setdefaultprinter"
FFONT$ = "free3of9.ttf": FFSize = 120
EFONT$ = "Arial.ttf": EFSize = 60
AFONT$ = "Arial.ttf": AFSize = 60
PageWidth = 216 * 10
PageHeight = 279 * 10
Colum = 10
PRINT "Please Enter information for the label." INPUT "Barcode Information to print ", DATAPASS1$: DATAPASS1$
= "*" + RTRIM$(UCASE$(DATAPASS1$
)) + "*" PRINT "Please select Output printer" INPUT "Which Printer to send to?", a
Printer$ = Printer1$
'Label designed for the Brother 201 (29mm x 90mm or 1-1/7" x 3-1/2") / Zebra ZDesigner LP 2844 looks compatible.
FFONT$ = "free3of9.ttf": FFSize = 170 '170 for label
EFONT$ = "Arial.ttf": EFSize = 40
AFONT$ = "Arial.ttf": AFSize = 40
PageWidth = 110 * 10 'maximized tweaks for whole label
PageHeight = 29 * 10 'Max is already set do not change.
Printer$ = Printer2$
'Label designed plain paper (or 8-1/2" x 11").
FFONT$ = "free3of9.ttf": FFSize = 120
EFONT$ = "Arial.ttf": EFSize = 60
AFONT$ = "Arial.ttf": AFSize = 60
PageWidth = 216 * 10
PageHeight = 279 * 10
Printer$ = Printer3$
'Label designed plain paper (or 8-1/2" x 11").
FFONT$ = "free3of9.ttf": FFSize = 120
EFONT$ = "Arial.ttf": EFSize = 60
AFONT$ = "Arial.ttf": AFSize = 60
PageWidth = 216 * 10
PageHeight = 279 * 10
SHELL _HIDE "cmd/c wmic printer where name='" + Printer$
+ "' call setdefaultprinter"
keep
= LEN(DATAPASS1$
): DATAPASS1$
= MID$(DATAPASS1$
, 2, keep
- 2) COLOR _RGB(1, 1, 1), _RGB(256, 256, 256):
_PRINTSTRING (Colum
, 0), DATAPASS1$
' Print upc bar information above bar scan font