diff --git a/SDL/Formulare/KDFormulare/FormulareBaukasten/frmVorauskasse_CBAM.vb b/SDL/Formulare/KDFormulare/FormulareBaukasten/frmVorauskasse_CBAM.vb
index 728a27fb..fdc7faa5 100644
--- a/SDL/Formulare/KDFormulare/FormulareBaukasten/frmVorauskasse_CBAM.vb
+++ b/SDL/Formulare/KDFormulare/FormulareBaukasten/frmVorauskasse_CBAM.vb
@@ -27,11 +27,13 @@ Public Class frmVorauskasse_CBAM
If Not r.IsNewRow Then
Dim cost As Double = 0
Dim emission As Double = 0
- cATEZ_Greenpulse_CBAM_CostCalculation.calcCBAM_ByCertificatePrice(r.Cells("clmnTarif").Value, r.Cells("clmnWeight").Value, r.Cells("clmnCountry").Value, txtCalc_Defaut_CertPrice._value, r.Cells("clmnYear").Value, cost, emission)
+ Dim benchmark As Double = 0
+ cATEZ_Greenpulse_CBAM_CostCalculation.calcCBAM_ByCertificatePrice(r.Cells("clmnTarif").Value, r.Cells("clmnWeight").Value, r.Cells("clmnCountry").Value, txtCalc_Defaut_CertPrice._value, r.Cells("clmnYear").Value, cost, emission, benchmark)
If cost > 0 Then
r.Cells("clmnKosten").Value = cost
r.Cells("cmlnEmission").Value = emission
+ r.Cells("clmnBenchmark").Value = benchmark
GesamtBetrag += cost
End If
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/ATEZ/GREENPULSE/cATEZ_Greenpulse_CBAM_CostCalculation.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/ATEZ/GREENPULSE/cATEZ_Greenpulse_CBAM_CostCalculation.vb
index 749cd4be..57958d02 100644
--- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/ATEZ/GREENPULSE/cATEZ_Greenpulse_CBAM_CostCalculation.vb
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/ATEZ/GREENPULSE/cATEZ_Greenpulse_CBAM_CostCalculation.vb
@@ -285,7 +285,9 @@ Public Class cATEZ_Greenpulse_CBAM_CostCalculation
End Function
- Public Shared Function calcCBAM_ByCertificatePrice(cn_code As String, weight As Object, country_code As String, certificate_price As Object, year As Object, Optional ByRef CBAM_COST As Decimal = -1, Optional ByRef CBAM_EMISSION As Decimal = -1) As String
+ Public Shared Function calcCBAM_ByCertificatePrice(cn_code As String, weight As Object, country_code As String, certificate_price As Object, year As Object, Optional ByRef CBAM_COST As Decimal = -1, Optional ByRef CBAM_EMISSION As Decimal = -1, Optional ByRef CBAM_BENCHMARK As Decimal = -1, Optional ByRef CBAM_Faktor As Decimal = -1) As String
+
+ VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat()
' ------------------------------------------------------------
' Validierung
@@ -316,6 +318,7 @@ Public Class cATEZ_Greenpulse_CBAM_CostCalculation
' ------------------------------------------------------------
Dim api As New cATEZ_Greenpulse_CBAM_CostCalculation()
Dim see_total As Decimal
+ Dim benchmark As Decimal
Try
Dim defResp = api.GetCnCodeDefaults(
@@ -333,6 +336,7 @@ Public Class cATEZ_Greenpulse_CBAM_CostCalculation
End If
see_total = defResp.data.default_emission
+ benchmark = defResp.data.benchmark
Catch ex As Exception
Return "Technischer Fehler beim Laden der CN-Code Defaults: " & ex.Message
@@ -344,25 +348,52 @@ Public Class cATEZ_Greenpulse_CBAM_CostCalculation
Dim w As Decimal = CDec(weight)
Dim price As Decimal = CDec(certificate_price)
- Dim cbamEmission As Decimal = w * see_total
- Dim cbamCost As Decimal = cbamEmission * price
- ' ------------------------------------------------------------
- ' Ausgabe
- ' ------------------------------------------------------------
+ ' --- Faktoren als echte Faktoren (nicht Prozent) ---
+ Dim cbamf As Decimal = 0D
+ Select Case CInt(year)
+ Case 2026 : cbamf = 0.975D
+ Case 2027 : cbamf = 0.95D
+ Case 2028 : cbamf = 0.9D
+ Case 2029 : cbamf = 0.775D
+ Case 2030 : cbamf = 0.515D
+ Case 2031 : cbamf = 0.39D
+ Case 2032 : cbamf = 0.265D
+ Case 2033 : cbamf = 0.14D
+ Case Else : cbamf = 0D
+ End Select
+
+
+ ' SEFA = Benchmark * CBAMF * CSCF
+ Dim sefa As Decimal = benchmark * cbamf
+
+ ' Zertifikatspflicht je Tonne Ware
+ Dim certPerTon As Decimal = see_total - sefa
+ If certPerTon < 0D Then certPerTon = 0D
+
+ ' Gesamte Zertifikatspflicht (t CO2e)
+ Dim certTotal As Decimal = certPerTon * w
+
+ ' Kosten
+ Dim cbamCost As Decimal = certTotal * price
+
+ ' --- Ausgabe ---
Dim s As String = ""
- s &= "CBAM Kostenberechnung (ohne Benchmark)" & vbCrLf
+ s &= "CBAM Kostenberechnung (Default EE mit SEFA-Abzug)" & vbCrLf
s &= "-----------------------------------------------------------" & vbCrLf
s &= $"CN-Code: {cn_code}" & vbCrLf
s &= $"Ursprungsland: {country_code.ToUpperInvariant()}" & vbCrLf
+ s &= $"Jahr: {year}" & vbCrLf
s &= $"Gewicht: {w:N2} t" & vbCrLf
- s &= $"SEE total (Default): {see_total:N5}" & vbCrLf
- s &= $"CBAM Emission: {cbamEmission:N5} t CO₂" & vbCrLf
- s &= $"Zertifikatspreis: {price:N2} EUR/t" & vbCrLf
- s &= vbCrLf
- s &= $"CBAM Kosten: {cbamCost:N2} EUR" & vbCrLf
+ s &= $"EE / SEE total (Default): {see_total:N6} t CO₂e/t" & vbCrLf
+ s &= $"Benchmark BMg: {benchmark:N6} t CO₂e/t" & vbCrLf
+ s &= $"CBAMF: {cbamf:N3}"
+ Console.WriteLine(s)
+
CBAM_COST = cbamCost
CBAM_EMISSION = see_total
+ CBAM_BENCHMARK = benchmark
+ CBAM_Faktor = cbamf
Return s
diff --git a/VERAG_PROG_ALLGEMEIN/VERAG_Zollanmeldung/cVERAG_Zollanmeldung.vb b/VERAG_PROG_ALLGEMEIN/VERAG_Zollanmeldung/cVERAG_Zollanmeldung.vb
index 819ad26f..f43d1a23 100644
--- a/VERAG_PROG_ALLGEMEIN/VERAG_Zollanmeldung/cVERAG_Zollanmeldung.vb
+++ b/VERAG_PROG_ALLGEMEIN/VERAG_Zollanmeldung/cVERAG_Zollanmeldung.vb
@@ -369,6 +369,7 @@ Public Class cVERAG_CustomsDeclarations
If hasCBAM(CBAM_ITEMS) Then
Dim importerEORI As String = Me.Parties.Where(Function(p) {"CN", "IM", "IMP", "IMPORTER"}.Contains(p.zaParty_Role)).Select(Function(p) p.zaParty_EORI).FirstOrDefault()
+ Dim ImporterString As String = Me.Parties.Where(Function(p) {"CZ", "EX", "EXP", "EXPORTER"}.Contains(p.zaParty_Role)).Select(Function(p) p.zaParty_Name).FirstOrDefault()
Dim ExporterEORI As String = Me.Parties.Where(Function(p) {"CZ", "EX", "EXP", "EXPORTER"}.Contains(p.zaParty_Role)).Select(Function(p) p.zaParty_EORI).FirstOrDefault()
Dim ExporterString As String = Me.Parties.Where(Function(p) {"CZ", "EX", "EXP", "EXPORTER"}.Contains(p.zaParty_Role)).Select(Function(p) p.zaParty_Name).FirstOrDefault()
@@ -380,14 +381,27 @@ Public Class cVERAG_CustomsDeclarations
AD = New cAdressen(KD.KundenNr)
End If
+
+ If AD IsNot Nothing Then
+ ImporterString = AD.Name_1 & " " & If(AD.Name_2, "") & "
" & If(AD.LandKz, "") & " " & If(AD.PLZ, "") & " " & If(AD.Ort, "")
+ End If
+
+ Dim KD_EX As cKunde = Nothing
+ Dim AD_EX As cAdressen = Nothing
+ If If(ExporterEORI, "") <> "" Then
+ KD_EX = cKunde.LOAD_ByEORI(ExporterEORI, If(za_Firma, ""))
+ If KD_EX Is Nothing Then KD_EX = cKunde.LOAD_ByEORI(ExporterEORI) 'Wenn kein Kunde mit Firma gefunden wurde, nur nach EORI suchen (default VERAG)
+ AD_EX = New cAdressen(KD_EX.KundenNr)
+
+ End If
+ If AD_EX IsNot Nothing Then
+ ExporterString = AD_EX.Name_1 & " " & If(AD_EX.Name_2, "") & "
" & If(AD_EX.LandKz, "") & " " & If(AD_EX.PLZ, "") & " " & If(AD_EX.Ort, "")
+ End If
+
+
If isIndirect() Then
- Dim KD_EX As cKunde = Nothing
- Dim AD_EX As cAdressen = Nothing
- If If(ExporterEORI, "") <> "" Then
- KD_EX = cKunde.LOAD_ByEORI(ExporterEORI, If(za_Firma, ""))
- If KD_EX Is Nothing Then KD_EX = cKunde.LOAD_ByEORI(ExporterEORI) 'Wenn kein Kunde mit Firma gefunden wurde, nur nach EORI suchen (default VERAG)
- AD_EX = New cAdressen(KD_EX.KundenNr)
- End If
+
+
'==================>> INDIRECT <<=========================
Dim itemsHtml As String =
@@ -416,9 +430,7 @@ Public Class cVERAG_CustomsDeclarations
"" &
"" &
"Importeur:
" &
- importerEORI & " – " & vbNewLine &
- If(AD Is Nothing, ExporterString, AD.Name_1 & " " & If(AD.Name_2, "") & "
" &
- If(AD.LandKz, "") & " " & If(AD.PLZ, "") & " " & If(AD.Ort, "")) &
+ If(importerEORI, "") & "
" & If(ImporterString, "") &
"
" &
"" &
"Exporteur:
" &
@@ -480,29 +492,28 @@ Public Class cVERAG_CustomsDeclarations
Schwellenwert = Warn1
End If
- '===========>>>> WARNUNG <<<<<<<=================================
- If WarnLevel <> "" Then
+ '===========>>>> WARNUNG <<<<<<<=================================
+ If WarnLevel <> "" Then
+
Dim bodyHtml As String =
"
" &
"CBAM-Warnmeldung zu Ihrer Zollanmeldung " & Me.za_MRN & "
" &
- "" &
+ "
" &
"Laut unserem System wurden in der Zollanmeldung mit der MRN " & Me.za_MRN & " " &
"CBAM-pflichtige Warenpositionen erkannt.
" &
"Für Ihr Unternehmen liegen uns derzeit keine Informationen über eine gültige CBAM-Registrierung vor." &
"
" &
- "" &
- "| Warnstufe | " & WarnLevel & If(WarnLevel = 3, " - ÜBERSCHREITUNG!", "") & " |
" &
+ "" &
+ "| Warnstufe | " & WarnLevel & If(WarnLevel = 3, " - ÜBERSCHREITUNG!", "") & " |
" &
"| Schwellenwert | " & Schwellenwert.ToString("N0") & " Tonnen |
" &
"
" &
"" &
"Importeur:
" &
- importerEORI & " – " & vbNewLine &
- If(AD Is Nothing, ExporterString, AD.Name_1 & " " & If(AD.Name_2, "") & "
" &
- If(AD.LandKz, "") & " " & If(AD.PLZ, "") & " " & If(AD.Ort, "")) &
- "
" &
+ If(importerEORI, "") & "
" & If(ImporterString, "") &
+ "" &
"" &
"Exporteur:
" &
- If(ExporterEORI, "") & " – " & vbNewLine & If(ExporterString, "") &
+ If(ExporterEORI, "") & "
" & If(ExporterString, "") &
"
" &
"WICHTIG
" &
"" &
@@ -518,9 +529,10 @@ Public Class cVERAG_CustomsDeclarations
"
VERAG DCS – CBAM Compliance Services
" &
"VERAG Spedition AG
A-4975 Suben, Suben 100
" &
""
+ Console.WriteLine(bodyHtml)
-
- VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(If(AD.E_Mail, ""), "CBAM-WARNUNG – " & If(WarnLevel = 3, " - ACHTUNG: Überschreitung 50to! ", "Überschreitung der Meldeschwelle"), bodyHtml, "cbam@verag.ag", (WarnLevel = 3), "cbam@verag.ag",, "al@verag.ag")
+ ' VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(If(AD.E_Mail, ""), "CBAM-WARNUNG – " & If(WarnLevel = 3, " ACHTUNG: Überschreitung 50to! ", "Überschreitung der Meldeschwelle"), bodyHtml, "cbam@verag.ag", (WarnLevel = 3), "cbam@verag.ag",, "al@verag.ag")
+ VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(If(AD.E_Mail, ""), "CBAM-WARNUNG – " & If(WarnLevel = 3, " ACHTUNG: Überschreitung 50to! ", "Überschreitung der Meldeschwelle"), bodyHtml, "cbam@verag.ag", (WarnLevel = 3), False, "cbam@verag.ag", "al@verag.ag")
'VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(
' "al@verag.ag",
@@ -539,8 +551,8 @@ Public Class cVERAG_CustomsDeclarations
' "VERAG – CBAM Compliance Services"
' )
End If
- '================================================================
- End Select
+ '================================================================
+ End Select
End If
'=========================================================
Catch ex As Exception