CBAM/VERAG Zollanmeldugnen
This commit is contained in:
@@ -211,6 +211,51 @@ Public Class cGreendeal_CBAM_Trn
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function LoadCBAMTariffNumbers(Optional onlyActive As Boolean = True,
|
||||
Optional includeExclusions As Boolean = False) _
|
||||
As List(Of String)
|
||||
|
||||
Dim sql As String =
|
||||
"SELECT DISTINCT trnPattern " &
|
||||
"FROM VERAG.dbo.tblGreendeal_CBAM_Trn " &
|
||||
"WHERE trnPattern IS NOT NULL " &
|
||||
"AND LTRIM(RTRIM(trnPattern)) <> '' "
|
||||
|
||||
If onlyActive Then
|
||||
sql &= " AND is_active = 1 " &
|
||||
" AND (start_date IS NULL OR start_date <= GETDATE()) " &
|
||||
" AND (end_date IS NULL OR end_date >= GETDATE()) "
|
||||
End If
|
||||
|
||||
If Not includeExclusions Then
|
||||
sql &= " AND ISNULL(is_exclusion,0) = 0 "
|
||||
End If
|
||||
|
||||
Dim dt As DataTable =
|
||||
(New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(sql, "FMZOLL")
|
||||
|
||||
Dim result As New List(Of String)
|
||||
|
||||
If dt Is Nothing OrElse dt.Rows.Count = 0 Then
|
||||
Return result
|
||||
End If
|
||||
|
||||
For Each r As DataRow In dt.Rows
|
||||
Dim pattern As String = r("trnPattern").ToString().Trim()
|
||||
|
||||
' % entfernen → reine Tarifnummer
|
||||
pattern = pattern.Replace("%", "")
|
||||
|
||||
' nur numerische Werte zulassen
|
||||
If pattern <> "" AndAlso pattern.All(AddressOf Char.IsDigit) Then
|
||||
result.Add(pattern)
|
||||
End If
|
||||
Next
|
||||
|
||||
Return result.Distinct().OrderBy(Function(x) x).ToList()
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function DELETE_ALL() As Boolean
|
||||
Try
|
||||
|
||||
|
||||
Reference in New Issue
Block a user