Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Module Analyze_CM
Call AddStatusInfo(sqlStringExec, sDescr, sResult)

If sResult = "NO" Then
Call oEventLog.LogMessage(0, "")
Call oEventLog.LogMessage(0, "")
Exit Sub
End If

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ Module Analyze_DB

'=== Objects ===

Form1.UpdateAnalysisToolStatusBar("Analyzing Custom Objects")
Form1.UpdateAnalysisToolStatusBar("Analyzing Custom Database Objects")

Call oEventLog.LogMessage(0, "CUSTOM OBJECTS")
Call oEventLog.LogMessage(0, "")
Call oEventLog.LogMessage(0, "CUSTOM DATABASE OBJECTS")
Call oEventLog.LogMessage(0, "")

Call oEventLog.LogMessage(0, "Analyzing Custom Objects")
Call oEventLog.LogMessage(0, "Analyzing Custom Database Objects")

'============
' TABLES
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,6 @@ Friend Class Form1
Exit Sub
End If

Call Analyze_DB.Analyze_DB()
If OkToContinue = True Then
UpdateAnalysisToolStatusBar("Finished analyzing Database Objects")
Else
UpdateAnalysisToolStatusBar("Error encountered analyzing Database Objects")
Exit Sub
End If

'Analyze MC - Multi-Company
Call Analyze_MC.Analyze_MC()
If OkToContinue = True Then
Expand Down Expand Up @@ -312,6 +304,24 @@ Friend Class Form1
Exit Sub
End If

'Analyze Customizations
Call Analyze_CU.Analyze_CU()
If OkToContinue = True Then
UpdateAnalysisToolStatusBar("Finished analyzing Customizations")
Else
UpdateAnalysisToolStatusBar("Error encountered analyzing Customizations")
Exit Sub
End If

'Analyze Database Objects
Call Analyze_DB.Analyze_DB()
If OkToContinue = True Then
UpdateAnalysisToolStatusBar("Finished analyzing Database Objects")
Else
UpdateAnalysisToolStatusBar("Error encountered analyzing Database Objects")
Exit Sub
End If

'Truncate table xSLAnalysisCpny
sqlStmt = "Delete from xSLAnalysisCpny"
Call sql_1(sqlReader, sqlStmt, SqlAppDbConn, OperationType.DeleteOp, CommandType.Text)
Expand Down Expand Up @@ -557,6 +567,6 @@ Friend Class Form1
Call MessageBox.Show("Dynamics SL Applications folder path is invalid. Please enter a valid directory.", "Invalid Directory", MessageBoxButtons.OK)
End If
End If

End Sub

End Class
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Module PlumblineCode
Public gcPS_TIStagingFolder$ = "" ' Staging folder of file to upload via Transaction Import
Public gcTI_ControlFile$ = "" ' Tranaction Import control file
Public gcTI_LogFile$ = "" ' Tranaction Import log file
Public gcReleaseVersion$ = "Release: 2026-04-07" ' Version of the release being deployed, used for logging
Public gcReleaseVersion$ = "Release: 2026-09-28" ' Version of the release being deployed, used for logging

Public Class VersionSLCls

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<Compile Include="Analyze_BM.vb" />
<Compile Include="Analyze_CA.vb" />
<Compile Include="Analyze_CM.vb" />
<Compile Include="Analyze_CU.vb" />
<Compile Include="Analyze_DB.vb" />
<Compile Include="Analyze_GL.vb" />
<Compile Include="Analyze_IN.vb" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,81 @@ Module AccountCode
End If


'**********************************************************************
'*** Check for inactive General Ledger accounts that have a balance ***
'**********************************************************************

If OkToContinue = True Then

