Archive

Posts Tagged ‘Pick Pack Ship’

Syteline and BarTender Integration

December 16th, 2013 No comments

Starting from Syteline 8.03, the Pick, Pack, Ship function utilize BarTender for bar code label printing.  

Create label templates in Bartender.

The label template in Bartender need to use text file as database source.

Create a sample text file with data like following,

TC280847|123456789012345|DGM17ALS|03/03/2014

When we done, we should have data source like this,

We can then build whatever label file in Bartender.

Note for Syteline Pick, Pack, Ship

A text file is created that will be the basis of the labels created in BarTender.  This file is delivered with the SL install in the DevSetup folder.

The file should be labeled:

· BarTenderDatabaseFile.txt.

The contents of the file will be:

· ShipmentId|PackageId|Hazardous|RateCode|NMFC|MarksExcept|PackageType|PackageDesc|Weight|Item|Desc|UM|Qty|CustItem|Mfg|MfgItem|MfgItemDesc|Lot|Site|Whse|Location|CustNum|CustSeq|ConsigneeName

Create a task in Commander

In Commander, create a new task,

The command type need to be “Commander Script“.  All the details, such as what label template to use, what printer to print to and such, will be specify in the .dd file provided by Syteline.

In Trigger tab, specify the folder to monitor and the file type (.dd) to monitor.

Maintain the Template and Output Directory in Syteline

In Inventory Parameters form,

The output directory will be the place that Syteline drop the .dd file in, and Bartender Commander will monitor this directory for .dd files, it will then change them to .old for Bartender to process.

Enter the label printer on the Printers form

May also maintain a list of Label Template files in Package Label Templates form

Syteline Pick, Pack, Ship Label Printing

A form called “Print Package Label” can be accessed from “Pack Confirmation” or “Ship Master” form.

Print Package Labels

This form is used to select which package labels print jobs should be submitted for the labeling software to print.  Text files will be created and placed into the Output Directory specified on the Inventory Parameters

Printer – The printer that the label will be sent to.

Template Name – The filename of the label file

Copies – The number of copies of each label that should be printed.

Packages Exist – This checkbox will show whether or not packages have been defined for the shipment.

Print Labels By – This radio button set will determine how information will display in the grid if packages have been defined.

The core logic for putting together the .dd file is in Form script: CreateOutputFiles.

       Sub CreateOutputFiles()

Dim Filename As String

Dim Copies As String

Dim oCollection As IWSIDOCollection

Dim i As Integer

Dim Time As String

Dim TextFile(0 To 2) As String

Dim iDay As String

Dim iMonth As String

Dim iYear As String

Dim FileDate As String

Dim Lot As String

Dim Item As String

Dim Desc As String

Dim Qty As String

Dim UM As String

Dim CustItem As String

Dim Mfg As String

Dim MfgName As String

Dim MfgItem As String

Dim MfgItemDesc As String

Dim Package As String

Dim Hazardous As String

Dim RateCode As String

Dim NMFC As String

Dim MarksExcept As String

Dim PackageType As String

Dim PackageDesc As String

Dim Weight As String

On Error GoTo ErrorHandler

oCollection = ThisForm.PrimaryIDOCollection

If ThisForm.Components(“Printer”).ValidateData(True) = False Then

Exit Sub

End If

If ThisForm.Components(“LabelTemplateName”).ValidateData(True) = False Then

Exit Sub

End If

If ThisForm.Variables(“PackagesExistVar”).Value = “1” Then

If ThisForm.Components(“Copies”).ValidateData(True) = False Then

Exit Sub

End If

End If

If ThisForm.Variables(“PackagesExistVar”).Value = “0” Then

If ThisForm.Components(“NumberOfLabelsGridCol”).ValidateData(True) = False Then

Exit Sub

End If

End If

For i = 0 To oCollection.GetNumEntries – 1

If oCollection.GetObjectProperty(“UbSelect”, i) = “1” Then

If ThisForm.Variables(“PackagesExistVar”).Value = “1” Then

Copies = ThisForm.Variables(“CopiesVar”).Value

ElseIf ThisForm.Variables(“PackagesExistVar”).Value = “0” Then

Copies = oCollection.GetObjectProperty(“UbNumberOfLabels”, i)

Qty = oCollection.GetObjectProperty(“UbQtyPerLabel”, i)

Lot = oCollection.GetObjectProperty(“UbLot”, i)

Item = oCollection.GetObjectProperty(“UbItem”, i)

Desc = oCollection.GetObjectProperty(“UbItemDescription”, i)

UM = oCollection.GetObjectProperty(“UbUM”, i)

