|
|
@@ -115,69 +115,72 @@ Function CreateExportForSnailWorks(KitID) |
|
|
|
|
|
|
|
If objFSO.FileExists(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ExportFileName) Then:objFSO.DeleteFile(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ExportFileName):End If |
|
|
|
Dim objExportFile:set objExportFile = objFSO.CreateTextFile(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ExportFileName,2) |
|
|
|
objExportFile.Write("H") 'Record Type Required value must be = "H" (Header) |
|
|
|
objExportFile.Write(PadString("5.1",5)) 'Version Required value must be ="5.1" for current release |
|
|
|
objExportFile.Write(PadString("?",50)) 'UserId Required |
|
|
|
objExportFile.Write(PadString(JurisdictionRs("Name").Value,50)) 'Client Name Required (will create new subaccount if not already defined) |
|
|
|
objExportFile.Write(PadString("",50)) 'Parent Client Name Optional (use if 3-tier account structure) |
|
|
|
objExportFile.Write(PadString("Purple envelope - " &_ |
|
|
|
KitRs("JobNumber").Value,50)) 'Job Name Required |
|
|
|
objExportFile.Write(PadString("",50)) 'Job Description Optional |
|
|
|
objExportFile.Write(PadString("",50)) 'Split Name Optional – will default to ‘Default’ |
|
|
|
objExportFile.Write(PadString("",80)) 'Split Description Optional |
|
|
|
objExportFile.Write(PadString("L",1)) 'Piece Type Required L-Letters, C-Cards, F-Flats |
|
|
|
objExportFile.Write(PadString(Year(Now()) & "/" &_ |
|
|
|
Right("0" & Month(Now()), 2) & "/" & Right("0" & Day(Now()), 2),10)) 'MailDate Required (YYYY/MM/DD) |
|
|
|
objExportFile.Write(PadString("N",1)) 'UploadType Required N = New job, new split A = Append new split to existing job R = Replace existing split |
|
|
|
objExportFile.Write(PadString("",8)) 'TrackedQuantity Optional |
|
|
|
objExportFile.Write(PadString("",8)) 'PiecesMailed Optional – shown as Estimated Quantity |
|
|
|
objExportFile.Write(PadString("",10)) 'Target InHomeDateStart Optional (YYYY/MM/DD) |
|
|
|
objExportFile.Write(PadString("",10)) 'Target InHomeDateEnd Optional (YYYY/MM/DD) |
|
|
|
objExportFile.Write(PadString("",100)) 'ConfirmationEmail Optional |
|
|
|
objExportFile.Write(PadString("",9)) 'JobId (SW) Optional for previously created jobs SWJobId |
|
|
|
objExportFile.Write(PadString("",4)) 'SplitId (SW) Optional for previously created jobs SWJobId |
|
|
|
objExportFile.Write(PadString(Choice(IsNull(KitRs("InboundSTID")),"O","R"),1))'TypeofTracking Required Values: O- Outbound Only I-Inbound Only R-Round Trip |
|
|
|
objExportFile.Write(PadString("",11)) 'ReturnedPostalRoutingCode |
|
|
|
objExportFile.Write(PadString("",2)) 'ReportId1 |
|
|
|
objExportFile.Write(PadString("",255)) 'Report1Email |
|
|
|
objExportFile.Write(PadString("",2)) 'ReportId2 |
|
|
|
objExportFile.Write(PadString("",255)) 'Report2Email |
|
|
|
objExportFile.Write(vbCrLf) |
|
|
|
With objExportFile |
|
|
|
.Write("H") 'Record Type Required value must be = "H" (Header) |
|
|
|
.Write(PadString("5.1",5)) 'Version Required value must be ="5.1" for current release |
|
|
|
.Write(PadString("KCI",50)) 'UserId Required |
|
|
|
.Write(PadString(JurisdictionRs("Name").Value,50)) 'Client Name Required (will create new subaccount if not already defined) |
|
|
|
.Write(PadString("",50)) 'Parent Client Name Optional (use if 3-tier account structure) |
|
|
|
.Write(PadString("Purple envelope - " & KitRs("JobNumber").Value,50)) 'Job Name Required |
|
|
|
.Write(PadString("",50)) 'Job Description Optional |
|
|
|
.Write(PadString("",50)) 'Split Name Optional – will default to ‘Default’ |
|
|
|
.Write(PadString("",80)) 'Split Description Optional |
|
|
|
.Write(PadString("L",1)) 'Piece Type Required L-Letters, C-Cards, F-Flats |
|
|
|
.Write(PadString(Year(Now()) & "/" &_ |
|
|
|
Right("0" & Month(Now()), 2) & "/" & Right("0" & Day(Now()), 2),10)) 'MailDate Required (YYYY/MM/DD) |
|
|
|
.Write(PadString("N",1)) 'UploadType Required N = New job, new split A = Append new split to existing job R = Replace existing split |
|
|
|
.Write(PadString("",8)) 'TrackedQuantity Optional |
|
|
|
.Write(PadString("",8)) 'PiecesMailed Optional – shown as Estimated Quantity |
|
|
|
.Write(PadString("",10)) 'Target InHomeDateStart Optional (YYYY/MM/DD) |
|
|
|
.Write(PadString("",10)) 'Target InHomeDateEnd Optional (YYYY/MM/DD) |
|
|
|
.Write(PadString("",100)) 'ConfirmationEmail Optional |
|
|
|
.Write(PadString("",9)) 'JobId (SW) Optional for previously created jobs SWJobId |
|
|
|
.Write(PadString("",4)) 'SplitId (SW) Optional for previously created jobs SWJobId |
|
|
|
.Write(PadString(Choice(IsNull(KitRs("InboundSTID")),"O","R"),1)) 'TypeofTracking Required Values: O- Outbound Only I-Inbound Only R-Round Trip |
|
|
|
.Write(PadString("",11)) 'ReturnedPostalRoutingCode |
|
|
|
.Write(PadString("",2)) 'ReportId1 |
|
|
|
.Write(PadString("",255)) 'Report1Email |
|
|
|
.Write(PadString("",2)) 'ReportId2 |
|
|
|
.Write(PadString("",255)) 'Report2Email |
|
|
|
.Write(vbCrLf) |
|
|
|
While Not KitLabelsRs.EOF |
|
|
|
objExportFile.Write("D") 'RecordType Required value must be = “D” (Detail) |
|
|
|
objExportFile.Write(PadString("",20)) 'CustomerUniqueIdentifier Optional- any identifier you designate |
|
|
|
objExportFile.Write(PadString(KitLabelsRs("OutboundIMBDigits"),31)) 'IMB Required – Unencoded, numeric IMB |
|
|
|
objExportFile.Write(PadString((""),10)) 'Greeting Optional |
|
|
|
objExportFile.Write(PadString((""),50)) 'First Name Optional |
|
|
|
objExportFile.Write(PadString((""),2)) 'MI Optional |
|
|
|
objExportFile.Write(PadString((""),50)) 'Last Name Optional |
|
|
|
objExportFile.Write(PadString((""),10)) 'Suffix Optional |
|
|
|
objExportFile.Write(PadString((KitLabelsRs("CassADDRESS1").Value),100)) 'Full Name Optional |
|
|
|
objExportFile.Write(PadString((""),50)) 'Company Optional |
|
|
|
objExportFile.Write(PadString((""),50)) 'Title Optional |
|
|
|
objExportFile.Write(PadString(KitLabelsRs("CassADDRESS3").Value,128)) 'Address1 Optional |
|
|
|
objExportFile.Write(PadString(KitLabelsRs("CassADDRESS4").Value,128)) 'Address2 Optional |
|
|
|
objExportFile.Write(PadString(Left(KitLabelsRs("CassADDRESS5").Value, InStr(KitLabelsRs("CassADDRESS5").Value, ",") - 1),50)) 'City Optional |
|
|
|
objExportFile.Write(PadString(Mid(KitLabelsRs("CassADDRESS5").Value, InStr(KitLabelsRs("CassADDRESS5").Value, ",") + 2, 2),2)) 'State Optional |
|
|
|
objExportFile.Write PadString(Right(KitLabelsRs("CassADDRESS5").Value,11),11)'Zip Optional |
|
|
|
objExportFile.Write(PadString(KitRs("Jcode"),100)) 'UserDefined1 Optional - Summary fields only |
|
|
|
objExportFile.Write(PadString((""),100)) 'UserDefined2 Optional - Summary fields only |
|
|
|
objExportFile.Write(PadString((""),100)) 'UserDefined3 Optional - Summary fields only |
|
|
|
objExportFile.Write(PadString(KitLabelsRs("PRECINCT").Value & KitLabelsRs("BALLOT_NUMBER"),80)) 'UserDefinedIdentifier4 Optional – Allows for unique identifiers |
|
|
|
objExportFile.Write(PadString(KitLabelsRs("VOTERID").Value,80)) 'UserDefinedIdentifier5 Optional – Allows for unique identifiers |
|
|
|
objExportFile.Write(PadString((""),1)) 'SeedIndicator Optional - if true provide ‘Y’ |
|
|
|
objExportFile.Write(PadString((""),80)) 'InductionPoint Optional |
|
|
|
objExportFile.Write(PadString((""),10)) 'InductionDate Optional – Valid date format, ex. MM/DD/YYYY |
|
|
|
objExportFile.Write(PadString(Choice(IsNull(KitRs("InboundSTID")),"", _ |
|
|
|
KitLabelsRs("InBoundIMBDigits").Value),31)) 'InboundIMB Optional – numeric IMB for Round trip jobs only |
|
|
|
objExportFile.Write(PadString((""),24)) 'IMCB Optional – Container Barcode |
|
|
|
objExportFile.Write(PadString((""),24)) 'IMTB Optional – Tray Barcode |
|
|
|
objExportFile.Write(vbCrLf) |
|
|
|
.Write("D") 'RecordType Required value must be = “D” (Detail) |
|
|
|
.Write(PadString("",20)) 'CustomerUniqueIdentifier Optional- any identifier you designate |
|
|
|
.Write(PadString(KitLabelsRs("OutboundIMBDigits"),31)) 'IMB Required – Unencoded, numeric IMB |
|
|
|
.Write(PadString("",10)) 'Greeting Optional |
|
|
|
.Write(PadString("",50)) 'First Name Optional |
|
|
|
.Write(PadString("",2)) 'MI Optional |
|
|
|
.Write(PadString("",50)) 'Last Name Optional |
|
|
|
.Write(PadString("",10)) 'Suffix Optional |
|
|
|
.Write(PadString((KitLabelsRs("CassADDRESS1").Value),100)) 'Full Name Optional |
|
|
|
.Write(PadString("",50)) 'Company Optional |
|
|
|
.Write(PadString("",50)) 'Title Optional |
|
|
|
.Write(PadString(KitLabelsRs("CassADDRESS3").Value,128)) 'Address1 Optional |
|
|
|
.Write(PadString(KitLabelsRs("CassADDRESS4").Value,128)) 'Address2 Optional |
|
|
|
.Write(PadString(Left(KitLabelsRs("CassADDRESS5").Value, _ |
|
|
|
InStr(KitLabelsRs("CassADDRESS5").Value, ",") - 1),50)) 'City Optional |
|
|
|
.Write(PadString(Mid(KitLabelsRs("CassADDRESS5").Value, _ |
|
|
|
InStr(KitLabelsRs("CassADDRESS5").Value, ",") + 2, 2),2)) 'State Optional |
|
|
|
.Write PadString(Right(KitLabelsRs("CassADDRESS5").Value,11),11) 'Zip Optional |
|
|
|
.Write(PadString(KitRs("Jcode"),100)) 'UserDefined1 Optional - Summary fields only |
|
|
|
.Write(PadString("",100)) 'UserDefined2 Optional - Summary fields only |
|
|
|
.Write(PadString("",100)) 'UserDefined3 Optional - Summary fields only |
|
|
|
.Write(PadString(KitLabelsRs("PRECINCT").Value &_ |
|
|
|
KitLabelsRs("BALLOT_NUMBER"),80)) 'UserDefinedIdentifier4 Optional – Allows for unique identifiers |
|
|
|
.Write(PadString(KitLabelsRs("VOTERID").Value,80)) 'UserDefinedIdentifier5 Optional – Allows for unique identifiers |
|
|
|
.Write(PadString("",1)) 'SeedIndicator Optional - if true provide ‘Y’ |
|
|
|
.Write(PadString("",80)) 'InductionPoint Optional |
|
|
|
.Write(PadString("",10)) 'InductionDate Optional – Valid date format, ex. MM/DD/YYYY |
|
|
|
.Write(PadString(Choice(IsNull(KitRs("InboundSTID")),"", _ |
|
|
|
KitLabelsRs("InBoundIMBDigits").Value),31)) 'InboundIMB Optional – numeric IMB for Round trip jobs only |
|
|
|
.Write(PadString("",24)) 'IMCB Optional – Container Barcode |
|
|
|
.Write(PadString("",24)) 'IMTB Optional – Tray Barcode |
|
|
|
.Write(vbCrLf) |
|
|
|
KitLabelsRs.MoveNext |
|
|
|
Wend |
|
|
|
|
|
|
|
|
|
|
|
objExportFile.Close |
|
|
|
.Close |
|
|
|
End With |
|
|
|
oConn.Execute("UPDATE KIT SET [Status] ='Ready to Proof',[ExportedToSnailWorks] =#" & Now() & "# WHERE [ID] =" & KitID & ";") |
|
|
|
If KitRs.State = 1 Then:KitRs.Close:End If |
|
|
|
If KitLabelsRs.State = 1 Then:KitLabelsRs.Close: End If |
|
|
|