This commit is contained in:
2026-10-16 10:30:42 +02:00
parent 1e4e1202f4
commit 5aae16e9cb

View File

@@ -1594,6 +1594,11 @@ Public Class cVERAG_CustomsDeclarations_TransitGuarantee
Public Property zaGRT_Reference As String
Public Property zaGRT_Amount As Decimal?
Public Property zaGRT_Currency As String
Public Property zaGRT_AmountForeign As Decimal?
Public Property zaGRT_CurrencyForeign As String
Public Property zaGRT_ExchangeRateToEUR As Decimal?
End Class
Public Class cVERAG_CustomsDeclarations_TransitOffice
Public Property zaTO_Sequence As Integer
@@ -1637,11 +1642,14 @@ Public NotInheritable Class cVERAG_NCTS_Repository
Using r = cmd.ExecuteReader()
While r.Read()
result.Add(New cVERAG_CustomsDeclarations_TransitGuarantee With {
.zaGRT_Type = If(r.IsDBNull(r.GetOrdinal("zaGRT_Type")), Nothing, CStr(r("zaGRT_Type"))),
.zaGRT_GRN = If(r.IsDBNull(r.GetOrdinal("zaGRT_GRN")), Nothing, CStr(r("zaGRT_GRN"))),
.zaGRT_Reference = If(r.IsDBNull(r.GetOrdinal("zaGRT_Reference")), Nothing, CStr(r("zaGRT_Reference"))),
.zaGRT_Amount = If(r.IsDBNull(r.GetOrdinal("zaGRT_Amount")), CType(Nothing, Decimal?), CDec(r("zaGRT_Amount"))),
.zaGRT_Currency = If(r.IsDBNull(r.GetOrdinal("zaGRT_Currency")), Nothing, CStr(r("zaGRT_Currency")))})
.zaGRT_Type = If(r.IsDBNull(r.GetOrdinal("zaGRT_Type")), Nothing, CStr(r("zaGRT_Type"))),
.zaGRT_GRN = If(r.IsDBNull(r.GetOrdinal("zaGRT_GRN")), Nothing, CStr(r("zaGRT_GRN"))),
.zaGRT_Reference = If(r.IsDBNull(r.GetOrdinal("zaGRT_Reference")), Nothing, CStr(r("zaGRT_Reference"))),
.zaGRT_Amount = If(r.IsDBNull(r.GetOrdinal("zaGRT_Amount")), CType(Nothing, Decimal?), CDec(r("zaGRT_Amount"))),
.zaGRT_Currency = If(r.IsDBNull(r.GetOrdinal("zaGRT_Currency")), Nothing, CStr(r("zaGRT_Currency"))),
.zaGRT_AmountForeign = If(r.IsDBNull(r.GetOrdinal("zaGRT_AmountForeign")), CType(Nothing, Decimal?), CDec(r("zaGRT_AmountForeign"))),
.zaGRT_CurrencyForeign = If(r.IsDBNull(r.GetOrdinal("zaGRT_CurrencyForeign")), Nothing, CStr(r("zaGRT_CurrencyForeign"))),
.zaGRT_ExchangeRateToEUR = If(r.IsDBNull(r.GetOrdinal("zaGRT_ExchangeRateToEUR")), CType(Nothing, Decimal?), CDec(r("zaGRT_ExchangeRateToEUR")))})
End While
End Using
End Using
@@ -1689,9 +1697,10 @@ Public NotInheritable Class cVERAG_NCTS_Repository
End If
Next
For Each g In If(guarantees, New List(Of cVERAG_CustomsDeclarations_TransitGuarantee))
Using cmd As New SqlCommand("INSERT INTO dbo.tblVERAG_CustomsDeclarations_TransitGuarantees (zaGRT_zaId,zaGRT_Type,zaGRT_GRN,zaGRT_Reference,zaGRT_Amount,zaGRT_Currency) VALUES (@id,@t,@g,@r,@a,@c)", cn, tx)
Using cmd As New SqlCommand("INSERT INTO dbo.tblVERAG_CustomsDeclarations_TransitGuarantees (zaGRT_zaId,zaGRT_Type,zaGRT_GRN,zaGRT_Reference,zaGRT_Amount,zaGRT_Currency,zaGRT_AmountForeign,zaGRT_CurrencyForeign,zaGRT_ExchangeRateToEUR) VALUES (@id,@t,@g,@r,@a,@c,@af,@cf,@rate)", cn, tx)
Add(cmd, "@id", zaId) : Add(cmd, "@t", g.zaGRT_Type) : Add(cmd, "@g", g.zaGRT_GRN)
Add(cmd, "@r", g.zaGRT_Reference) : Add(cmd, "@a", g.zaGRT_Amount) : Add(cmd, "@c", g.zaGRT_Currency)
Add(cmd, "@r", g.zaGRT_Reference) : Add(cmd, "@a", g.zaGRT_Amount) : Add(cmd, "@c", "EUR")
Add(cmd, "@af", g.zaGRT_AmountForeign) : Add(cmd, "@cf", g.zaGRT_CurrencyForeign) : Add(cmd, "@rate", g.zaGRT_ExchangeRateToEUR)
cmd.ExecuteNonQuery()
End Using
Next