CustItem = oCollection.GetObjectProperty(“UbCustItem”, i)

Mfg = oCollection.GetObjectProperty(“UbManufacturerId”, i)

MfgName = oCollection.GetObjectProperty(“UbManufacturerName”, i)

MfgItem = oCollection.GetObjectProperty(“UbManufacturerItem”, i)

MfgItemDesc = oCollection.GetObjectProperty(“UbManufacturerItemDesc”, i)

Package = “”

Hazardous = “”

RateCode = “”

NMFC = “”

MarksExcept = “”

PackageType = “”

PackageDesc = “”

Weight = “”

End If

If ThisForm.Variables(“LabelsByVar”).Value = “L” Then

Lot = oCollection.GetObjectProperty(“UbLot”, i)

Item = oCollection.GetObjectProperty(“UbItem”, i)

Desc = oCollection.GetObjectProperty(“UbItemDescription”, i)

UM = oCollection.GetObjectProperty(“UbUM”, i)

Qty = oCollection.GetObjectProperty(“UbQty”, i)

CustItem = oCollection.GetObjectProperty(“UbCustItem”, i)

Mfg = oCollection.GetObjectProperty(“UbManufacturerId”, i)

MfgName = oCollection.GetObjectProperty(“UbManufacturerName”, i)

MfgItem = oCollection.GetObjectProperty(“UbManufacturerItem”, i)

MfgItemDesc = oCollection.GetObjectProperty(“UbManufacturerItemDesc”, i)

Package = oCollection.GetObjectProperty(“PackageId”, i)

Hazardous = oCollection.GetObjectProperty(“Hazard”, i)

RateCode = oCollection.GetObjectProperty(“RateCode”, i)

NMFC = oCollection.GetObjectProperty(“NMFC”, i)

MarksExcept = oCollection.GetObjectProperty(“MarksExcept”, i)

PackageType = oCollection.GetObjectProperty(“PackageType”, i)

PackageDesc = oCollection.GetObjectProperty(“Description”, i)

Weight = oCollection.GetObjectProperty(“Weight”, i)

ElseIf ThisForm.Variables(“LabelsByVar”).Value = “I” Then

Lot = “”

Item = oCollection.GetObjectProperty(“UbItem”, i)

Desc = oCollection.GetObjectProperty(“UbItemDescription”, i)

UM = oCollection.GetObjectProperty(“UbUM”, i)

Qty = oCollection.GetObjectProperty(“UbQty”, i)

CustItem = oCollection.GetObjectProperty(“UbCustItem”, i)

Mfg = oCollection.GetObjectProperty(“UbManufacturerId”, i)

MfgName = oCollection.GetObjectProperty(“UbManufacturerName”, i)

MfgItem = oCollection.GetObjectProperty(“UbManufacturerItem”, i)

MfgItemDesc = oCollection.GetObjectProperty(“UbManufacturerItemDesc”, i)

Package = oCollection.GetObjectProperty(“PackageId”, i)

Hazardous = oCollection.GetObjectProperty(“Hazard”, i)

RateCode = oCollection.GetObjectProperty(“RateCode”, i)

NMFC = oCollection.GetObjectProperty(“NMFC”, i)

MarksExcept = oCollection.GetObjectProperty(“MarksExcept”, i)

PackageType = oCollection.GetObjectProperty(“PackageType”, i)

PackageDesc = oCollection.GetObjectProperty(“Description”, i)

Weight = oCollection.GetObjectProperty(“Weight”, i)

ElseIf ThisForm.Variables(“LabelsByVar”).Value = “P” Then

Lot = “”

Item = “”

Desc = “”

UM = “”

Qty = “”

CustItem = “”

Mfg = “”

MfgName = “”

MfgItem = “”

MfgItemDesc = “”

Package = oCollection.GetObjectProperty(“PackageId”, i)

Hazardous = oCollection.GetObjectProperty(“Hazard”, i)

RateCode = oCollection.GetObjectProperty(“RateCode”, i)

NMFC = oCollection.GetObjectProperty(“NMFC”, i)

MarksExcept = oCollection.GetObjectProperty(“MarksExcept”, i)

PackageType = oCollection.GetObjectProperty(“PackageType”, i)

PackageDesc = oCollection.GetObjectProperty(“Description”, i)

Weight = oCollection.GetObjectProperty(“Weight”, i)

End If

iDay = CStr(Day(Now))

iMonth = CStr(Month(Now))

iYear = CStr(Year(Now))

Time = Format(Now, “hhmmss”)

FileDate = iMonth + iDay + iYear + Time

Filename = ThisForm.Variables(“OutputPathVar”).Value + “Infor” + ThisForm.Variables(“ShipmentVar”).Value + CStr(i) + FileDate + “.dd”

