This commit is contained in:
2026-01-15 10:50:09 +01:00
parent eb4fdfaf58
commit cb60a0eb16
3 changed files with 33 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
Imports System.Globalization
Imports io.konik.zugferd
Imports javax.management.relation
Imports Newtonsoft.Json
Imports VERAG_PROG_ALLGEMEIN
@@ -12,9 +13,9 @@ Public Class cDakosyEZA_Greenpulse
If eza Is Nothing Then Throw New ArgumentNullException(NameOf(eza))
' --- Adressen (Heuristik: CN=Importer, CZ=Exporter, DT=Declarant) ---
Dim importer = GuessAddressByType(eza.eza_ADRESSEN, {"CN", "IM", "IMP", "IMPORTER"})
Dim exporter = GuessAddressByType(eza.eza_ADRESSEN, {"CZ", "EX", "EXP", "EXPORTER"})
Dim declarant = GuessAddressByType(eza.eza_ADRESSEN, {"DT", "DEC", "ANM", "DECLARANT"})
Dim importer = GuessAddressByType(eza.eza_ADRESSEN, cVERAG_CustomsDeclarations.IMPORTER_ROLES)
Dim exporter = GuessAddressByType(eza.eza_ADRESSEN, cVERAG_CustomsDeclarations.EXPORTER_ROLES)
Dim declarant = GuessAddressByType(eza.eza_ADRESSEN, cVERAG_CustomsDeclarations.DECLARANT_ROLES)
' --- Rechnungsdaten (Unterlagen N380) ---
Dim inv = If(eza.eza_UNTERLAGEN IsNot Nothing,
@@ -236,9 +237,9 @@ Public Class cDakosyEZA_Greenpulse
If za Is Nothing Then Throw New ArgumentNullException(NameOf(za))
' --- Parties (Heuristik über zaParty_Role) ---
Dim importer = GuessPartyByRole(za.Parties, {"CN", "IMPORTER", "IM"})
Dim exporter = GuessPartyByRole(za.Parties, {"CZ", "EXPORTER", "EX"})
Dim declarant = GuessPartyByRole(za.Parties, {"CB", "DECLARANT", "DEC"})
Dim importer = GuessPartyByRole(za.Parties, cVERAG_CustomsDeclarations.IMPORTER_ROLES)
Dim exporter = GuessPartyByRole(za.Parties, cVERAG_CustomsDeclarations.EXPORTER_ROLES)
Dim declarant = GuessPartyByRole(za.Parties, cVERAG_CustomsDeclarations.DECLARANT_ROLES)
' --- Rechnungsdaten (Header-Dokument N380) ---
Dim inv = If(za.Documents IsNot Nothing,

View File

@@ -357,11 +357,11 @@ Public Class cImporter_DHFToVERAG
ZA.za_RepresentationCode = ToStringSafe(r("DecRep"))
End If
If role = "IMPORTER" Then
If role = "IMPORTER" Or role = "CONSINEE" Then
ZA.za_CountryDestination = p.zaParty_Country
End If
If role = "EXPORTER" Then
If role = "EXPORTER" Or role = "CONSINOR" Then
ZA.za_CountryDispatch = p.zaParty_Country
End If

View File

@@ -164,16 +164,24 @@ Public Class cImporter_TelotecToVERAG
' ------------------------------------------------------------
' DOKUMENTE
' ------------------------------------------------------------
For Each doc In p.DOC_CERTS
Dim dd As New cVERAG_CustomsDeclarations_Document With {
.zaDoc_ItemId = Nothing,
.zaDoc_Code = ToStringSafe(doc.DocCerts_DocCd),
.zaDoc_Reference = ToStringSafe(doc.DocCerts_DRef),
.zaDoc_Date = ToNullableDate(doc.DocCerts_IssD)
}
it.Documents.Add(dd)
Try
Dim dd As New cVERAG_CustomsDeclarations_Document With {
.zaDoc_ItemId = Nothing,
.zaDoc_Code = ToStringSafe(doc.DocCerts_DocCd),
.zaDoc_Reference = ToStringSafe(doc.DocCerts_DRef),
.zaDoc_Date = ToNullableDate(doc.DocCerts_IssD)
}
it.Documents.Add(dd)
Catch ex As Exception
cErrorHandler.ERR(ex.Message, ex.StackTrace, MethodInfo.GetCurrentMethod.Name)
End Try
Next
ZA.Items.Add(it)
Next
@@ -220,14 +228,14 @@ Public Class cImporter_TelotecToVERAG
' PARTY HELPER
' =====================================================================
Private Sub AddParty(za As cVERAG_CustomsDeclarations,
eori As String,
role As String,
name As Object,
street As Object,
plz As Object,
city As Object,
country As Object,
uid As Object)
role As String,
eori As String,
name As Object,
street As Object,
plz As Object,
city As Object,
country As Object,
uid As Object)
If String.IsNullOrWhiteSpace(ToStringSafe(name)) Then Exit Sub
@@ -261,7 +269,7 @@ Public Class cImporter_TelotecToVERAG
' Small helpers (falls du sie schon hast, kannst du diese entfernen)
' =========================================================================
Private Function ToStringSafe(v As Object) As String
If v Is Nothing Then Return Nothing
If v Is Nothing Then Return ""
Dim s As String = TryCast(v, String)
If s IsNot Nothing Then Return s
Return Convert.ToString(v, Globalization.CultureInfo.InvariantCulture)