48 lines
1.8 KiB
Plaintext
48 lines
1.8 KiB
Plaintext
' GetArticleNumberFromSecondaryIndentifier(Identifier : String)
|
|
' ----------------------------------------------------------------------------
|
|
' Gibt die Artikelnummer für Spät-Auspräge-Artikel zurück
|
|
'
|
|
' Returns: GetArticleNumberFromSecondaryIndentifier : String
|
|
' ----------------------------------------------------------------------------
|
|
' Copyright (c) 2021 by Digital Data GmbH
|
|
'
|
|
' Digital Data GmbH • Ludwig-Rinn-Strasse 16 • D-35452 Heuchelheim
|
|
' Tel.: 0641/202360 • E-Mail: info-flow(at)digitaldata.works
|
|
' ----------------------------------------------------------------------------
|
|
' Creation Date / Author: 23.10.2020 / JJ
|
|
' Version Date / Editor: 23.11.2020 / JJ
|
|
' Version Number: 1.0.0.0
|
|
|
|
Function GetArticleNumberFromSecondaryIndentifier(Identifier)
|
|
SQL = ""
|
|
' EAN-Code / Alternative Artikelnummer 1 / Alternative Artikelnummer 2 / Artikelnummer / S/N
|
|
SQL = SQL & "("
|
|
SQL = SQL & "(C002 = '" & Identifier & "') Or "
|
|
SQL = SQL & "(C068 = '" & Identifier & "') Or "
|
|
SQL = SQL & "(C075 = '" & Identifier & "') Or "
|
|
SQL = SQL & "(C114 = '" & Identifier & "') Or "
|
|
SQL = SQL & "(C115 = '" & Identifier & "')"
|
|
SQL = SQL & ") "
|
|
' Nur Nach Hauptartikel/Ausprägungs(kind)artikel suchen
|
|
' SQL = SQL & "And C014 IN (0, 2)"
|
|
|
|
' Nach Mandant und Wirtschaftsjahr filtern
|
|
SQL = SQL & SQLQuery_BasicWhere
|
|
|
|
Set Result = CWLStart.CurrentCompany.SearchRecord(TABLE_21, SQL)
|
|
|
|
If DEBUG_ON = True Then
|
|
AddDebugLine "Searching for SerialNumber-Regex by ArticleNumber " & vbNewline
|
|
AddDebugLine "Result Columns: " & Result
|
|
AddDebugLine "Result Rows: " & Result.RowCount
|
|
AddDebugLine "SQL: " & SQL
|
|
|
|
ShowDebugBox "GetArticleNumberFromSecondaryIndentifier"
|
|
End If
|
|
|
|
If Result.RowCount > 0 Then
|
|
GetArticleNumberFromSecondaryIndentifier = Result.Value("c010")
|
|
Else
|
|
GetArticleNumberFromSecondaryIndentifier = ""
|
|
End If
|
|
End Function |