Added set to data and pages and report Co-authored-by: Daniel Covington <danielc@kentcommunications.com>pull/2/head
@@ -17,9 +17,10 @@ Class KitLabelsModel_Class | |||||
Public InBoundIMBDigits '106 | Public InBoundIMBDigits '106 | ||||
Public OutboundIMBPNG | Public OutboundIMBPNG | ||||
Public INBOUNDIMBPNG | Public INBOUNDIMBPNG | ||||
Public SetNumber | |||||
Private Sub Class_Initialize | Private Sub Class_Initialize | ||||
'ValidateExitsts Me, "","" | 'ValidateExitsts Me, "","" | ||||
Class_Get_Properties = Array("ID, KitId, OutboundSerial, InBoundSerial, OutboundIMB, InBoundIMB, OutboundIMBDigits, InBoundIMBDigits,OutboundIMBPNG,INBOUNDIMBPNG") | |||||
Class_Get_Properties = Array("ID, KitId, OutboundSerial, InBoundSerial, OutboundIMB, InBoundIMB, OutboundIMBDigits, InBoundIMBDigits,OutboundIMBPNG,INBOUNDIMBPNG,SetNumber") | |||||
End Sub | End Sub | ||||
End CLass | End CLass | ||||
@@ -31,7 +32,7 @@ End CLass | |||||
Class KitLabelsRepository_Class | Class KitLabelsRepository_Class | ||||
Public Function FindByID(ID) | Public Function FindByID(ID) | ||||
dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG FROM [KitLabels] WHERE ID = ?" | |||||
dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG,[SetNumber] FROM [KitLabels] WHERE ID = ?" | |||||
dim rs : set rs = DAL.Query(sql,ID) | dim rs : set rs = DAL.Query(sql,ID) | ||||
If rs.EOF then | If rs.EOF then | ||||
Err.Raise 1, "KitLabelsRepository_Class", KitLabelsNotFoundException("ID", ID) | Err.Raise 1, "KitLabelsRepository_Class", KitLabelsNotFoundException("ID", ID) | ||||
@@ -45,7 +46,7 @@ Class KitLabelsRepository_Class | |||||
End Function | End Function | ||||
Public Function Find(where_kvarray, order_string_or_array) | Public Function Find(where_kvarray, order_string_or_array) | ||||
dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG FROM [KitLabels]" | |||||
dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG, [SetNumber] FROM [KitLabels]" | |||||
If Not IsEmpty(where_kvarray) then | If Not IsEmpty(where_kvarray) then | ||||
sql = sql & " WHERE " | sql = sql & " WHERE " | ||||
@@ -78,7 +79,7 @@ Class KitLabelsRepository_Class | |||||
End Function | End Function | ||||
Public Function FindPaged(where_kvarray, order_string_or_array, per_page, page_num, ByRef page_count, ByRef record_count) | Public Function FindPaged(where_kvarray, order_string_or_array, per_page, page_num, ByRef page_count, ByRef record_count) | ||||
dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG FROM [KitLabels]" | |||||
dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG, [SetNumber] FROM [KitLabels]" | |||||
If Not IsEmpty(where_kvarray) then | If Not IsEmpty(where_kvarray) then | ||||
sql = sql & " WHERE " | sql = sql & " WHERE " | ||||
@@ -120,7 +121,7 @@ Class KitLabelsRepository_Class | |||||
End Function | End Function | ||||
Public Function SearchTablePaged(where_kvarray, order_string_or_array, per_page, page_num, ByRef page_count, ByRef record_count) | Public Function SearchTablePaged(where_kvarray, order_string_or_array, per_page, page_num, ByRef page_count, ByRef record_count) | ||||
dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG FROM [KitLabels]" | |||||
dim sql : sql = "Select [ID], [KitId], [OutboundSerial], [InBoundSerial], [OutboundIMB], [InBoundIMB], [OutboundIMBDigits], [InBoundIMBDigits],OutboundIMBPNG,INBOUNDIMBPNG, [SetNumber] FROM [KitLabels]" | |||||
If Not IsEmpty(where_kvarray) then | If Not IsEmpty(where_kvarray) then | ||||
sql = sql & " WHERE " | sql = sql & " WHERE " | ||||
@@ -198,10 +199,13 @@ Class KitLabelsRepository_Class | |||||
Dim SerialNumberStart:SerialNumberStart = SettingsRepository.Find(Array("Name =?","SerialNumberStart"),empty).pop().Value | Dim SerialNumberStart:SerialNumberStart = SettingsRepository.Find(Array("Name =?","SerialNumberStart"),empty).pop().Value | ||||
Dim serialOffset:serialOffset = SettingsRepository.Find(Array("Name =?","SerialOffset"),empty).pop().Value | Dim serialOffset:serialOffset = SettingsRepository.Find(Array("Name =?","SerialOffset"),empty).pop().Value | ||||
Dim SerialStart:SerialStart = CLng(SerialNumberStart) + CLng(serialOffset) | Dim SerialStart:SerialStart = CLng(SerialNumberStart) + CLng(serialOffset) | ||||
dim i | |||||
dim i,s | |||||
s = 1 | |||||
for i = 0 to (Amount * 2) - 2 Step 2 | for i = 0 to (Amount * 2) - 2 Step 2 | ||||
dim NewKitLabel : set NewKitLabel = new KitLabelsModel_Class | dim NewKitLabel : set NewKitLabel = new KitLabelsModel_Class | ||||
NewKitLabel.KitId = KitId | NewKitLabel.KitId = KitId | ||||
NewKitLabel.SetNumber = s | |||||
s = s + 1 | |||||
NewKitLabel.OutboundSerial = PadLeft(SerialStart + i,9,"0") | NewKitLabel.OutboundSerial = PadLeft(SerialStart + i,9,"0") | ||||
NewKitLabel.InBoundSerial = PadLeft(SerialStart + i + 1,9,"0") | NewKitLabel.InBoundSerial = PadLeft(SerialStart + i + 1,9,"0") | ||||
NewKitLabel.OutboundIMBDigits ="00716" & MailingID & NewKitLabel.OutboundSerial & "000000000" | NewKitLabel.OutboundIMBDigits ="00716" & MailingID & NewKitLabel.OutboundSerial & "000000000" | ||||
@@ -237,8 +241,9 @@ Class KitLabelsRepository_Class | |||||
"[OutboundIMBDigits]," &_ | "[OutboundIMBDigits]," &_ | ||||
"[InBoundIMBDigits]," &_ | "[InBoundIMBDigits]," &_ | ||||
"[OutboundIMBPNG]," &_ | "[OutboundIMBPNG]," &_ | ||||
"[INBOUNDIMBPNG])" &_ | |||||
"VALUES (?,?,?,?,?,?,?,?,?)" | |||||
"[INBOUNDIMBPNG]," &_ | |||||
"[SetNumber])" &_ | |||||
"VALUES (?,?,?,?,?,?,?,?,?,?)" | |||||
DAL.Execute sql, Array(model.KitId, _ | DAL.Execute sql, Array(model.KitId, _ | ||||
model.OutboundSerial, _ | model.OutboundSerial, _ | ||||
model.InBoundSerial, _ | model.InBoundSerial, _ | ||||
@@ -247,7 +252,8 @@ Class KitLabelsRepository_Class | |||||
model.OutboundIMBDigits, _ | model.OutboundIMBDigits, _ | ||||
model.InBoundIMBDigits, _ | model.InBoundIMBDigits, _ | ||||
model.OutboundIMBPNG, _ | model.OutboundIMBPNG, _ | ||||
model.INBOUNDIMBPNG) | |||||
model.INBOUNDIMBPNG, _ | |||||
model.SetNumber) | |||||
sql = "SELECT TOP 1 ID FROM [KitLabels] ORDER BY ID DESC" | sql = "SELECT TOP 1 ID FROM [KitLabels] ORDER BY ID DESC" | ||||
dim rs : set rs = DAL.Query(sql, empty) | dim rs : set rs = DAL.Query(sql, empty) | ||||
model.ID = rs("ID") | model.ID = rs("ID") | ||||
@@ -262,7 +268,7 @@ Class KitLabelsRepository_Class | |||||
"[InBoundIMB] = ?," &_ | "[InBoundIMB] = ?," &_ | ||||
"[OutboundIMBDigits] = ?," &_ | "[OutboundIMBDigits] = ?," &_ | ||||
"[InBoundIMBDigits] = ?," &_ | "[InBoundIMBDigits] = ?," &_ | ||||
"OutboundIMBPNG,INBOUNDIMBPNG)" &_ | |||||
"OutboundIMBPNG,INBOUNDIMBPNG,[SetNumber])" &_ | |||||
" WHERE [ID] = ?" | " WHERE [ID] = ?" | ||||
DAL.Execute sql, Array(model.KitId, _ | DAL.Execute sql, Array(model.KitId, _ | ||||
@@ -274,6 +280,7 @@ Class KitLabelsRepository_Class | |||||
model.InBoundIMBDigits, _ | model.InBoundIMBDigits, _ | ||||
model.OutboundIMBPNG, _ | model.OutboundIMBPNG, _ | ||||
model.INBOUNDIMBPNG, _ | model.INBOUNDIMBPNG, _ | ||||
model.SetNumber, _ | |||||
model.ID) | model.ID) | ||||
End Sub | End Sub | ||||
@@ -25,6 +25,7 @@ Class Create_ViewModel_Class | |||||
Public InBoundIMBDigits | Public InBoundIMBDigits | ||||
Public OutboundIMBPNG | Public OutboundIMBPNG | ||||
Public INBOUNDIMBPNG | Public INBOUNDIMBPNG | ||||
Public SetNumber | |||||
End Class | End Class | ||||
Class Delete_ViewModel_Class | Class Delete_ViewModel_Class | ||||
@@ -19,6 +19,7 @@ | |||||
<tr> | <tr> | ||||
<th></th> | <th></th> | ||||
<th style="text-align: left">ID</th> | <th style="text-align: left">ID</th> | ||||
<th style="text-align: left">Set Number</th> | |||||
<th style="text-align: left">KitId</th> | <th style="text-align: left">KitId</th> | ||||
<th style="text-align: left">OutboundSerial</th> | <th style="text-align: left">OutboundSerial</th> | ||||
<th style="text-align: left">InBoundSerial</th> | <th style="text-align: left">InBoundSerial</th> | ||||
@@ -41,6 +42,7 @@ | |||||
<%= HTML.LinkToExt("<i class='bi bi-search'></i>", "KitLabels", "Edit", Array("Id", KitLabels.ID), Array("class", "btn btn-primary")) %> | <%= HTML.LinkToExt("<i class='bi bi-search'></i>", "KitLabels", "Edit", Array("Id", KitLabels.ID), Array("class", "btn btn-primary")) %> | ||||
</td> | </td> | ||||
<td><% = H(KitLabels.ID) %></td> | <td><% = H(KitLabels.ID) %></td> | ||||
<td><% = H(KitLabels.SetNumber) %></td> | |||||
<td><% = H(KitLabels.KitId) %></td> | <td><% = H(KitLabels.KitId) %></td> | ||||
<td><% = H(KitLabels.OutboundSerial) %></td> | <td><% = H(KitLabels.OutboundSerial) %></td> | ||||
<td><% = H(KitLabels.InBoundSerial) %></td> | <td><% = H(KitLabels.InBoundSerial) %></td> | ||||
@@ -34,6 +34,7 @@ | |||||
<th style="text-align: left">InBoundIMBDigits</th> | <th style="text-align: left">InBoundIMBDigits</th> | ||||
<th style="text-align: left">OutboundIMB</th> | <th style="text-align: left">OutboundIMB</th> | ||||
<th style="text-align: left">InBoundIMB</th> | <th style="text-align: left">InBoundIMB</th> | ||||
<th style="text-align: left">SetNumber</th> | |||||
<th></th> | <th></th> | ||||
</tr> | </tr> | ||||
</thead> | </thead> | ||||
@@ -56,6 +57,7 @@ | |||||
<td><% = H(KitLabels.InBoundIMBDigits) %></td> | <td><% = H(KitLabels.InBoundIMBDigits) %></td> | ||||
<td><img src='data:image/png;base64, <% = KitLabels.OutboundIMBPNG%>' alt='Barcode'</td> | <td><img src='data:image/png;base64, <% = KitLabels.OutboundIMBPNG%>' alt='Barcode'</td> | ||||
<td><img src='data:image/png;base64, <% = KitLabels.INBOUNDIMBPNG %>' alt='Barcode'</td> | <td><img src='data:image/png;base64, <% = KitLabels.INBOUNDIMBPNG %>' alt='Barcode'</td> | ||||
<td><% = H(KitLabels.SetNumber) %></td> | |||||
</tr> | </tr> | ||||
<% Wend %> | <% Wend %> | ||||
</tbody> | </tbody> | ||||
@@ -1,5 +1,11 @@ | |||||
object TRpReport | object TRpReport | ||||
PageHeight = 8120 | |||||
PageWidth = 5742 | |||||
PageBackColor = 16777215 | PageBackColor = 16777215 | ||||
LeftMargin = 270 | |||||
TopMargin = 360 | |||||
RightMargin = 270 | |||||
BottomMargin = 360 | |||||
SubReports = < | SubReports = < | ||||
item | item | ||||
SubReport = TRpSubReport0 | SubReport = TRpSubReport0 | ||||
@@ -21,9 +27,10 @@ object TRpReport | |||||
SQL = | SQL = | ||||
'SELECT KitLabels.OutboundSerial, KitLabels.OutboundIMB, KitLabel' + | 'SELECT KitLabels.OutboundSerial, KitLabels.OutboundIMB, KitLabel' + | ||||
's.InBoundIMB, Kit.Jcode, Jurisdiction.Name AS Jurisdiction, Juri' + | 's.InBoundIMB, Kit.Jcode, Jurisdiction.Name AS Jurisdiction, Juri' + | ||||
'sdiction.Mailing_Address, 1 AS Num'#13#10'FROM (KitLabels INNER JOIN K' + | |||||
'it ON KitLabels.KitId = Kit.ID) INNER JOIN Jurisdiction ON Kit.J' + | |||||
'code = Jurisdiction.JCode'#13#10'WHERE KitLabels.KITId=pbKITID;' | |||||
'sdiction.Mailing_Address,KitLabels.SetNumber'#13#10'FROM (KitLabels IN' + | |||||
'NER JOIN Kit ON KitLabels.KitId = Kit.ID) INNER JOIN Jurisdictio' + | |||||
'n ON Kit.Jcode = Jurisdiction.JCode'#13#10'WHERE KitLabels.KITId=pbKIT' + | |||||
'ID'#13#10'ORDER BY SetNumber;' | |||||
end> | end> | ||||
DatabaseInfo = < | DatabaseInfo = < | ||||
item | item | ||||
@@ -44,7 +51,7 @@ object TRpReport | |||||
item | item | ||||
Name = 'PBKITID' | Name = 'PBKITID' | ||||
AllowNulls = False | AllowNulls = False | ||||
Value = '72' | |||||
Value = '84' | |||||
Datasets.Strings = ( | Datasets.Strings = ( | ||||
'LABLES' | 'LABLES' | ||||
'KITLABELS') | 'KITLABELS') | ||||
@@ -56,6 +63,7 @@ object TRpReport | |||||
ErrorMessage = '' | ErrorMessage = '' | ||||
Validation = '' | Validation = '' | ||||
end> | end> | ||||
TwoPass = True | |||||
StreamFormat = rpStreamText | StreamFormat = rpStreamText | ||||
ReportAction = [] | ReportAction = [] | ||||
Type1Font = poHelvetica | Type1Font = poHelvetica | ||||
@@ -66,11 +74,11 @@ object TRpReport | |||||
item | item | ||||
Section = TRpSection0 | Section = TRpSection0 | ||||
end> | end> | ||||
Alias = 'LABLES' | |||||
Alias = 'KITLABELS' | |||||
end | end | ||||
object TRpSection0: TRpSection | object TRpSection0: TRpSection | ||||
Width = 11520 | |||||
Height = 2057 | |||||
Width = 12240 | |||||
Height = 2160 | |||||
SubReport = TRpSubReport0 | SubReport = TRpSubReport0 | ||||
ChangeBool = False | ChangeBool = False | ||||
PageRepeat = False | PageRepeat = False | ||||
@@ -95,6 +103,21 @@ object TRpReport | |||||
end | end | ||||
item | item | ||||
Component = TRpExpression2 | Component = TRpExpression2 | ||||
end | |||||
item | |||||
Component = TRpLabel0 | |||||
end | |||||
item | |||||
Component = TRpLabel1 | |||||
end | |||||
item | |||||
Component = TRpLabel2 | |||||
end | |||||
item | |||||
Component = TRpExpression3 | |||||
end | |||||
item | |||||
Component = TRpExpression4 | |||||
end> | end> | ||||
ExternalTable = 'REPMAN_REPORTS' | ExternalTable = 'REPMAN_REPORTS' | ||||
ExternalField = 'REPORT' | ExternalField = 'REPORT' | ||||
@@ -987,6 +1010,7 @@ object TRpReport | |||||
PosY = 120 | PosY = 120 | ||||
Type1Font = poHelvetica | Type1Font = poHelvetica | ||||
FontSize = 7 | FontSize = 7 | ||||
Alignment = 2 | |||||
AutoExpand = False | AutoExpand = False | ||||
AutoContract = False | AutoContract = False | ||||
ExportPosition = 0 | ExportPosition = 0 | ||||
@@ -1027,4 +1051,95 @@ object TRpReport | |||||
AgIniValue = '0' | AgIniValue = '0' | ||||
ExportExpression = '' | ExportExpression = '' | ||||
end | end | ||||
object TRpLabel0: TRpLabel | |||||
Width = 1440 | |||||
Height = 240 | |||||
PosX = 5760 | |||||
PosY = 360 | |||||
Type1Font = poHelvetica | |||||
FontSize = 7 | |||||
Alignment = 2 | |||||
PrintCondition = '' | |||||
DoBeforePrint = '' | |||||
DoAfterPrint = '' | |||||
WFontName = 'Arial' | |||||
LFontName = 'Helvetica' | |||||
WideText = '5/7/2024' | |||||
end | |||||
object TRpLabel1: TRpLabel | |||||
Width = 1440 | |||||
Height = 240 | |||||
PosX = 3240 | |||||
PosY = 1200 | |||||
Type1Font = poHelvetica | |||||
FontSize = 11 | |||||
Alignment = 2 | |||||
PrintCondition = '' | |||||
DoBeforePrint = '' | |||||
DoAfterPrint = '' | |||||
WFontName = 'Arial' | |||||
LFontName = 'Helvetica' | |||||
WideText = 'Outbound' | |||||
end | |||||
object TRpLabel2: TRpLabel | |||||
Width = 1440 | |||||
Height = 300 | |||||
PosX = 2820 | |||||
PosY = 1620 | |||||
Type1Font = poHelvetica | |||||
FontSize = 11 | |||||
Alignment = 2 | |||||
PrintCondition = '' | |||||
DoBeforePrint = '' | |||||
DoAfterPrint = '' | |||||
WFontName = 'Arial' | |||||
LFontName = 'Helvetica' | |||||
WideText = 'Inbound' | |||||
end | |||||
object TRpExpression3: TRpExpression | |||||
Width = 1740 | |||||
Height = 180 | |||||
PosX = 1560 | |||||
PosY = 1860 | |||||
Type1Font = poHelvetica | |||||
FontSize = 7 | |||||
Alignment = 2 | |||||
AutoExpand = False | |||||
AutoContract = False | |||||
ExportPosition = 0 | |||||
ExportSize = 1 | |||||
ExportDoNewLine = False | |||||
PrintCondition = '' | |||||
DoBeforePrint = '' | |||||
DoAfterPrint = '' | |||||
WFontName = 'Arial' | |||||
LFontName = 'Helvetica' | |||||
Expression = 'LABLES.OutboundSerial' | |||||
DisplayFormat = '' | |||||
ExportDisplayFormat = '' | |||||
AgIniValue = '0' | |||||
ExportExpression = '' | |||||
end | |||||
object TRpExpression4: TRpExpression | |||||
Width = 1485 | |||||
Height = 300 | |||||
PosX = 360 | |||||
PosY = 1680 | |||||
Type1Font = poHelvetica | |||||
AutoExpand = False | |||||
AutoContract = False | |||||
ExportPosition = 0 | |||||
ExportSize = 1 | |||||
ExportDoNewLine = False | |||||
PrintCondition = '' | |||||
DoBeforePrint = '' | |||||
DoAfterPrint = '' | |||||
WFontName = 'Arial' | |||||
LFontName = 'Helvetica' | |||||
Expression = #39'SET: '#39' + STR(KITLABELS.SetNumber)' | |||||
DisplayFormat = '' | |||||
ExportDisplayFormat = '' | |||||
AgIniValue = '0' | |||||
ExportExpression = '' | |||||
end | |||||
end | end |
@@ -0,0 +1,16 @@ | |||||
<% | |||||
Class Migration_07_Alter_Kit_Table_Labels_With_Set | |||||
Public Migration | |||||
Public Sub Up | |||||
Migration.Do "ALTER TABLE [KitLabels] " &_ | |||||
"ADD [SetNumber] NUMBER;" | |||||
End Sub | |||||
Public Sub Down | |||||
Migration.Do "ALTER TABLE [KitLables] " &_ | |||||
"DROP COLUMN [SetNumber];" | |||||
End Sub | |||||
End Class | |||||
Migrations.Add "Migration_07_Alter_Kit_Table_Labels_With_Set" | |||||
%> |
@@ -35,6 +35,7 @@ Migrations.Tracing = false | |||||
<!--#include file="Migration_04_Create_Kit_Table.asp"--> | <!--#include file="Migration_04_Create_Kit_Table.asp"--> | ||||
<!--#include file="Migration_05_Create_Kit_Labels_Table.asp"--> | <!--#include file="Migration_05_Create_Kit_Labels_Table.asp"--> | ||||
<!--#include file="Migration_06_Alter_Kit_Tabl.asp"--> | <!--#include file="Migration_06_Alter_Kit_Tabl.asp"--> | ||||
<!--#include file="Migration_07_Alter_Kit_Table_Labels_With_Set.asp"--> | |||||
<% | <% | ||||
Sub HandleMigration | Sub HandleMigration | ||||
putl "<b>Starting Version: " & Migrations.Version & "</b>" | putl "<b>Starting Version: " & Migrations.Version & "</b>" | ||||
Powered by TurnKey Linux.