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

View File

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

View File

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