Try
sqlStmt = "WITH RowBalances AS (" +
" SELECT ah.CpnyID, ah.Acct, ah.Sub, ah.LedgerID, ah.FiscYr," +
" COALESCE(ah.BegBal, 0)" +
" + COALESCE(ah.PtdBal00, 0)" +
" + COALESCE(ah.PtdBal01, 0)" +
" + COALESCE(ah.PtdBal02, 0)" +
" + COALESCE(ah.PtdBal03, 0)" +
" + COALESCE(ah.PtdBal04, 0)" +
" + COALESCE(ah.PtdBal05, 0)" +
" + COALESCE(ah.PtdBal06, 0)" +
" + COALESCE(ah.PtdBal07, 0)" +
" + COALESCE(ah.PtdBal08, 0)" +
" + COALESCE(ah.PtdBal09, 0)" +
" + COALESCE(ah.PtdBal10, 0)" +
" + COALESCE(ah.PtdBal11, 0)" +
" + COALESCE(ah.PtdBal12, 0) AS RowBalance" +
" FROM AcctHist AS ah" +
" WHERE EXISTS (SELECT 1 FROM GLSetup AS gl WHERE gl.LedgerID = ah.LedgerID)" +
" AND EXISTS (SELECT 1 FROM Account AS a WHERE a.Acct = ah.Acct AND a.Active = 0)" +
"), Balances AS (" +
" SELECT CpnyID, Acct, Sub, LedgerID, FiscYr, SUM(RowBalance) AS Balance" +
" FROM RowBalances" +
" GROUP BY CpnyID, Acct, Sub, LedgerID, FiscYr" +
")" +
" SELECT CpnyID, Acct, Sub, LedgerID, FiscYr, Balance" +
" FROM Balances" +
" WHERE Balance <> 0" +
" ORDER BY Acct"

Call sqlFetch_1(sqlReader, sqlStmt, SqlAppDbConn, CommandType.Text)

If (sqlReader.HasRows = True) Then
Call LogMessage("", oEventLog)

While sqlReader.Read()
msgText = "ERROR: Inactive General Ledger account has a nonzero balance."
msgText = msgText + vbTab + "Company: " + Convert.ToString(sqlReader("CpnyID")).Trim
msgText = msgText + vbTab + "Account: " + Convert.ToString(sqlReader("Acct")).Trim
msgText = msgText + vbTab + "Subaccount: " + Convert.ToString(sqlReader("Sub")).Trim
msgText = msgText + vbTab + "Ledger: " + Convert.ToString(sqlReader("LedgerID")).Trim
msgText = msgText + vbTab + "Fiscal Year: " + Convert.ToString(sqlReader("FiscYr")).Trim
msgText = msgText + vbTab + "Balance: " + Convert.ToDecimal(sqlReader("Balance")).ToString("N2")

Call LogMessage(msgText, oEventLog)
NbrOfErrors_COA = NbrOfErrors_COA + 1
End While

Call LogMessage("", oEventLog)
End If

Call sqlReader.Close()

Catch ex As Exception
If sqlReader IsNot Nothing AndAlso sqlReader.IsClosed = False Then
sqlReader.Close()
End If

Call MessageBox.Show(ex.Message + vbNewLine + ex.StackTrace, "Error", MessageBoxButtons.OK)

Call LogMessage("", oEventLog)
Call LogMessage("Error while checking for inactive General Ledger accounts with balances.", oEventLog)
Call LogMessage("Error Detail: " + ex.Message.Trim + vbNewLine + ex.StackTrace, oEventLog)
Call LogMessage("", oEventLog)
OkToContinue = False
NbrOfErrors_COA = NbrOfErrors_COA + 1
End Try

End If


'***********************************************************************************'
Expand Down Expand Up @@ -349,7 +424,6 @@ Module AccountCode

End If


' Detect AcctHist records with blank key fields - keys are CpnyId, Acct, Sub, LedgerID, FiscYr
If OkToContinue = True Then
sqlStmt = "SELECT COUNT(*) FROM AcctHist WHERE RTRIM(CpnyId) = '' or RTRIM(Acct) = '' or RTRIM(Sub) = '' or RTRIM(LedgerID) = '' or RTRIM(FiscYr) = ''"
Expand Down Expand Up @@ -868,23 +942,30 @@ Module AccountCode
'**********************************************************
'*** Remove time values from date fields - Cash Manager ***
'**********************************************************