TextFile(0) = “%BTW% /AF=” & “””” & ThisForm.Variables(“TemplatePathVar”).Value & ThisForm.Variables(“FilenameVar”).Value & “””” & ” /PRN=” & “””” & _

ThisForm.Variables(“PrinterVar”).Value & “””” & ” /P /D=” & “””” & “<Trigger File Name>” & “””” & ” /C=” & Copies & “/R=3”

TextFile(1) = “%END%”

TextFile(2) = oCollection.GetObjectProperty(“ShipmentId”, i) & “|” & Package & “|” & Hazardous & “|” & RateCode & “|” & _

NMFC & “|” & MarksExcept & “|” & PackageType & “|” & PackageDesc & “|” & Weight & “|” & Item & “|” & _

Desc & “|” & UM & “|” & Qty & “|” & CustItem & “|” & Mfg & “|” & MfgName & “|” & MfgItem & “|” & _

MfgItemDesc & “|” & Lot & “|” & oCollection.GetObjectProperty(“UbSite”, i) & “|” & _

oCollection.GetObjectProperty(“UbWhse”, i) & “|” & oCollection.GetObjectProperty(“UbLocation”, i) & “|” & _

oCollection.GetObjectProperty(“UbCustNum”, i) & “|” & oCollection.GetObjectProperty(“UbCustSeq”, i) & “|” & _

oCollection.GetObjectProperty(“UbConsigneeName”, i)

System.IO.File.WriteAllLines(Filename, TextFile)

End If

Next i

ThisForm.CallGlobalScript(“MsgApp”, “Clear”, “Prompt”, “SuccessFailure”, _

“mI=CmdSucceeded”, “Process”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”)

Exit Sub

ErrorHandler:

ThisForm.CallGlobalScript(“MsgApp”, “Clear”, “Prompt”, “SuccessFailure”, _

“mI=CmdFailed”, “Process”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”)

End Sub

Custom Label Printing

We may use the similar logic to construct other custom label printing.

1) Need to define two form variables, and get the values during StdFormPredisply

SLShipmentPackages.LabelPathsExistSp( PARMS(RVAR V(TemplatePathVar), RVAR V(OutputPathVar)) )

2) Form method

      Sub CreateOutputFiles()

Dim Filename As String

Dim Copies As String

Dim oCollection As IWSIDOCollection

Dim i As Integer

Dim Time As String

Dim TextFile(0 To 2) As String

Dim iDay As String

Dim iMonth As String

Dim iYear As String

Dim FileDate As String

Dim Item As String

Dim VendorItem As String

Dim InDate As String

Dim Serial As String

On Error GoTo ErrorHandler

If ThisForm.Components(“Printer”).ValidateData(True) = False Then

Exit Sub

End If

If ThisForm.Components(“LabelTemplateName”).ValidateData(True) = False Then

Exit Sub

End If

If ThisForm.Components(“Copies”).ValidateData(True) = False Then

Exit Sub

End If

Copies = ThisForm.Variables(“CopiesVar”).Value

iDay = CStr(Day(Now))

iMonth = CStr(Month(Now))

iYear = CStr(Year(Now))

Time = Format(Now, “hhmmss”)

FileDate = iMonth + iDay + iYear + Time

Filename = ThisForm.Variables(“OutputPathVar”).Value + “ETE” + ThisForm.Variables(“Serial”).Value + FileDate + “.dd”

TextFile(0) = “%BTW% /AF=” & “””” & ThisForm.Variables(“TemplatePathVar”).Value & ThisForm.Variables(“FilenameVar”).Value & “””” & ” /PRN=” & “””” & _

ThisForm.Variables(“PrinterVar”).Value & “””” & ” /P /D=” & “””” & “<Trigger File Name>” & “””” & ” /C=” & Copies & “/R=3”

TextFile(1) = “%END%”

TextFile(2) = ThisForm.Variables(“Item”).Value  & “|” & ThisForm.Variables(“Serial”).Value & “|” & _

ThisForm.Variables(“VendorItem”).Value  & “|” & ThisForm.Variables(“InDate”).Value

System.IO.File.WriteAllLines(Filename, TextFile)

ThisForm.CallGlobalScript(“MsgApp”, “Clear”, “Prompt”, “SuccessFailure”, _

“mI=CmdSucceeded”, “Process”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”)

Exit Sub

ErrorHandler:

ThisForm.CallGlobalScript(“MsgApp”, “Clear”, “Prompt”, “SuccessFailure”, _

“mI=CmdFailed”, “Process”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”)

End Sub