Länderausschluss für Ursprungsland implementiert

This commit is contained in:
2026-09-14 14:59:01 +02:00
parent d397579b4f
commit 1034b62747

View File

@@ -727,6 +727,12 @@ Public Class cVERAG_CustomsDeclarations
p.zaParty_Role IN ('CZ','EX','EXP','EXPORTER','CONSIGNOR'))") & "
WHERE z.za_ReleaseDate BETWEEN '" & von.ToShortDateString & "' AND '" & bis.ToShortDateString & "'
AND i.zaItem_OriginCountry NOT IN (
'EU','AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR',
'DE','GR','HU','IE','IT','LV','LT','LU','MT','NL',
'PL','PT','RO','SK','SI','ES','SE',
'CH','NO','IS','LI','XI'
)
AND EXISTS (
SELECT 1
FROM VERAG.dbo.tblGreendeal_CBAM_Trn t
@@ -788,11 +794,19 @@ Public Class cVERAG_CustomsDeclarations
Dim prefixes As HashSet(Of String) =
New HashSet(Of String)(cbamHsCodes)
Dim excludedCountries As New HashSet(Of String) From {
"EU", "AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR",
"DE", "GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL",
"PL", "PT", "RO", "SK", "SI", "ES", "SE",
"CH", "NO", "IS", "LI", "XI"
}
Return Me.Items.
Where(Function(it)
Dim hs As String = If(it.zaItem_HSCode, "").Trim()
If hs = "" Then Return False
' linksseitiger Prefix-Abgleich
Dim origin As String = If(it.zaItem_OriginCountry, "").Trim().ToUpper()
If origin <> "" AndAlso excludedCountries.Contains(origin) Then Return False
For Each p In prefixes
If hs.StartsWith(p) Then
Return True