Greenpulse, VERA_Customseclarations
This commit is contained in:
@@ -12,8 +12,8 @@ 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"})
|
||||
Dim exporter = GuessAddressByType(eza.eza_ADRESSEN, {"CZ", "EX", "EXP"})
|
||||
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"})
|
||||
|
||||
' --- Rechnungsdaten (Unterlagen N380) ---
|
||||
@@ -164,33 +164,196 @@ Public Class cDakosyEZA_Greenpulse
|
||||
If DY IsNot Nothing AndAlso DY.dy_SendungsId IsNot Nothing Then
|
||||
Dim sendungsId As Integer
|
||||
If Integer.TryParse(DY.dy_SendungsId.ToString(), sendungsId) AndAlso sendungsId > 0 Then
|
||||
|
||||
Dim ANH_LIST As New List(Of cAvisoAnhaenge)
|
||||
cAvisoAnhaenge.LOAD_LIST_BySendung(ANH_LIST, sendungsId)
|
||||
|
||||
For Each doc In ANH_LIST
|
||||
Select Case doc.anh_Art
|
||||
Case "Rechnung", "eFatura"
|
||||
|
||||
Dim pfad As String = VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(doc.anh_docId)
|
||||
Dim dateiBytes As Byte() = System.IO.File.ReadAllBytes(pfad)
|
||||
|
||||
Dim d As New cATEZ_Greenpulse_KafkaInvoices.DocumentNode With {
|
||||
.Reference = doc.anh_Name,
|
||||
.DocType = "invoice",
|
||||
.MimeType = cATEZ_Greenpulse_KafkaDecsBuilder_DAKOSY.GuessMimeTypeFromNumber(doc.anh_Typ),
|
||||
.Blob = Convert.ToBase64String(dateiBytes)
|
||||
}
|
||||
|
||||
dest.Documents.Add(d)
|
||||
End Select
|
||||
Next
|
||||
dest = BuildInvoices(sendungsId)
|
||||
End If
|
||||
End If
|
||||
|
||||
Return dest
|
||||
End Function
|
||||
|
||||
Public Shared Function BuildInvoices(sendungsId As Integer) As cATEZ_Greenpulse_KafkaInvoices
|
||||
|
||||
|
||||
' Zielobjekt NUR für Dokumente
|
||||
Dim dest As New cATEZ_Greenpulse_KafkaInvoices() With {
|
||||
.Documents = New List(Of cATEZ_Greenpulse_KafkaInvoices.DocumentNode)()
|
||||
}
|
||||
|
||||
|
||||
|
||||
If sendungsId > 0 Then
|
||||
|
||||
Dim ANH_LIST As New List(Of cAvisoAnhaenge)
|
||||
cAvisoAnhaenge.LOAD_LIST_BySendung(ANH_LIST, sendungsId)
|
||||
|
||||
For Each doc In ANH_LIST
|
||||
Select Case doc.anh_Art
|
||||
Case "Rechnung", "eFatura"
|
||||
|
||||
Dim pfad As String = VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(doc.anh_docId)
|
||||
Dim dateiBytes As Byte() = System.IO.File.ReadAllBytes(pfad)
|
||||
|
||||
Dim d As New cATEZ_Greenpulse_KafkaInvoices.DocumentNode With {
|
||||
.Reference = doc.anh_Name,
|
||||
.DocType = "invoice",
|
||||
.MimeType = cATEZ_Greenpulse_KafkaDecsBuilder_DAKOSY.GuessMimeTypeFromNumber(doc.anh_Typ),
|
||||
.Blob = Convert.ToBase64String(dateiBytes)
|
||||
}
|
||||
|
||||
dest.Documents.Add(d)
|
||||
End Select
|
||||
Next
|
||||
End If
|
||||
|
||||
Return dest
|
||||
End Function
|
||||
|
||||
Public Shared Function BuildByMrn(za As cVERAG_CustomsDeclarations) As cATEZ_Greenpulse_KafkaDecs
|
||||
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"})
|
||||
|
||||
' --- Rechnungsdaten (Header-Dokument N380) ---
|
||||
Dim inv = If(za.Documents IsNot Nothing,
|
||||
za.Documents.FirstOrDefault(Function(d) _
|
||||
SafeStr(d.zaDoc_Code).Equals("N380", StringComparison.OrdinalIgnoreCase) _
|
||||
AndAlso Not String.IsNullOrWhiteSpace(SafeStr(d.zaDoc_Reference))),
|
||||
Nothing)
|
||||
|
||||
' --- Zielobjekt ---
|
||||
Dim dest As New cATEZ_Greenpulse_KafkaDecs With {
|
||||
.Declaration = New cATEZ_Greenpulse_KafkaDecs.DeclarationNode With {
|
||||
.DeclarationSourceId = SafeStr(za.za_Id),
|
||||
.DeclarationNo = FirstNonEmptyStr(za.za_MRN, za.za_DeclarationNo),
|
||||
.DeclarationDate = ToDateYMD(FirstNonEmpty(za.za_DeclarationDate, za.za_ReleaseDate, za.za_AcceptanceDate)),
|
||||
.RequestedProcedure = SafeStr(za.za_MainProcedure),
|
||||
.PreviousProcedure = "",
|
||||
.Goods = New List(Of cATEZ_Greenpulse_KafkaDecs.GoodItem)()
|
||||
},
|
||||
.Parties = New cATEZ_Greenpulse_KafkaDecs.PartiesNode With {
|
||||
.ImporterIdentificationNumber = FirstNonEmptyStr(
|
||||
If(importer IsNot Nothing, importer.zaParty_EORI, Nothing),
|
||||
If(importer IsNot Nothing, importer.zaParty_TIN, Nothing)
|
||||
),
|
||||
.ExporterIdentificationNumber = FirstNonEmptyStr(
|
||||
If(exporter IsNot Nothing, exporter.zaParty_EORI, Nothing),
|
||||
If(exporter IsNot Nothing, exporter.zaParty_TIN, Nothing)
|
||||
),
|
||||
.TypeOfRepresentation = SafeStr(za.za_RepresentationCode)
|
||||
},
|
||||
.Commercial = New cATEZ_Greenpulse_KafkaDecs.CommercialNode With {
|
||||
.InvoiceNumbers = If(inv IsNot Nothing, SafeStr(inv.zaDoc_Reference), ""),
|
||||
.InvoiceDate = If(inv IsNot Nothing, ToDateYMD(inv.zaDoc_Date), "")
|
||||
},
|
||||
.ExporterDetails = New cATEZ_Greenpulse_KafkaDecs.ExporterDetailsNode With {
|
||||
.ExporterTitle = If(exporter IsNot Nothing, SafeStr(exporter.zaParty_Name), ""),
|
||||
.ExporterEmail = If(exporter IsNot Nothing, SafeStr(exporter.zaParty_Email), ""),
|
||||
.ExporterPhone = If(exporter IsNot Nothing, SafeStr(exporter.zaParty_Phone), "")
|
||||
},
|
||||
.ImporterDetails = New cATEZ_Greenpulse_KafkaDecs.ImporterDetailsNode With {
|
||||
.ImporterTitle = If(importer IsNot Nothing, SafeStr(importer.zaParty_Name), ""),
|
||||
.ImporterEmail = If(importer IsNot Nothing, SafeStr(importer.zaParty_Email), ""),
|
||||
.ImporterPhone = If(importer IsNot Nothing, SafeStr(importer.zaParty_Phone), ""),
|
||||
.ImporterCountryCodeOrMemberState = If(importer IsNot Nothing, SafeStr(importer.zaParty_Country), ""),
|
||||
.ImporterSubdivision = "",
|
||||
.ImporterCity = If(importer IsNot Nothing, SafeStr(importer.zaParty_City), ""),
|
||||
.ImporterStreet = If(importer IsNot Nothing, SafeStr(importer.zaParty_Street), ""),
|
||||
.ImporterStreetAdditional = "",
|
||||
.ImporterAddressNumber = "",
|
||||
.ImporterPostCode = If(importer IsNot Nothing, SafeStr(importer.zaParty_PostalCode), ""),
|
||||
.ImporterPoBox = "",
|
||||
.ImporterCoordinateLongitudeX = "",
|
||||
.ImporterCoordinateLatitudeY = ""
|
||||
},
|
||||
.Documents = New List(Of cATEZ_Greenpulse_KafkaDecs.DocumentNode)()
|
||||
}
|
||||
|
||||
Select Case za.za_System
|
||||
Case "DAKOSY"
|
||||
Select Case If(za.za_RepresentationCode, "")
|
||||
Case "2" : dest.Parties.ReportingDeclarantEORINumber = If(declarant IsNot Nothing, declarant.zaParty_EORI, Nothing) ' '2=indirekt
|
||||
Case Else : dest.Parties.ReportingDeclarantEORINumber = If(importer IsNot Nothing, importer.zaParty_EORI, Nothing) ' direkt
|
||||
End Select
|
||||
Case "DHF", "DHF_UNISPED"
|
||||
Select Case If(za.za_RepresentationCode, "")
|
||||
Case "3" : dest.Parties.ReportingDeclarantEORINumber = If(declarant IsNot Nothing, declarant.zaParty_EORI, Nothing) ' 'indirekt
|
||||
Case "5"
|
||||
If If(za.za_ApplicantTaxOffice, "") = "73001" Then : dest.Parties.ReportingDeclarantEORINumber = If(declarant IsNot Nothing, declarant.zaParty_EORI, Nothing) ' 'indirekt '!!!!!!!!!!!!!!!!!!!!!! za_ApplicantTaxOffice stimmt nciht!!!!!
|
||||
Else : dest.Parties.ReportingDeclarantEORINumber = If(importer IsNot Nothing, importer.zaParty_EORI, Nothing) : End If ' direkt
|
||||
Case Else : dest.Parties.ReportingDeclarantEORINumber = If(importer IsNot Nothing, importer.zaParty_EORI, Nothing) ' direkt
|
||||
End Select
|
||||
Case "TELOTEC"
|
||||
Select Case If(za.za_RepresentationCode, "")
|
||||
Case "3" : dest.Parties.ReportingDeclarantEORINumber = If(declarant IsNot Nothing, declarant.zaParty_EORI, Nothing) ' '3=indirekt
|
||||
Case "5"
|
||||
If If(za.za_ApplicantTaxOffice, "") = "73001" Then : dest.Parties.ReportingDeclarantEORINumber = If(declarant IsNot Nothing, declarant.zaParty_EORI, Nothing) ' 'indirekt '!!!!!!!!!!!!!!!!!!!!!! za_ApplicantTaxOffice stimmt nciht!!!!!
|
||||
Else : dest.Parties.ReportingDeclarantEORINumber = If(importer IsNot Nothing, importer.zaParty_EORI, Nothing) : End If ' direkt
|
||||
Case Else : dest.Parties.ReportingDeclarantEORINumber = If(importer IsNot Nothing, importer.zaParty_EORI, Nothing) ' direkt
|
||||
End Select
|
||||
End Select
|
||||
|
||||
|
||||
' --- EORI-Lookups (optional, wie bisher) ---
|
||||
Dim impEori As String = SafeStr(If(importer IsNot Nothing, importer.zaParty_EORI, Nothing))
|
||||
If Not String.IsNullOrWhiteSpace(impEori) Then
|
||||
PopulateImporterByEori(impEori, dest.Parties, dest.ImporterDetails)
|
||||
End If
|
||||
|
||||
Dim expEori As String = SafeStr(If(exporter IsNot Nothing, exporter.zaParty_EORI, Nothing))
|
||||
If Not String.IsNullOrWhiteSpace(expEori) Then
|
||||
PopulateExporterByEori(expEori, dest.Parties, dest.ExporterDetails)
|
||||
End If
|
||||
|
||||
Dim decEori As String = SafeStr(If(declarant IsNot Nothing, declarant.zaParty_EORI, Nothing))
|
||||
If Not String.IsNullOrWhiteSpace(decEori) Then
|
||||
PopulateDeclarantByEori(decEori, dest.Parties)
|
||||
End If
|
||||
|
||||
' --- Warenpositionen -> Goods ---
|
||||
If za.Items IsNot Nothing Then
|
||||
For Each it In za.Items
|
||||
Dim gi As New cATEZ_Greenpulse_KafkaDecs.GoodItem With {
|
||||
.CommodityCode = SafeStr(it.zaItem_HSCode),
|
||||
.OriginCountryCode = SafeStr(it.zaItem_OriginCountry),
|
||||
.NetMass = ToInvariantStr(it.zaItem_NetMass),
|
||||
.TypeOfMeasurementUnit = UnitCodeToKafkaName("KGM"),
|
||||
.SpecialProcedures = New cATEZ_Greenpulse_KafkaDecs.SpecialProceduresNode With {
|
||||
.MemberStateAutharization = SafeStr(If(importer IsNot Nothing, importer.zaParty_Country, Nothing)),
|
||||
.DischargeBillWaiver = "",
|
||||
.Authorisation = "",
|
||||
.StartTime = "",
|
||||
.EndTime = "",
|
||||
.Deadline = ""
|
||||
}
|
||||
}
|
||||
dest.Declaration.Goods.Add(gi)
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
' --- Requested/Previous Procedure Fallback aus erster Position ---
|
||||
Dim it0 = If(za.Items IsNot Nothing, za.Items.FirstOrDefault(), Nothing)
|
||||
If it0 IsNot Nothing Then
|
||||
If String.IsNullOrWhiteSpace(dest.Declaration.RequestedProcedure) Then
|
||||
dest.Declaration.RequestedProcedure = SafeStr(it0.zaItem_MainProcedure)
|
||||
End If
|
||||
dest.Declaration.PreviousProcedure = SafeStr(it0.zaItem_PrevProcedure)
|
||||
End If
|
||||
|
||||
Return dest
|
||||
End Function
|
||||
|
||||
Private Shared Function GuessPartyByRole(parties As List(Of cVERAG_CustomsDeclarations_Parties),
|
||||
roles As IEnumerable(Of String)) _
|
||||
As cVERAG_CustomsDeclarations_Parties
|
||||
If parties Is Nothing Then Return Nothing
|
||||
Return parties.FirstOrDefault(Function(p) roles.Any(
|
||||
Function(r) SafeStr(p.zaParty_Role).Equals(r, StringComparison.OrdinalIgnoreCase)))
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ Public Class cImporter_DHFToVERAG
|
||||
' MsgBox(AnmID)
|
||||
Dim LRN As String = ToStringSafe(rRef("LRN"))
|
||||
|
||||
|
||||
' ---------------------------------------------------------------
|
||||
' DUPLIKAT
|
||||
' ---------------------------------------------------------------
|
||||
@@ -63,10 +64,19 @@ Public Class cImporter_DHFToVERAG
|
||||
ZA.za_MRN = CRN
|
||||
ZA.za_LRN = LRN
|
||||
|
||||
getFirmaNLFrom_OP(OperatorID, ZA.za_Firma, ZA.za_Niederlassung)
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.tryGetFirmaNiederlassung(ZA.za_Firma, ZA.za_Niederlassung, "", LRN)
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.tryGetAvisoId_SndId_ByLRN(ZA.za_LRN, ZA.za_AvisoId, ZA.za_SendungsId)
|
||||
|
||||
|
||||
ZA.za_DeclarationDate = ToNullableDate(h("DecDT"))
|
||||
ZA.za_AcceptanceDate = ToNullableDate(h("AccDT"))
|
||||
ZA.za_ReleaseDate = ToNullableDate(h("DecDT"))
|
||||
|
||||
ZA.za_TotGrossMass = ToNullableDecimal(h("TotGross"))
|
||||
|
||||
|
||||
''ZA.za_CountryDispatch = ToStringSafe(h("Locs_Disp"))
|
||||
' ZA.za_CountryDestination = ToStringSafe(h("Locs_Dest"))
|
||||
ZA.za_CountryImport = "AT"
|
||||
@@ -85,9 +95,21 @@ Public Class cImporter_DHFToVERAG
|
||||
|
||||
If dtTransp.Rows.Count > 0 Then
|
||||
ZA.za_MeansOfTransport_Vehicle = ToStringSafe(dtTransp.Rows(0)("DepIdnt"))
|
||||
ZA.za_TransportModeInland = ToStringSafe(dtTransp.Rows(0)("InMo"))
|
||||
ZA.za_TransportModeBorder = ToStringSafe(dtTransp.Rows(0)("BordMo"))
|
||||
End If
|
||||
|
||||
' ---------------------------------------------------------------
|
||||
' TRANSPORT (zsAnmTransp)
|
||||
' ---------------------------------------------------------------
|
||||
Dim dtAnmRepresent = SQL.loadDgvBySql(
|
||||
$"SELECT * FROM [zsAnmRepresent] WHERE LizenzNr='{LizenzNr}' AND OperatorID={OperatorID} AND VorgangID='{VorgangID}' AND AnmID={AnmID}",
|
||||
EZOLL_DB)
|
||||
|
||||
If dtAnmRepresent.Rows.Count > 0 Then
|
||||
ZA.za_Sachbearbeiter = ToStringSafe(dtAnmRepresent.Rows(0)("Na"))
|
||||
End If
|
||||
|
||||
' ---------------------------------------------------------------
|
||||
' VALUE DATA (zsAnmValData)
|
||||
' ---------------------------------------------------------------
|
||||
@@ -131,20 +153,17 @@ Public Class cImporter_DHFToVERAG
|
||||
|
||||
it.zaItem_PosNo = r("GdsItemID")
|
||||
it.zaItem_HSCode = ToStringSafe(r("ComCd"))
|
||||
it.zaItem_HSAddCodes4 = ToStringSafe(r("ComCd"))
|
||||
it.zaItem_Description = ToStringSafe(r("GdsDes"))
|
||||
it.zaItem_OriginCountry = ToStringSafe(r("Orig"))
|
||||
it.zaItem_NetMass = ToNullableDecimal(r("Net"))
|
||||
it.zaItem_InvoiceValueEUR = ToNullableDecimal(r("ItVal"))
|
||||
it.zaItem_StatisticalValueEUR = ToNullableDecimal(r("StatVal"))
|
||||
it.zaItem_StatisticalValueEUR = ToNullableDecimal(r("StatVal"))
|
||||
it.zaItem_StatisticalValueEUR = ToNullableDecimal(r("StatVal"))
|
||||
|
||||
LoadEZOLL_HSAddCodes(it, LizenzNr, OperatorID, VorgangID, AnmID, r("GdsItemID"))
|
||||
LoadEZOLL_ItemDocuments(it, LizenzNr, OperatorID, VorgangID, AnmID)
|
||||
|
||||
it.zaItem_MainProcedure = ToStringSafe(r("ProcCd"))
|
||||
it.zaItem_AdditionalProc = ToStringSafe(r("ProcAddCd"))
|
||||
it.zaItem_OriginCountry = ToStringSafe(r("Orig"))
|
||||
it.zaItem_PreferenceCode = ToStringSafe(r("Pref"))
|
||||
it.zaItem_QuotaNo = ToStringSafe(r("Quota"))
|
||||
' -------------------------------
|
||||
@@ -302,7 +321,7 @@ Public Class cImporter_DHFToVERAG
|
||||
|
||||
' =====================================================================
|
||||
' HELPER
|
||||
' =====================================================================
|
||||
' =====================================================================
|
||||
Private Sub AddPartyFromEZOLL(ByRef ZA As cVERAG_CustomsDeclarations,
|
||||
role As String,
|
||||
tableName As String,
|
||||
@@ -315,6 +334,7 @@ Public Class cImporter_DHFToVERAG
|
||||
If dt.Rows.Count = 0 Then Exit Sub
|
||||
Dim r = dt.Rows(0)
|
||||
|
||||
|
||||
Dim p As New cVERAG_CustomsDeclarations_Parties With {
|
||||
.zaParty_Role = role,
|
||||
.zaParty_Name = ToStringSafe(r("Na")),
|
||||
@@ -324,9 +344,32 @@ Public Class cImporter_DHFToVERAG
|
||||
.zaParty_Country = ToStringSafe(r("Ctry")),
|
||||
.zaParty_EORI = ToStringSafe(r("TIN"))
|
||||
}
|
||||
If role = "DECLARANT" Then
|
||||
ZA.za_RepresentationCode = ToStringSafe(r("DecRep"))
|
||||
End If
|
||||
|
||||
If role = "IMPORTER" Then
|
||||
ZA.za_CountryDestination = p.zaParty_Country
|
||||
End If
|
||||
|
||||
If role = "EXPORTER" Then
|
||||
ZA.za_CountryDispatch = p.zaParty_Country
|
||||
End If
|
||||
|
||||
ZA.Parties.Add(p)
|
||||
End Sub
|
||||
Private Sub getFirmaNLFrom_OP(OperatorID As String, ByRef Firma As String, ByRef NL As String)
|
||||
|
||||
Select Case OperatorID
|
||||
Case 1 : Firma = "VERAG" : NL = "SUB"
|
||||
Case 2 : Firma = "VERAG" : NL = "SBG"
|
||||
Case 3 : Firma = "VERAG" : NL = "NKD"
|
||||
Case 4 : Firma = "VERAG" : NL = "SUB"
|
||||
Case 5 : Firma = "ATILLA" : NL = "SUB"
|
||||
Case 6 : Firma = "VERAG" : NL = "SUB"
|
||||
Case 8 : Firma = "DURMAZ" : NL = "SUB"
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub LoadEZOLL_HSAddCodes(ByRef item As cVERAG_CustomsDeclarations_Item,
|
||||
LizenzNr As String,
|
||||
|
||||
@@ -51,9 +51,20 @@ Public Class cImporter_DakosyToVERAG
|
||||
VERAG_ZA.za_Firma = eza.eza_firma
|
||||
VERAG_ZA.za_Niederlassung = eza.eza_niederlassung
|
||||
|
||||
|
||||
VERAG_ZA.za_MRN = If(eza.eza_MRN, eza.eza_ANR)
|
||||
VERAG_ZA.za_LRN = eza.eza_ObjectName
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.tryGetFirmaNiederlassung(VERAG_ZA.za_Firma, VERAG_ZA.za_Niederlassung, "", VERAG_ZA.za_LRN)
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.tryGetAvisoId_SndId_ByLRN(VERAG_ZA.za_LRN, VERAG_ZA.za_AvisoId, VERAG_ZA.za_SendungsId)
|
||||
|
||||
Dim DY = cDakosy_Zollanmeldungen.LOADById(eza.eza_dyaAnmID)
|
||||
If DY IsNot Nothing Then
|
||||
If VERAG_ZA.za_AvisoId Is Nothing AndAlso DY.dy_AvisoId IsNot Nothing Then VERAG_ZA.za_AvisoId = DY.dy_AvisoId
|
||||
If VERAG_ZA.za_SendungsId Is Nothing AndAlso DY.dy_SendungsId IsNot Nothing Then VERAG_ZA.za_SendungsId = DY.dy_SendungsId
|
||||
End If
|
||||
|
||||
|
||||
If eza.eza_Anmeldedatum IsNot Nothing AndAlso eza.eza_Anmeldedatum.ToString <> "" Then
|
||||
VERAG_ZA.za_DeclarationDate = CDate(eza.eza_Anmeldedatum)
|
||||
VERAG_ZA.za_ReleaseDate = CDate(eza.eza_Anmeldedatum)
|
||||
@@ -105,12 +116,8 @@ Public Class cImporter_DakosyToVERAG
|
||||
VERAG_ZA.za_IncotermsPlace = eza.eza_LieferbedingungOrt
|
||||
|
||||
VERAG_ZA.za_Sachbearbeiter = eza.eza_AnmeldenderBearbeiterName
|
||||
VERAG_ZA.za_TotGrossMass = ToNullableDecimal(eza.eza_GesamtRohmasse)
|
||||
|
||||
Dim DY = cDakosy_Zollanmeldungen.LOADById(eza.eza_dyaAnmID)
|
||||
If DY IsNot Nothing Then
|
||||
VERAG_ZA.za_AvisoId = DY.dy_AvisoId
|
||||
VERAG_ZA.za_SendungsId = DY.dy_SendungsId
|
||||
End If
|
||||
|
||||
VERAG_ZA.za_TransportModeBorder = ToStringSafe(eza.eza_VerkehrszweigGrenze)
|
||||
|
||||
@@ -230,6 +237,7 @@ Public Class cImporter_DakosyToVERAG
|
||||
item.zaItem_Description = wp.ezaWP_Warenbezeichnung
|
||||
item.zaItem_PrevProcedure = wp.ezaWP_VerfahrensCodeVorangegangenesVerfahren
|
||||
item.zaItem_PreferentialCountry = wp.ezaWP_Praeferenzursprungsland
|
||||
item.zaItem_MainProcedure = wp.ezaWP_AnmeldeVErfahren
|
||||
|
||||
|
||||
item.zaItem_PackageColli = (wp.ezaWP_PackstueckAnzahl)
|
||||
|
||||
@@ -51,9 +51,16 @@ Public Class cImporter_TelotecToVERAG
|
||||
ZA.za_Firma = ToStringSafe(tel.telanm_firma)
|
||||
ZA.za_Niederlassung = ToStringSafe(tel.telanm_niederlassung)
|
||||
|
||||
|
||||
ZA.za_MRN = ToStringSafe(tel.Refs_CRN)
|
||||
ZA.za_LRN = ToStringSafe(tel.Refs_LRN)
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.tryGetFirmaNiederlassung(ZA.za_Firma, ZA.za_Niederlassung, "", ZA.za_LRN)
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.tryGetAvisoId_SndId_ByLRN(ZA.za_LRN, ZA.za_AvisoId, ZA.za_SendungsId)
|
||||
|
||||
If ZA.za_AvisoId Is Nothing AndAlso tel.telanm_AvisoId IsNot Nothing Then ZA.za_AvisoId = tel.telanm_AvisoId
|
||||
If ZA.za_SendungsId Is Nothing AndAlso tel.telanm_SendungsId IsNot Nothing Then ZA.za_SendungsId = tel.telanm_SendungsId
|
||||
|
||||
|
||||
ZA.za_RepresentationCode = ToStringSafe(tel.Declarant_DecRep)
|
||||
|
||||
@@ -86,8 +93,6 @@ Public Class cImporter_TelotecToVERAG
|
||||
ZA.za_Incoterms = ToStringSafe(tel.ValData_TermDelCd)
|
||||
ZA.za_IncotermsPlace = ToStringSafe(tel.ValData_TermDelPlc)
|
||||
|
||||
ZA.za_AvisoId = tel.telanm_AvisoId
|
||||
ZA.za_SendungsId = tel.telanm_SendungsId
|
||||
|
||||
ZA.za_Sachbearbeiter = tel.telanm_LetzteBearbeitung_SB
|
||||
|
||||
|
||||
@@ -9135,7 +9135,7 @@ Public Class frmDYNachrichtenVerarbeitung
|
||||
|
||||
'=====IMPORT IN VERAG DATENMODELL==========
|
||||
Dim IMP As New DAKOSY_Worker.cImporter_DakosyToVERAG
|
||||
IMP.ImportDakosyEZA(EZA_TMP)
|
||||
IMP.ImportDakosyEZA(EZA_TMP, False)
|
||||
'==================================
|
||||
|
||||
'=====ATEZ BEREITSTELLUNG==========
|
||||
@@ -10339,7 +10339,7 @@ Public Class frmDYNachrichtenVerarbeitung
|
||||
|
||||
'=====IMPORT IN VERAG DATENMODELL==========
|
||||
Dim IMP As New DAKOSY_Worker.cImporter_DakosyToVERAG
|
||||
IMP.ImportDakosyEZA(EZA_TMP)
|
||||
IMP.ImportDakosyEZA(EZA_TMP, False)
|
||||
'==================================
|
||||
|
||||
|
||||
|
||||
@@ -1001,8 +1001,8 @@ Public Class frmStartOptions
|
||||
'=====IMPORT IN VERAG DATENMODELL==========
|
||||
Dim IMP As New DAKOSY_Worker.cImporter_DHFToVERAG
|
||||
Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
|
||||
Case "UNIDPED" : IMP.ImportEZOLLByLRN(cDHF_Anhaenge.CRN, "EZOLL_UNISPED")
|
||||
Case Else : IMP.ImportEZOLLByLRN(cDHF_Anhaenge.CRN, "EZOLL")
|
||||
Case "UNIDPED" : IMP.ImportEZOLLByLRN(cDHF_Anhaenge.CRN, "EZOLL_UNISPED", False)
|
||||
Case Else : IMP.ImportEZOLLByLRN(cDHF_Anhaenge.CRN, "EZOLL", False)
|
||||
End Select
|
||||
'==========================================
|
||||
|
||||
@@ -2620,14 +2620,18 @@ Public Class frmStartOptions
|
||||
destFull = ""
|
||||
moveFile(pfad, ZIEL_PFAD, destFull)
|
||||
|
||||
Try
|
||||
|
||||
If DS.insertDataToDATENSERVER(destFull) Then
|
||||
If IsNumeric(dy_id) AndAlso dy_id > 0 Then
|
||||
sql.doSQL("UPDATE tblDakosy_Zollanmeldungen SET dy_VBD_dsId='" & DS.da_id & "' where dy_id='" & dy_id & "'", "FMZOLL")
|
||||
sql.doSQL("UPDATE Speditionsbuch SET DokumentId_VBD='" & DS.da_id & "' where AtlasBezNrNCTS='" & betreff.ToString.Trim & "' AND DokumentId_VBD is null", "FMZOLL") 'Falls Spedbuch schon zuvor generiert wurde!
|
||||
doMailZollbeleg(DS.GET_TOP1_PATH, "VBD", dy_id)
|
||||
If DS.insertDataToDATENSERVER(destFull) Then
|
||||
If IsNumeric(dy_id) AndAlso dy_id > 0 Then
|
||||
sql.doSQL("UPDATE tblDakosy_Zollanmeldungen SET dy_VBD_dsId='" & DS.da_id & "' where dy_id='" & dy_id & "'", "FMZOLL")
|
||||
sql.doSQL("UPDATE Speditionsbuch SET DokumentId_VBD='" & DS.da_id & "' where AtlasBezNrNCTS='" & betreff.ToString.Trim & "' AND DokumentId_VBD is null", "FMZOLL") 'Falls Spedbuch schon zuvor generiert wurde!
|
||||
doMailZollbeleg(DS.GET_TOP1_PATH, "VBD", dy_id)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, "Pfad: " & destFull & vbNewLine & vbNewLine & ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -1058,7 +1058,7 @@ Public Class frmTCNachrichtenVerarbeitung
|
||||
'=====IMPORT IN VERAG DATENMODELL==========
|
||||
If TC.Hea_DecTy = "EUA" Then
|
||||
Dim IMP As New DAKOSY_Worker.cImporter_TelotecToVERAG
|
||||
IMP.ImportTelotec(TC)
|
||||
IMP.ImportTelotec(TC, False)
|
||||
End If
|
||||
'==================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user