cbam
This commit is contained in:
@@ -146,7 +146,7 @@ Public Class cATEZ_Greenpulse_CBAM_CostCalculation
|
||||
' ------------------------------------------------------------------------
|
||||
' calcCBAM – mit automatischem Fallback auf CN-Code Defaults
|
||||
' ------------------------------------------------------------------------
|
||||
Public Shared Function calcCBAM(cn_code As String, weight As Object, country_code As String, Optional ByRef see_total As Object = Nothing, Optional year As Object = Nothing, Optional ByRef benchmark_value As Object = Nothing, Optional ByRef CBAM_COST As Decimal = -1, Optional ByRef CBAM_EMISSION As Decimal = -1) As String
|
||||
Public Shared Function calcCBAM(cn_code As String, weight As Object, country_code As String, Optional ByRef see_total As Object = Nothing, Optional year As Object = Nothing, Optional ByRef benchmark_value As Object = Nothing, 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
|
||||
|
||||
' ------------------------------------------------------------
|
||||
' Basis-Validierung
|
||||
@@ -281,6 +281,8 @@ Public Class cATEZ_Greenpulse_CBAM_CostCalculation
|
||||
s &= $"CBAM Kosten: {d.cost:N2} {d.currency}" & vbCrLf
|
||||
CBAM_COST = d.cost
|
||||
CBAM_EMISSION = see_total
|
||||
CBAM_BENCHMARK = benchmark_value
|
||||
CBAM_FAKTOR = d.phase_factor
|
||||
Return s
|
||||
|
||||
End Function
|
||||
|
||||
@@ -224,8 +224,9 @@ Public Class cVERAG_CustomsDeclarations
|
||||
' ------------------------------------------------------------
|
||||
' CBAM Pattern (HSCode)
|
||||
' ------------------------------------------------------------
|
||||
Dim cbamWhere As String =
|
||||
VERAG_PROG_ALLGEMEIN.cGreendeal_CBAM_Trn.BuildCBAMPatternWhereClause("i.zaItem_HSCode")
|
||||
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")
|
||||
|
||||
|
||||
' ------------------------------------------------------------
|
||||
' SQL: ZA-IDs ermitteln
|
||||
@@ -263,6 +264,7 @@ Public Class cVERAG_CustomsDeclarations
|
||||
If CustomsSystem <> "" Then
|
||||
sqlstr &= " AND z.za_System = @sys "
|
||||
End If
|
||||
|
||||
Using conn = SQL.GetNewOpenConnectionFMZOLL()
|
||||
Using cmd As New SqlCommand(sqlstr, conn)
|
||||
|
||||
@@ -306,7 +308,7 @@ Public Class cVERAG_CustomsDeclarations
|
||||
' ------------------------------------------------
|
||||
If loadAll Then
|
||||
CD.Parties = cVERAG_CustomsDeclarations_Parties.LOAD_BY_ZAID(CD.za_Id)
|
||||
CD.Items = cVERAG_CustomsDeclarations_Item.LOAD_BY_ZAID(CD.za_Id)
|
||||
CD.Items = cVERAG_CustomsDeclarations_Item.LOAD_BY_ZAID(CD.za_Id, cbamWhereSnd)
|
||||
CD.Duties = cVERAG_CustomsDeclarations_Duty.LOAD_BY_ZAID(CD.za_Id)
|
||||
CD.Documents = cVERAG_CustomsDeclarations_Document.LOAD_HEAD_BY_ZAID(CD.za_Id)
|
||||
End If
|
||||
@@ -988,7 +990,7 @@ Public Class cVERAG_CustomsDeclarations_Item
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Shared Function LOAD_BY_ZAID(zaId As Integer) As List(Of cVERAG_CustomsDeclarations_Item)
|
||||
Public Shared Function LOAD_BY_ZAID(zaId As Integer, Optional where As String = "") As List(Of cVERAG_CustomsDeclarations_Item)
|
||||
|
||||
Dim result As New List(Of cVERAG_CustomsDeclarations_Item)
|
||||
|
||||
@@ -996,8 +998,7 @@ Public Class cVERAG_CustomsDeclarations_Item
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
|
||||
Using cmd As New SqlCommand(
|
||||
"SELECT * FROM tblVERAG_CustomsDeclarations_Items WHERE zaItem_zaId=@zaId",
|
||||
conn)
|
||||
"SELECT * FROM tblVERAG_CustomsDeclarations_Items WHERE zaItem_zaId=@zaId " & where, conn)
|
||||
|
||||
cmd.Parameters.AddWithValue("@zaId", zaId)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user