If OkToContinue = True Then

Try
sqlReader.Close()
Call UpdateDates_CA(oEventLog)

Catch ex As Exception
Call MessageBox.Show(ex.Message + vbNewLine + ex.StackTrace, "Error", MessageBoxButtons.OK)

Call LogMessage("", oEventLog)
Call LogMessage("Error in removing time values in date fields - Cash Manager", oEventLog)
Call LogMessage("Error Detail: " + ex.Message.Trim + vbNewLine + ex.StackTrace, oEventLog)
Call LogMessage("", oEventLog)
OkToContinue = False
NbrOfErrors_COA = NbrOfErrors_COA + 1
End Try

End If

'*********************************************************************************************
'*** Identify GLTran records with Fiscal Year different from period to post year
'*********************************************************************************************

Dim SqlTranConn As SqlConnection = Nothing
Dim cmdText As String = ""
Dim Operation As OperationType
Expand Down Expand Up @@ -1075,7 +1156,6 @@ Module AccountCode
End If
End If


'Call oEventLog.LogMessage(EndProcess, "Validate General Ledger")
Call oEventLog.LogMessage(EndProcess, "Repair Tool " & gcReleaseVersion.Trim & vbNewLine & "Validate General Ledger")

Expand All @@ -1092,7 +1172,40 @@ Module AccountCode

termsList.Clear()

End Sub

'***********************************************
'*** Check for invalid Address Phone Numbers ***
'***********************************************
sqlStmt = "SELECT AddrId, Phone FROM Address WHERE TRIM(Phone) <> ''"

Call sqlFetch_1(sqlReader, sqlStmt, SqlAppDbConn, CommandType.Text)

Dim firstInvalidAddressPhoneFound As Boolean = False

While (sqlReader.Read())

Call SetAddressValues(sqlReader, bAddressInfo)

'Check if phone number is valid using HelperFunctions.IsValidPhoneNumber
If Not HelperFunctions.IsValidPhoneNumber(bAddressInfo.Phone) Then

'Check if this is the first occurrence of an invalid phone number
If Not firstInvalidAddressPhoneFound Then
Call LogMessage("", oEventLog)
Call LogMessage("", oEventLog)
msgText = "WARNING: Invalid Address phone number(s) found. Phone numbers must be in a valid format."
msgText = msgText + vbNewLine + "List of Address IDs with invalid phone numbers:"
Call LogMessage(msgText, oEventLog)
firstInvalidAddressPhoneFound = True
End If

'Write Address ID and phone number to event log
Call LogMessage("Address ID: " + bAddressInfo.AddrId + vbTab + "Phone: " + bAddressInfo.Phone, oEventLog)
NbrOfWarnings_Inv = NbrOfWarnings_Inv + 1
End If

End While

Call sqlReader.Close()
End Sub
End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Imports System.Data.SqlClient

Module ADDRESS

Public Class Addresscls

Private m_AddrId As String
Private m_Phone As String

Public Property AddrId() As String

Get
Return m_AddrId
End Get

Set(ByVal setval As String)
m_AddrId = setval
End Set

End Property

Public Property Phone() As String

Get
Return m_Phone
End Get

Set(ByVal setval As String)
m_Phone = setval
End Set

End Property

End Class

Public bAddressInfo As Addresscls = New Addresscls, nAddressInfo As Addresscls = New Addresscls

Public Sub SetAddressValues(sqlReader As SqlDataReader, AddressBuf As Addresscls)
Try
AddressBuf.AddrId = sqlReader("AddrId")
AddressBuf.Phone = sqlReader("Phone")
Catch ex As Exception
AddressBuf.AddrId = String.Empty
AddressBuf.Phone = String.Empty
End Try
End Sub

End Module
Loading