This commit is contained in:
2026-03-05 11:02:39 +01:00
parent 6434bcf08e
commit cc92167508
4 changed files with 19 additions and 4 deletions

View File

@@ -227,6 +227,18 @@ Public Class cVERAG_CustomsDeclarations
Dim cbamWhere As String = VERAG_PROG_ALLGEMEIN.cGreendeal_CBAM_Trn.BuildCBAMPatternWhereClause("i.zaItem_HSCode")
Dim cbamWhereSnd As String = " AND " & cbamWhere.Replace("i.zaItem_HSCode", "zaItem_HSCode")
Dim cbamWhereISOCntry As String = " i.zaItem_OriginCountry NOT IN (
/*EU-27 (ISO2)*/
'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',
/*Nicht CBAM-pflichtig (EU-ETS verknüpft / Ausnahmen)*/
'CH', /* Schweiz */
'NO', /* Norwegen */
'IS', /* Island */
'LI', /* Liechtenstein */
'XI' /* Nordirland (NI-Protokoll; im Warenverkehr EU-behandelt) */
) "
' ------------------------------------------------------------
' SQL: ZA-IDs ermitteln
@@ -247,7 +259,8 @@ Public Class cVERAG_CustomsDeclarations
" AND cast(z.za_DeclarationDate as date) >= @dateFrom " &
" AND cast(z.za_DeclarationDate as date) <= @dateTo " &
If(eoriIn <> "", " AND p.zaParty_EORI IN (" & eoriIn & ") ", "") &
" AND " & cbamWhere
" AND " & cbamWhere &
" AND " & cbamWhereISOCntry
If indirect Then
sqlstr &= " AND (
@@ -265,6 +278,7 @@ Public Class cVERAG_CustomsDeclarations
sqlstr &= " AND z.za_System = @sys "
End If
Using conn = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand(sqlstr, conn)