added LSL2 stored procedures
This commit is contained in:
210
LSL2/STPROC/PRINT_LOC_LABEL.txt
Normal file
210
LSL2/STPROC/PRINT_LOC_LABEL.txt
Normal file
@ -0,0 +1,210 @@
|
||||
COMPILE SUBROUTINE Print_Loc_Label(WhCd,LocCd,LocRec)
|
||||
|
||||
/*
|
||||
Print a label to the Zebra 105-s printer
|
||||
|
||||
12/04/2000 JCH - Initial coding - J.C.Henry, Inc. 2000
|
||||
|
||||
*/
|
||||
|
||||
|
||||
DECLARE FUNCTION Set_Printer, Get_Printer, Get_Status, Msg, RGB, Printer_Select,Get_Property,Print_Init,Print_End,Print_Text
|
||||
DECLARE FUNCTION obj_Install, Direct_Print, Environment_Services
|
||||
DECLARE SUBROUTINE Set_Status, ErrMsg, Msg
|
||||
|
||||
$INSERT OIPRINT_EQUATES
|
||||
$INSERT MSG_EQUATES
|
||||
$INSERT LOCATION_EQUATES
|
||||
|
||||
EQU PI$LEFT TO 1
|
||||
EQU PI$TOP TO 2
|
||||
EQU PI$RIGHT TO 3
|
||||
EQU PI$BOTTOM TO 4
|
||||
EQU PI$WIDTH TO 5
|
||||
EQU PI$HEIGHT TO 6
|
||||
EQU PI$SIZE TO 7
|
||||
|
||||
ErrorTitle = 'Error in Stored Procedure "PRINT_LOC_LABEL"'
|
||||
|
||||
IF NOT(ASSIGNED(WhCd)) THEN RETURN
|
||||
IF NOT(ASSIGNED(LocCd)) THEN RETURN
|
||||
IF NOT(ASSIGNED(LocRec)) THEN LocRec = ''
|
||||
|
||||
IF LocRec = '' THEN
|
||||
LocRec = XLATE("LOCATION",WhCd:'*':LocCd,'','X')
|
||||
END
|
||||
|
||||
*BitMap = obj_Install('Get_Prop','ZebraGRF') ;* Substitute company logo converted to .GRF (Zebra graphics format)
|
||||
|
||||
* * * * * * * * * * * *
|
||||
*Start Printing Process
|
||||
* * * * * * * * * * * *
|
||||
|
||||
|
||||
FileName = "Printing Label"
|
||||
Title = "Printing Label" ;* Initialize Printing
|
||||
|
||||
FileName = "Printing Label"
|
||||
Title = "Printing Label" ;* Initialize Printing
|
||||
|
||||
PageInfo = ''
|
||||
PageInfo<PI$LEFT> = 0.1
|
||||
PageInfo<PI$TOP> = 0.1
|
||||
PageInfo<PI$RIGHT> = 0.1
|
||||
PageInfo<PI$BOTTOM> = 0.1
|
||||
|
||||
PageSetup = '1' ;* Landscape
|
||||
PrintSetup = '' ;* Preview
|
||||
|
||||
*PrinterID = '\\FMSA001\PMSAZ_BR2' ;* Printer Server Change
|
||||
PrinterID = '\\mesirwfp001\MESZBRPRT001' ;* Site specific label printer ID - Skips popup
|
||||
|
||||
PrintPath = Printer_Select(PrinterID) ;* Select printer - Displays popup if PrinterPort not found
|
||||
|
||||
IF PrintPath = '' THEN
|
||||
Def = ""
|
||||
Def<MTYPE$> = "TA3"
|
||||
Def<MTEXT$> = 'Destination Printer not Selected..'
|
||||
Def<MCAPTION$> = ''
|
||||
Def<MICON$> = '*'
|
||||
Msg(@WINDOW, Def, '')
|
||||
RETURN
|
||||
END
|
||||
|
||||
If Environment_Services('GetLabelPrintMethod') _EQC 'OIPI' then
|
||||
stat = Set_Printer("INIT",FileName,Title,PageInfo,PageSetup,PrintSetup,PrintPath)
|
||||
end else
|
||||
stat = Direct_Print('START', PrintPath<1>, '', '')
|
||||
end
|
||||
|
||||
IF stat < 0 THEN GOTO OIPrint_Err
|
||||
|
||||
LocDesc = LocRec<LOCATION_DESC$>
|
||||
|
||||
Nomenclature = FMT(LocDesc,'T#34')
|
||||
NomenLine1 = FIELD(Nomenclature,@TM,1)
|
||||
NomenLine2 = FIELD(Nomenclature,@TM,2)
|
||||
|
||||
IF INDEX(LocCd,'-',1) THEN
|
||||
SubLocs = 1
|
||||
Row = FIELD(LocCd,'-',1)
|
||||
Bay = FIELD(LocCd,'-',2)
|
||||
Shelf = FIELD(LocCd,'-',3)
|
||||
Bin = FIELD(LocCd,'-',4)
|
||||
|
||||
END ELSE
|
||||
SubLocs = 0
|
||||
Row = ''
|
||||
Bay = ''
|
||||
Shelf = ''
|
||||
Bins = ''
|
||||
END
|
||||
|
||||
|
||||
|
||||
* Label is 1218 x 812 dots at 8dots/mm (203 dots/inch)
|
||||
* Leave periodic spaces in Label String - OIPrint interface wraps text on spaces and will cut off
|
||||
* the LabelString if there aren't any spaces. Printer Width needs to be set to 132 or greater
|
||||
|
||||
|
||||
LabelString = '^XA'
|
||||
LabelString := '^PW812' ;* Label 4" Width @203 dots/inch
|
||||
LabelString := '^LL812' ;* Label 4" Length
|
||||
|
||||
|
||||
LabelString := '^FO10,30^AF,52^FDWarehouse:^FS':CRLF$ ;* Warehouse Label
|
||||
LabelString := '^FO350,30^A0,50^FD':WhCd:'^FS':CRLF$ ;* Warehouse Data
|
||||
LabelString := '^FO10,120^GB760,0,4,B^FS':CRLF$ ;* Line under Warehouse
|
||||
|
||||
IF SubLocs THEN
|
||||
Labels = ''
|
||||
LabelCnt = 0
|
||||
|
||||
IF Row NE '' THEN
|
||||
LabelCnt += 1
|
||||
Labels<LabelCnt,1> = 'Row: '
|
||||
Labels<LabelCnt,2> = Row
|
||||
END
|
||||
|
||||
IF Bay NE '' THEN
|
||||
LabelCnt += 1
|
||||
Labels<LabelCnt,1> = 'Bay: '
|
||||
Labels<LabelCnt,2> = Bay
|
||||
END
|
||||
|
||||
IF Shelf NE '' THEN
|
||||
LabelCnt += 1
|
||||
Labels<LabelCnt,1> = 'Shelf: '
|
||||
Labels<LabelCnt,2> = Shelf
|
||||
END
|
||||
|
||||
IF Bin NE '' THEN
|
||||
LabelCnt += 1
|
||||
Labels<LabelCnt,1> = 'Bin: '
|
||||
Labels<LabelCnt,2> = Bin
|
||||
END
|
||||
|
||||
XInc = INT(812/LabelCnt)
|
||||
|
||||
FOR I = 1 TO LabelCnt
|
||||
DeltaX = 10 + XInc*(I-1)
|
||||
DeltaX2 = INT(XInc/2)
|
||||
Label = Labels<I,1>
|
||||
Value = Labels<I,2>
|
||||
|
||||
LabelString := '^FO':DeltaX:',': 150 :'^AF,52^FD':Label:'^FS':CRLF$
|
||||
|
||||
IF LabelCnt = 4 THEN
|
||||
LabelString := '^FO':DeltaX:',': 225 :'^A0,80^FD':Value:'^FS':CRLF$ ;* Smaller font for Row/Bay/Shelf/Bin information
|
||||
END ELSE
|
||||
LabelString := '^FO':DeltaX:',': 225 :'^A0,120^FD':Value:'^FS':CRLF$
|
||||
END
|
||||
|
||||
|
||||
NEXT I
|
||||
END ELSE
|
||||
LabelString := '^FO10,150^AF,40^FDLocation: ^FS':CRLF$
|
||||
LabelString := '^FO325,150^A0,150^FD':LocCd:'^FS':CRLF$
|
||||
END
|
||||
|
||||
LabelString := '^FO10,325^GB760,0,4,B^FS':CRLF$ ;* Line Under Location
|
||||
LabelString := '^FO10,365^AD,36^FD':NomenLine1:'^FS':CRLF$
|
||||
LabelString := '^FO10,435^Ad,36^FD':NomenLine2:'^FS':CRLF$
|
||||
|
||||
LabelString := '^FO0,500^GB1078,0,4,B^FS':CRLF$ ;* Line Under Nomenclature
|
||||
|
||||
BCString = WhCd:'*':LocCd
|
||||
SWAP '*' WITH '/J' IN BCString
|
||||
|
||||
BEGIN CASE
|
||||
CASE LEN(BCString) <= 10
|
||||
NarrowBarWidth = 4
|
||||
|
||||
CASE LEN(BCString) <= 20
|
||||
NarrowBarWidth = 3
|
||||
|
||||
CASE 1
|
||||
NarrowBarWidth = 1
|
||||
END CASE
|
||||
|
||||
LabelString := '^FO30,550^BY':NarrowBarWidth:',,^B3,N,150,Y,^FD':BCString:'^FS':CRLF$ ;* BarCode
|
||||
|
||||
LabelString := '^XZ':CRLF$
|
||||
|
||||
If Environment_Services('GetLabelPrintMethod') _EQC 'OIPI' then
|
||||
stat = Set_Printer('TEXT',LabelString)
|
||||
end else
|
||||
stat = Direct_Print('PRINT', LabelString)
|
||||
end
|
||||
|
||||
* * * * * * *
|
||||
OIPrint_Err:
|
||||
* * * * * * *
|
||||
|
||||
If Environment_Services('GetLabelPrintMethod') _EQC 'OIPI' then
|
||||
stat = Set_Printer("TERM")
|
||||
end else
|
||||
stat = Direct_Print('STOP')
|
||||
end
|
||||
|
||||
RETURN
|
Reference in New Issue
Block a user