From 4d5b408418c5ca5baa6a5e485fe812159d91082f Mon Sep 17 00:00:00 2001 From: Daniel Covington Date: Mon, 15 Apr 2024 16:01:42 -0400 Subject: [PATCH] Added set to data and pages and report --- App/DomainModels/KitLabelsRepository.asp | 27 ++-- App/ViewModels/KitLabelsViewModels.asp | 1 + App/Views/Kit/SwitchBoardEdit.asp | 2 + App/Views/KitLabels/index.asp | 2 + Data/Label_Report.rep | 129 +++++++++++++++++- ...ion_07_Alter_Kit_Table_Labels_With_Set.asp | 16 +++ Data/Migrations/migrate.asp | 1 + 7 files changed, 161 insertions(+), 17 deletions(-) create mode 100644 Data/Migrations/Migration_07_Alter_Kit_Table_Labels_With_Set.asp diff --git a/App/DomainModels/KitLabelsRepository.asp b/App/DomainModels/KitLabelsRepository.asp index 69252d8..3741f04 100644 --- a/App/DomainModels/KitLabelsRepository.asp +++ b/App/DomainModels/KitLabelsRepository.asp @@ -17,9 +17,10 @@ Class KitLabelsModel_Class Public InBoundIMBDigits '106 Public OutboundIMBPNG Public INBOUNDIMBPNG + Public SetNumber Private Sub Class_Initialize '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 CLass @@ -31,7 +32,7 @@ End CLass Class KitLabelsRepository_Class 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) If rs.EOF then Err.Raise 1, "KitLabelsRepository_Class", KitLabelsNotFoundException("ID", ID) @@ -45,7 +46,7 @@ Class KitLabelsRepository_Class End Function 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 sql = sql & " WHERE " @@ -78,7 +79,7 @@ Class KitLabelsRepository_Class End Function 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 sql = sql & " WHERE " @@ -120,7 +121,7 @@ Class KitLabelsRepository_Class End Function 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 sql = sql & " WHERE " @@ -198,10 +199,13 @@ Class KitLabelsRepository_Class Dim SerialNumberStart:SerialNumberStart = SettingsRepository.Find(Array("Name =?","SerialNumberStart"),empty).pop().Value Dim serialOffset:serialOffset = SettingsRepository.Find(Array("Name =?","SerialOffset"),empty).pop().Value Dim SerialStart:SerialStart = CLng(SerialNumberStart) + CLng(serialOffset) - dim i + dim i,s + s = 1 for i = 0 to (Amount * 2) - 2 Step 2 dim NewKitLabel : set NewKitLabel = new KitLabelsModel_Class NewKitLabel.KitId = KitId + NewKitLabel.SetNumber = s + s = s + 1 NewKitLabel.OutboundSerial = PadLeft(SerialStart + i,9,"0") NewKitLabel.InBoundSerial = PadLeft(SerialStart + i + 1,9,"0") NewKitLabel.OutboundIMBDigits ="00716" & MailingID & NewKitLabel.OutboundSerial & "000000000" @@ -237,8 +241,9 @@ Class KitLabelsRepository_Class "[OutboundIMBDigits]," &_ "[InBoundIMBDigits]," &_ "[OutboundIMBPNG]," &_ - "[INBOUNDIMBPNG])" &_ - "VALUES (?,?,?,?,?,?,?,?,?)" + "[INBOUNDIMBPNG]," &_ + "[SetNumber])" &_ + "VALUES (?,?,?,?,?,?,?,?,?,?)" DAL.Execute sql, Array(model.KitId, _ model.OutboundSerial, _ model.InBoundSerial, _ @@ -247,7 +252,8 @@ Class KitLabelsRepository_Class model.OutboundIMBDigits, _ model.InBoundIMBDigits, _ model.OutboundIMBPNG, _ - model.INBOUNDIMBPNG) + model.INBOUNDIMBPNG, _ + model.SetNumber) sql = "SELECT TOP 1 ID FROM [KitLabels] ORDER BY ID DESC" dim rs : set rs = DAL.Query(sql, empty) model.ID = rs("ID") @@ -262,7 +268,7 @@ Class KitLabelsRepository_Class "[InBoundIMB] = ?," &_ "[OutboundIMBDigits] = ?," &_ "[InBoundIMBDigits] = ?," &_ - "OutboundIMBPNG,INBOUNDIMBPNG)" &_ + "OutboundIMBPNG,INBOUNDIMBPNG,[SetNumber])" &_ " WHERE [ID] = ?" DAL.Execute sql, Array(model.KitId, _ @@ -274,6 +280,7 @@ Class KitLabelsRepository_Class model.InBoundIMBDigits, _ model.OutboundIMBPNG, _ model.INBOUNDIMBPNG, _ + model.SetNumber, _ model.ID) End Sub diff --git a/App/ViewModels/KitLabelsViewModels.asp b/App/ViewModels/KitLabelsViewModels.asp index 838c2d4..6e980bc 100644 --- a/App/ViewModels/KitLabelsViewModels.asp +++ b/App/ViewModels/KitLabelsViewModels.asp @@ -25,6 +25,7 @@ Class Create_ViewModel_Class Public InBoundIMBDigits Public OutboundIMBPNG Public INBOUNDIMBPNG + Public SetNumber End Class Class Delete_ViewModel_Class diff --git a/App/Views/Kit/SwitchBoardEdit.asp b/App/Views/Kit/SwitchBoardEdit.asp index 5f27bc0..911d978 100644 --- a/App/Views/Kit/SwitchBoardEdit.asp +++ b/App/Views/Kit/SwitchBoardEdit.asp @@ -19,6 +19,7 @@ ID + Set Number KitId OutboundSerial InBoundSerial @@ -41,6 +42,7 @@ <%= HTML.LinkToExt("", "KitLabels", "Edit", Array("Id", KitLabels.ID), Array("class", "btn btn-primary")) %> <% = H(KitLabels.ID) %> + <% = H(KitLabels.SetNumber) %> <% = H(KitLabels.KitId) %> <% = H(KitLabels.OutboundSerial) %> <% = H(KitLabels.InBoundSerial) %> diff --git a/App/Views/KitLabels/index.asp b/App/Views/KitLabels/index.asp index 607e186..00674bd 100644 --- a/App/Views/KitLabels/index.asp +++ b/App/Views/KitLabels/index.asp @@ -34,6 +34,7 @@ InBoundIMBDigits OutboundIMB InBoundIMB + SetNumber @@ -56,6 +57,7 @@ <% = H(KitLabels.InBoundIMBDigits) %> Barcode Barcode + <% = H(KitLabels.SetNumber) %> <% Wend %> diff --git a/Data/Label_Report.rep b/Data/Label_Report.rep index 5247f01..9771a06 100644 --- a/Data/Label_Report.rep +++ b/Data/Label_Report.rep @@ -1,5 +1,11 @@ object TRpReport + PageHeight = 8120 + PageWidth = 5742 PageBackColor = 16777215 + LeftMargin = 270 + TopMargin = 360 + RightMargin = 270 + BottomMargin = 360 SubReports = < item SubReport = TRpSubReport0 @@ -21,9 +27,10 @@ object TRpReport SQL = 'SELECT KitLabels.OutboundSerial, KitLabels.OutboundIMB, KitLabel' + '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> DatabaseInfo = < item @@ -44,7 +51,7 @@ object TRpReport item Name = 'PBKITID' AllowNulls = False - Value = '72' + Value = '84' Datasets.Strings = ( 'LABLES' 'KITLABELS') @@ -56,6 +63,7 @@ object TRpReport ErrorMessage = '' Validation = '' end> + TwoPass = True StreamFormat = rpStreamText ReportAction = [] Type1Font = poHelvetica @@ -66,11 +74,11 @@ object TRpReport item Section = TRpSection0 end> - Alias = 'LABLES' + Alias = 'KITLABELS' end object TRpSection0: TRpSection - Width = 11520 - Height = 2057 + Width = 12240 + Height = 2160 SubReport = TRpSubReport0 ChangeBool = False PageRepeat = False @@ -95,6 +103,21 @@ object TRpReport end item Component = TRpExpression2 + end + item + Component = TRpLabel0 + end + item + Component = TRpLabel1 + end + item + Component = TRpLabel2 + end + item + Component = TRpExpression3 + end + item + Component = TRpExpression4 end> ExternalTable = 'REPMAN_REPORTS' ExternalField = 'REPORT' @@ -987,6 +1010,7 @@ object TRpReport PosY = 120 Type1Font = poHelvetica FontSize = 7 + Alignment = 2 AutoExpand = False AutoContract = False ExportPosition = 0 @@ -1027,4 +1051,95 @@ object TRpReport AgIniValue = '0' ExportExpression = '' 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 diff --git a/Data/Migrations/Migration_07_Alter_Kit_Table_Labels_With_Set.asp b/Data/Migrations/Migration_07_Alter_Kit_Table_Labels_With_Set.asp new file mode 100644 index 0000000..aefb087 --- /dev/null +++ b/Data/Migrations/Migration_07_Alter_Kit_Table_Labels_With_Set.asp @@ -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" + %> \ No newline at end of file diff --git a/Data/Migrations/migrate.asp b/Data/Migrations/migrate.asp index c4011a9..0628c36 100644 --- a/Data/Migrations/migrate.asp +++ b/Data/Migrations/migrate.asp @@ -35,6 +35,7 @@ Migrations.Tracing = false + <% Sub HandleMigration putl "Starting Version: " & Migrations.Version & ""