|
@@ -62,7 +62,7 @@ Function ExportInkjetFile(KitID) |
|
|
" KitLabels.INBOUNDIMBPNG, KitLabels.SetNumber" &_ |
|
|
" KitLabels.INBOUNDIMBPNG, KitLabels.SetNumber" &_ |
|
|
" FROM InkjetRecords" &_ |
|
|
" FROM InkjetRecords" &_ |
|
|
" LEFT JOIN [KitLabels] ON InkjetRecords.KitLabelID = KitLabels.ID" & _ |
|
|
" LEFT JOIN [KitLabels] ON InkjetRecords.KitLabelID = KitLabels.ID" & _ |
|
|
" WHERE InkjetRecords.KitID =" & KitID & " Order by PRECINCT & Clng(BALLOT_NUMBER) Desc;") |
|
|
|
|
|
|
|
|
" WHERE InkjetRecords.KitID =" & KitID & " Order by PRECINCT Desc, Clng(BALLOT_NUMBER) Desc;") |
|
|
Dim JurisdictionRs:Set JurisdictionRs = oConn.Execute("SELECT * FROM Jurisdiction WHERE JCode ='" & KitRs("Jcode").Value & "';") |
|
|
Dim JurisdictionRs:Set JurisdictionRs = oConn.Execute("SELECT * FROM Jurisdiction WHERE JCode ='" & KitRs("Jcode").Value & "';") |
|
|
Dim ContactRs:Set ContactRs = oConn.Execute("SELECT * FROM Contacts WHERE [JURISCODE] ='" & KitRs("Jcode").Value & "';") |
|
|
Dim ContactRs:Set ContactRs = oConn.Execute("SELECT * FROM Contacts WHERE [JURISCODE] ='" & KitRs("Jcode").Value & "';") |
|
|
Dim ExportFileName:ExportFileName = objFSO.GetBaseName(KitRs("Filename")) & ".csv" |
|
|
Dim ExportFileName:ExportFileName = objFSO.GetBaseName(KitRs("Filename")) & ".csv" |
|
@@ -228,8 +228,8 @@ Function CreateExportForSnailWorks(KitID) |
|
|
Dim objExportFile:set objExportFile = objFSO.CreateTextFile(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ExportFileName,2) |
|
|
Dim objExportFile:set objExportFile = objFSO.CreateTextFile(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ExportFileName,2) |
|
|
With objExportFile |
|
|
With objExportFile |
|
|
.Write("""H"",") 'Record Type Required value must be = "H" (Header) |
|
|
.Write("""H"",") 'Record Type Required value must be = "H" (Header) |
|
|
.Write(Truncate("5.1",5)) 'Version Required value must be ="5.1" for current release |
|
|
|
|
|
.Write(Truncate("KCI",50)) 'UserId Required |
|
|
|
|
|
|
|
|
.Write(Truncate("5.2",5)) 'Version Required value must be ="5.2" for current release |
|
|
|
|
|
.Write(Truncate("KCIHotFolder2024FTPUser",50)) 'UserId Required |
|
|
.Write(Truncate(KitRs("Jcode").Value,50)) 'Client Name Required (will create new subaccount if not already defined) - We decideded to make this the juriscode |
|
|
.Write(Truncate(KitRs("Jcode").Value,50)) 'Client Name Required (will create new subaccount if not already defined) - We decideded to make this the juriscode |
|
|
.Write(Truncate("",50)) 'Parent Client Name Optional (use if 3-tier account structure) |
|
|
.Write(Truncate("",50)) 'Parent Client Name Optional (use if 3-tier account structure) |
|
|
.Write(Truncate("Purple envelope - " & KitRs("JobNumber").Value,50)) 'Job Name Required |
|
|
.Write(Truncate("Purple envelope - " & KitRs("JobNumber").Value,50)) 'Job Name Required |
|
@@ -244,7 +244,7 @@ Function CreateExportForSnailWorks(KitID) |
|
|
.Write(Truncate("",8)) 'PiecesMailed Optional – shown as Estimated Quantity |
|
|
.Write(Truncate("",8)) 'PiecesMailed Optional – shown as Estimated Quantity |
|
|
.Write(Truncate("",10)) 'Target InHomeDateStart Optional (YYYY/MM/DD) |
|
|
.Write(Truncate("",10)) 'Target InHomeDateStart Optional (YYYY/MM/DD) |
|
|
.Write(Truncate("",10)) 'Target InHomeDateEnd Optional (YYYY/MM/DD) |
|
|
.Write(Truncate("",10)) 'Target InHomeDateEnd Optional (YYYY/MM/DD) |
|
|
.Write(Truncate("",100)) 'ConfirmationEmail Optional |
|
|
|
|
|
|
|
|
.Write(Truncate("danielc@kentcommunications.com",100)) 'ConfirmationEmail Optional |
|
|
.Write(Truncate("",9)) 'JobId (SW) Optional for previously created jobs SWJobId |
|
|
.Write(Truncate("",9)) 'JobId (SW) Optional for previously created jobs SWJobId |
|
|
.Write(Truncate("",4)) 'SplitId (SW) Optional for previously created jobs SWJobId |
|
|
.Write(Truncate("",4)) 'SplitId (SW) Optional for previously created jobs SWJobId |
|
|
.Write(Truncate(Choice(IsNull(KitRs("InboundSTID")),"O","R"),1)) 'TypeofTracking Required Values: O- Outbound Only I-Inbound Only R-Round Trip |
|
|
.Write(Truncate(Choice(IsNull(KitRs("InboundSTID")),"O","R"),1)) 'TypeofTracking Required Values: O- Outbound Only I-Inbound Only R-Round Trip |
|
@@ -315,24 +315,31 @@ Dim KitLabelRs |
|
|
Dim Mid:Mid = GetSetting("MailingID") |
|
|
Dim Mid:Mid = GetSetting("MailingID") |
|
|
Dim Step : If KitRs("InboundSTID") <> "" Then : Step = 2 : Else Step = 1 |
|
|
Dim Step : If KitRs("InboundSTID") <> "" Then : Step = 2 : Else Step = 1 |
|
|
serialStart = PadLeft(serialStart + CLng(Counter),9,"0") |
|
|
serialStart = PadLeft(serialStart + CLng(Counter),9,"0") |
|
|
|
|
|
Dim oRsKitLabels : Set oRsKitLabels = CreateObject("ADODB.Recordset"):oRsKitLabels.Open "Select * FROM [KitLabels] Where KitID =" & KitID & ";",oConn,3,3 |
|
|
While Not InkjetRs.EOF |
|
|
While Not InkjetRs.EOF |
|
|
|
|
|
|
|
|
|
|
|
oRsKitLabels.AddNew |
|
|
|
|
|
KitLabelID = oRsKitLabels("ID").value |
|
|
If Step = 1 Then |
|
|
If Step = 1 Then |
|
|
oConn.Execute("INSERT INTO KitLabels (KitID,OutboundSerial,OutboundIMBDigits) " &_ |
|
|
|
|
|
"VALUES(" & KitID & ",'" & serialStart & "','" & KitRs("OutBoundSTID").Value & Mid & serialStart & "');") |
|
|
|
|
|
|
|
|
|
|
|
Else |
|
|
|
|
|
oConn.Execute "INSERT INTO KitLabels (KitID,OutboundSerial,InBoundSerial,OutboundIMBDigits,InBoundIMBDigits) " &_ |
|
|
|
|
|
"VALUES(" & KitID & ",'" & serialStart & "','" & serialStart + 1 & "','" & KitRs("OutBoundSTID").Value & Mid & serialStart & "','" & KitRs("InboundSTID").Value & serialStart + 1 & Jcode & "');" |
|
|
|
|
|
|
|
|
oRsKitLabels("KitID") = KitID |
|
|
|
|
|
oRsKitLabels("OutboundSerial") = serialStart |
|
|
|
|
|
oRsKitLabels("OutboundIMBDigits") = KitRs("OutBoundSTID").Value & Mid & serialStart |
|
|
|
|
|
Else |
|
|
|
|
|
oRsKitLables.AddNew |
|
|
|
|
|
oRsKitLabels("KitID") = KitID |
|
|
|
|
|
oRsKitLabels("OutboundSerial") = serialStart |
|
|
|
|
|
oRsKitLables("InBoundSerial") = serialStart + 1 |
|
|
|
|
|
oRsKitLabels("OutboundIMBDigits") = KitRs("OutBoundSTID").Value & Mid & serialStart |
|
|
|
|
|
oRsKitLables("InBoundIMBDigits") = KitRs("InboundSTID").Value & serialStart + 1 & Jcode |
|
|
End If |
|
|
End If |
|
|
Set KitLabelRs = oConn.Execute("SELECT TOP 1 [ID] FROM KitLabels ORDER BY ID DESC"):KitLabelID = KitLabelRs("ID").Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
oRsKitLabels.Update |
|
|
oConn.Execute("UPDATE InkjetRecords Set [KitLabelID]=" & KitLabelID & " WHERE ID=" & InkjetRs("ID") & ";") |
|
|
oConn.Execute("UPDATE InkjetRecords Set [KitLabelID]=" & KitLabelID & " WHERE ID=" & InkjetRs("ID") & ";") |
|
|
Counter = Counter + Step |
|
|
Counter = Counter + Step |
|
|
serialStart = serialStart + Step |
|
|
serialStart = serialStart + Step |
|
|
|
|
|
|
|
|
InkjetRs.MoveNext |
|
|
InkjetRs.MoveNext |
|
|
Wend |
|
|
Wend |
|
|
|
|
|
oRsKitLabels.Update |
|
|
|
|
|
oRsKitLabels.Close |
|
|
oConn.Execute("UPDATE Settings Set [Value]='" & serialOffset + Counter & "' WHERE [Name] = 'SerialOffset';") |
|
|
oConn.Execute("UPDATE Settings Set [Value]='" & serialOffset + Counter & "' WHERE [Name] = 'SerialOffset';") |
|
|
oConn.Execute("UPDATE Kit Set [Status]='Ready For Export', LabelsPrinted=#" & Now() & "# WHERE [ID] =" & KitID &";") |
|
|
oConn.Execute("UPDATE Kit Set [Status]='Ready For Export', LabelsPrinted=#" & Now() & "# WHERE [ID] =" & KitID &";") |
|
|
oConn.Close |
|
|
oConn.Close |
|
|