This commit is contained in:
2020-06-22 13:32:28 +02:00
parent 3d67139c09
commit 2d85480c4c
25 changed files with 30373 additions and 2360 deletions

View File

@@ -77,7 +77,9 @@ Public Class frmDYNachrichtenVerarbeitung
Me.Enabled = False
Try
Label5.Visible = True
DatenEinlesen()
DatenEinlesen() '<<<<----------------------
If dsNichtErkannt > 0 Then
Label6.Text = dsNichtErkannt & " Datensätze nicht " & vbNewLine & "erkannt."
@@ -331,7 +333,13 @@ Public Class frmDYNachrichtenVerarbeitung
found = True
End If
End If
'EZA: FreierVerkehrAktVeredelUmwandlung NEU XML
If Not found AndAlso cGetMsgType.isEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD(doc) Then
Dim bezugsNr = readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD(doc)
If bezugsNr <> "" Then
found = True
End If
End If
'EZA: EntscheidungAnmeldung
If Not found And cGetMsgType.isEZA_EntscheidungAnmeldung(doc) Then
@@ -2409,6 +2417,621 @@ Public Class frmDYNachrichtenVerarbeitung
Function readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD(doc As XmlDocument) As String
Try
readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD = ""
Dim sw = New StringWriter()
Dim xw = New XmlTextWriter(sw)
doc.WriteTo(xw)
Dim XmlString = sw.ToString()
If XmlString.Contains("<FCFCDD>") Then
Dim xmlFCFCDD = XmlString.Substring(XmlString.IndexOf("<FCFCDD>"), XmlString.IndexOf("</FCFCDD>") + 9 - XmlString.IndexOf("<FCFCDD>"))
' MsgBox(xmlFCFCDD)
Dim p = Path.GetTempFileName
Using outputFile As New StreamWriter(p, False, System.Text.Encoding.Default)
outputFile.Write(xmlFCFCDD)
outputFile.Close()
Dim FCFCDD As DAKOSY_Worker.FCFCDD.FCFCDD = DAKOSY_Worker.FCFCDD.FCFCDD.LoadFromFile(p)
' Dim EZA As New DAKOSY_Worker.cDakosyEZA
If FCFCDD IsNot Nothing And FCFCDD.Header IsNot Nothing And FCFCDD.Header.LocalReferenceNumber IsNot Nothing Then
readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD = FCFCDD.Header.LocalReferenceNumber
Else
Return "" 'Keine Bezugsnummer
End If
Dim DY_TMP As DAKOSY_Worker.cDakosy_Zollanmeldungen = saveDY_ZA(readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD, "EZA")
Dim EZA As DAKOSY_Worker.cDakosyEZA = DAKOSY_Worker.cDakosyEZA.LOADByBezugsNr(readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD, False) ' Falls schon ein DS mit dieser Bezugsnummer vorhanden ist.
If EZA Is Nothing Then EZA = New DAKOSY_Worker.cDakosyEZA
If DY_TMP IsNot Nothing Then EZA.eza_dyaAnmID = DY_TMP.dy_Id
If DY_TMP.dy_AvisoId Is Nothing Then
DY_TMP.tryFindAviso()
DY_TMP.SAVE()
End If
If FCFCDD IsNot Nothing Then
EZA.eza_ObjectName = readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD
If FCFCDD.MetaData IsNot Nothing Then
If FCFCDD.MetaData.Preparation IsNot Nothing Then EZA.eza_Trans_DatumZeit = CDate(FCFCDD.MetaData.Preparation.Date).ToShortDateString
End If
If FCFCDD.Header IsNot Nothing Then
EZA.eza_VersendungsLandCode = FCFCDD.Header.DepartureCountry
EZA.eza_FinanzamtAnmelder = FCFCDD.Header.TaxOffice
EZA.eza_UstIdAnmelder = FCFCDD.Header.TaxNumber
EZA.eza_Warenort = FCFCDD.Header.GoodsLocation
EZA.eza_Ausstellungsort = FCFCDD.Header.DeclarationPlace
EZA.eza_ZollrechtlicherStatus = FCFCDD.Header.CustomsGoodsStatus
EZA.eza_Zahlungsart = FCFCDD.Header.PaymentMethod
EZA.eza_AnmelderistEmpfaenger = FCFCDD.Header.DeclarantIsConsigneeFlag
EZA.eza_VertretungsVerhaeltnisCode = FCFCDD.Header.RepresentativeRelationshipFlag
EZA.eza_Vorsteuerabzug = FCFCDD.Header.InputTaxDeductionFlag
EZA.eza_ZusatzangabenAnmeldung = FCFCDD.Header.AdditionalInformation
' EZA.eza_VerfahrenBeantragtCode
End If
End If
If FCFCDD.Body IsNot Nothing Then
If FCFCDD.Body.ForeignTradeStatistics IsNot Nothing Then
EZA.eza_ArtGeschaeftCode = FCFCDD.Body.ForeignTradeStatistics.TransactionType
EZA.eza_Bestimmungsland = FCFCDD.Body.ForeignTradeStatistics.DestinationCountry
EZA.eza_Bestimmungsbundesland = FCFCDD.Body.ForeignTradeStatistics.DestinationFederalState
If FCFCDD.Body.ForeignTradeStatistics.EntryCustomsOffice IsNot Nothing Then
EZA.eza_Eingangszollstelle = FCFCDD.Body.ForeignTradeStatistics.EntryCustomsOffice.ReferenceNumber
End If
EZA.eza_Statistikstatus = FCFCDD.Body.ForeignTradeStatistics.GoodsStatus
EZA.eza_DV1Kz = FCFCDD.Body.CustomsValueFlag
EZA.eza_GesamtRohmasse = FCFCDD.Body.ForeignTradeStatistics.TotalGrossMassMeasure
End If
If FCFCDD.Body.PaymentTransaction IsNot Nothing Then
EZA.eza_Rechnungswaehrung = FCFCDD.Body.PaymentTransaction.CurrencyCode
EZA.eza_Rechnungspreis = FCFCDD.Body.PaymentTransaction.Amount
End If
If FCFCDD.Body.CustomsValue IsNot Nothing Then
If FCFCDD.Body.CustomsValue.RestrictionOrCondition IsNot Nothing Then EZA.eza_DV1EinschraenkungenKz = FCFCDD.Body.CustomsValue.RestrictionOrCondition.RestrictionFlag
EZA.eza_DV1FruehereEntscheidungen = FCFCDD.Body.CustomsValue.FormerDecisions
If FCFCDD.Body.CustomsValue.Affiliation IsNot Nothing Then EZA.eza_DV1Verbundenheit = FCFCDD.Body.CustomsValue.Affiliation.Type
If FCFCDD.Body.CustomsValue.Affiliation IsNot Nothing Then EZA.eza_DV1VerbungenheitEinzelheiten = FCFCDD.Body.CustomsValue.Affiliation.Description
If FCFCDD.Body.CustomsValue.LicenseFee IsNot Nothing Then EZA.eza_DV1LizenzgebuehrenUmstand = FCFCDD.Body.CustomsValue.LicenseFee.Description
If FCFCDD.Body.CustomsValue.LicenseFee IsNot Nothing Then EZA.eza_DV1LizenzgebuehrenKz = FCFCDD.Body.CustomsValue.LicenseFee.LicenseFeeFlag
End If
If FCFCDD.Body.Document IsNot Nothing AndAlso FCFCDD.Body.Document.Count > 0 Then
For Each docTMP In FCFCDD.Body.Document
Dim UNTERLAGE As New DAKOSY_Worker.cDakosy_EZA_Unterlagen
UNTERLAGE.ezaUl_Art = docTMP.Type
UNTERLAGE.ezaUl_Nummer = docTMP.ReferenceNumber
UNTERLAGE.ezaUl_Bereich = docTMP.Division
UNTERLAGE.ezaUl_DatumAusstellung = CDate(docTMP.IssuingDate).ToShortDateString
EZA.eza_UNTERLAGEN.Add(UNTERLAGE)
Next
End If
' EZA.eza_DV1Verbundenheit = cEDI.getSimpleLine("GIS+904:::", lines, Nothing)???
' EZA.eza_BewilligungsIDZLAVUV = cEDI.getSimpleLine("RFF+AEM:", lines) '?
'Vorpapier
If FCFCDD.PreviousAdministrativeReferences IsNot Nothing Then
EZA.eza_VorpapierArtCode = FCFCDD.PreviousAdministrativeReferences.Type
If FCFCDD.PreviousAdministrativeReferences.PreviousAdministrativeReference IsNot Nothing Then EZA.eza_VorpapierNr = FCFCDD.PreviousAdministrativeReferences.PreviousAdministrativeReference.ReferenceNumber
End If
'Beförderungsmittel Grenze
If FCFCDD.BorderTransportMeans IsNot Nothing Then
EZA.eza_BeförderungsmittelGrenzeArt = FCFCDD.BorderTransportMeans.Type
EZA.eza_VerkehrszweigGrenze = FCFCDD.BorderTransportMeans.Mode
EZA.eza_BeförderungsmittelGrenze = FCFCDD.BorderTransportMeans.Information
EZA.eza_BeförderungsmittelGrenzeStaatszugehörigkeitCode = FCFCDD.BorderTransportMeans.Nationality
End If
'Beförderungsmittel Inland
If FCFCDD.BorderTransportMeans IsNot Nothing Then
EZA.eza_BeförderungsmittelGrenzeArt = FCFCDD.BorderTransportMeans.Type
EZA.eza_VerkehrszweigGrenze = FCFCDD.BorderTransportMeans.Mode
EZA.eza_BeförderungsmittelGrenze = FCFCDD.BorderTransportMeans.Information
EZA.eza_BeförderungsmittelGrenzeStaatszugehörigkeitCode = FCFCDD.BorderTransportMeans.Nationality
End If
'Beförderungsmittel Inland
If FCFCDD.ArrivalTransportMeans IsNot Nothing Then
EZA.eza_KennzeichenNameBefoerderungsmittelAnkunft = FCFCDD.ArrivalTransportMeans.Identity
End If
'Ansprechpartenr
If FCFCDD.ContactPerson IsNot Nothing Then
EZA.eza_AnmeldenderBearbeiterName = FCFCDD.ContactPerson.Name
EZA.eza_AnmeldenderBearbeiterEMail = FCFCDD.ContactPerson.MailAddress
EZA.eza_AnmeldenderBearbeiterStellung = FCFCDD.ContactPerson.Position
EZA.eza_AnmeldenderBearbeiterTel = FCFCDD.ContactPerson.PhoneNumber
Dim SB_Tmp = SQL.getValueTxtBySql("SELECT isnull([mit_DAKOSY_SB],'') FROM [tblMitarbeiter] where [mit_DAKOSY_SBFull]='" & EZA.eza_AnmeldenderBearbeiterName & "'", "ADMIN")
If SB_Tmp <> "" Then
EZA.eza_Bearbeiter = SB_Tmp
End If
End If
'Anmleder
If FCFCDD.Declarant IsNot Nothing Then
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "DT"
If FCFCDD.Declarant.Name IsNot Nothing Then
If FCFCDD.Declarant.Name.ToString.Length > 40 Then
If FCFCDD.Declarant.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = FCFCDD.Declarant.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Declarant.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = FCFCDD.Declarant.Name.ToString.Substring(80, FCFCDD.Declarant.Name.ToString.Length - 80)
End If
ADR.ezaAd_NameFirma1 = FCFCDD.Declarant.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Declarant.Name.ToString.Substring(40, FCFCDD.Declarant.Name.ToString.Length - 40)
Else
ADR.ezaAd_NameFirma1 = FCFCDD.Declarant.Name
End If
End If
If FCFCDD.Declarant.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDD.Declarant.Identification.ReferenceNumber
ADR.ezaAd_TeilnehmerNLNR = FCFCDD.Declarant.Identification.SubsidiaryNumber
End If
If FCFCDD.Declarant.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = FCFCDD.Declarant.Address.Line
ADR.ezaAd_StrasseHausNr2 = Nothing
ADR.ezaAd_Ort = FCFCDD.Declarant.Address.City
ADR.ezaAd_PLZ = FCFCDD.Declarant.Address.Postcode
ADR.ezaAd_LandCode = FCFCDD.Declarant.Address.Country
End If
EZA.eza_ADRESSEN.Add(ADR)
End If
'Vertreter
If FCFCDD.Representative IsNot Nothing Then
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "CB"
If FCFCDD.Representative.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDD.Representative.Identification.ReferenceNumber
ADR.ezaAd_TeilnehmerNLNR = FCFCDD.Representative.Identification.SubsidiaryNumber
EZA.eza_ADRESSEN.Add(ADR)
End If
End If
'Empfänger
If FCFCDD.Body IsNot Nothing AndAlso FCFCDD.Body.Consignee IsNot Nothing Then
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "CN"
If FCFCDD.Body.Consignee.Name IsNot Nothing Then
If FCFCDD.Body.Consignee.Name.ToString.Length > 40 Then
If FCFCDD.Body.Consignee.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Consignee.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.Consignee.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = FCFCDD.Body.Consignee.Name.ToString.Substring(80, FCFCDD.Body.Consignee.Name.ToString.Length - 80)
End If
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Consignee.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.Consignee.Name.ToString.Substring(40, FCFCDD.Body.Consignee.Name.ToString.Length - 40)
Else
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Consignee.Name
End If
End If
If FCFCDD.Body.Consignee.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDD.Body.Consignee.Identification.ReferenceNumber
ADR.ezaAd_TeilnehmerNLNR = FCFCDD.Body.Consignee.Identification.SubsidiaryNumber
End If
If FCFCDD.Body.Consignee.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = FCFCDD.Body.Consignee.Address.Line
ADR.ezaAd_StrasseHausNr2 = Nothing
ADR.ezaAd_Ort = FCFCDD.Body.Consignee.Address.City
ADR.ezaAd_PLZ = FCFCDD.Body.Consignee.Address.Postcode
ADR.ezaAd_LandCode = FCFCDD.Body.Consignee.Address.Country
End If
EZA.eza_ADRESSEN.Add(ADR)
End If
'Erwerber
If FCFCDD.Body IsNot Nothing AndAlso FCFCDD.Body.Acquirer IsNot Nothing Then
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "UC"
If FCFCDD.Body.Acquirer.Name IsNot Nothing Then
If FCFCDD.Body.Acquirer.Name.ToString.Length > 40 Then
If FCFCDD.Body.Acquirer.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Acquirer.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.Acquirer.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = FCFCDD.Body.Acquirer.Name.ToString.Substring(80, FCFCDD.Body.Acquirer.Name.ToString.Length - 80)
End If
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Acquirer.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.Acquirer.Name.ToString.Substring(40, FCFCDD.Body.Acquirer.Name.ToString.Length - 40)
Else
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Acquirer.Name
End If
End If
If FCFCDD.Body.Acquirer.TaxNumber IsNot Nothing Then
ADR.ezaAd_UStIDAnmelder = FCFCDD.Body.Acquirer.TaxNumber
End If
If FCFCDD.Body.Acquirer.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDD.Body.Acquirer.Identification.ReferenceNumber
ADR.ezaAd_TeilnehmerNLNR = FCFCDD.Body.Acquirer.Identification.SubsidiaryNumber
End If
If FCFCDD.Body.Acquirer.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = FCFCDD.Body.Acquirer.Address.Line
ADR.ezaAd_StrasseHausNr2 = Nothing
ADR.ezaAd_Ort = FCFCDD.Body.Acquirer.Address.City
ADR.ezaAd_PLZ = FCFCDD.Body.Acquirer.Address.Postcode
ADR.ezaAd_LandCode = FCFCDD.Body.Acquirer.Address.Country
End If
EZA.eza_ADRESSEN.Add(ADR)
End If
'Versender/Ausführer
If FCFCDD.Body IsNot Nothing AndAlso FCFCDD.Body.Consignor IsNot Nothing Then
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "CZ"
If FCFCDD.Body.Consignor.Name IsNot Nothing Then
If FCFCDD.Body.Consignor.Name.ToString.Length > 40 Then
If FCFCDD.Body.Consignor.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Consignor.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.Consignor.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = FCFCDD.Body.Consignor.Name.ToString.Substring(80, FCFCDD.Body.Consignor.Name.ToString.Length - 80)
End If
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Consignor.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.Consignor.Name.ToString.Substring(40, FCFCDD.Body.Consignor.Name.ToString.Length - 40)
Else
ADR.ezaAd_NameFirma1 = FCFCDD.Body.Consignor.Name
End If
End If
If FCFCDD.Body.Consignor.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDD.Body.Consignor.Identification.ReferenceNumber
' ADR.ezaAd_TeilnehmerNLNR = FCFCDD.Body.Consignor.Identification.SubsidiaryNumber
End If
If FCFCDD.Body.Consignor.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = FCFCDD.Body.Consignor.Address.Line
ADR.ezaAd_StrasseHausNr2 = Nothing
ADR.ezaAd_Ort = FCFCDD.Body.Consignor.Address.City
ADR.ezaAd_PLZ = FCFCDD.Body.Consignor.Address.Postcode
ADR.ezaAd_LandCode = FCFCDD.Body.Consignor.Address.Country
End If
EZA.eza_ADRESSEN.Add(ADR)
End If
'Verkäufer
If FCFCDD.Body IsNot Nothing AndAlso FCFCDD.Body.CustomsValue IsNot Nothing AndAlso FCFCDD.Body.CustomsValue.Vendor IsNot Nothing Then
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "SE"
If FCFCDD.Body.CustomsValue.Vendor.Name IsNot Nothing Then
If FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Length > 40 Then
If FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Substring(80, FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Length - 80)
End If
ADR.ezaAd_NameFirma1 = FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Substring(40, FCFCDD.Body.CustomsValue.Vendor.Name.ToString.Length - 40)
Else
ADR.ezaAd_NameFirma1 = FCFCDD.Body.CustomsValue.Vendor.Name
End If
End If
If FCFCDD.Body.CustomsValue.Vendor.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDD.Body.CustomsValue.Vendor.Identification.ReferenceNumber
'ADR.ezaAd_TeilnehmerNLNR = FCFCDD.Body.CustomsValue.Vendor.Identification.SubsidiaryNumber
End If
If FCFCDD.Body.CustomsValue.Vendor.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = FCFCDD.Body.CustomsValue.Vendor.Address.Line
ADR.ezaAd_StrasseHausNr2 = Nothing
ADR.ezaAd_Ort = FCFCDD.Body.CustomsValue.Vendor.Address.City
ADR.ezaAd_PLZ = FCFCDD.Body.CustomsValue.Vendor.Address.Postcode
ADR.ezaAd_LandCode = FCFCDD.Body.CustomsValue.Vendor.Address.Country
End If
EZA.eza_ADRESSEN.Add(ADR)
End If
'Käufer
If FCFCDD.Body IsNot Nothing AndAlso FCFCDD.Body.CustomsValue IsNot Nothing AndAlso FCFCDD.Body.CustomsValue.Vendee IsNot Nothing Then
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "BY"
If FCFCDD.Body.CustomsValue.Vendee.Name IsNot Nothing Then
If FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Length > 40 Then
If FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Substring(80, FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Length - 80)
End If
ADR.ezaAd_NameFirma1 = FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Substring(40, FCFCDD.Body.CustomsValue.Vendee.Name.ToString.Length - 40)
Else
ADR.ezaAd_NameFirma1 = FCFCDD.Body.CustomsValue.Vendee.Name
End If
End If
If FCFCDD.Body.CustomsValue.Vendee.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDD.Body.CustomsValue.Vendee.Identification.ReferenceNumber
'ADR.ezaAd_TeilnehmerNLNR = FCFCDD.Body.CustomsValue.Vendee.Identification.SubsidiaryNumber
End If
If FCFCDD.Body.CustomsValue.Vendee.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = FCFCDD.Body.CustomsValue.Vendee.Address.Line
ADR.ezaAd_StrasseHausNr2 = Nothing
ADR.ezaAd_Ort = FCFCDD.Body.CustomsValue.Vendee.Address.City
ADR.ezaAd_PLZ = FCFCDD.Body.CustomsValue.Vendee.Address.Postcode
ADR.ezaAd_LandCode = FCFCDD.Body.CustomsValue.Vendee.Address.Country
End If
EZA.eza_ADRESSEN.Add(ADR)
End If
End If
''Zollwertanmelder
'ADRTMP = cEDI.getValuesFromLine(cEDI.getSimpleLine("NAD+PQ++", lines, , False))
'If ADRTMP.Length > 0 Then EZA.eza_ADRESSEN.Add(getEZAAresseFromLine(ADRTMP, "PQ"))
''Vertr. Zollwertanmelder
'ADRTMP = cEDI.getValuesFromLine(cEDI.getSimpleLine("NAD+AG++", lines, , False))
'If ADRTMP.Length > 0 Then EZA.eza_ADRESSEN.Add(getEZAAresseFromLine(ADRTMP, "AG"))
''Rechnung
'ADRTMP = cEDI.getValuesFromLine(cEDI.getSimpleLine("NAD+AA++", lines))
'If ADRTMP.Length > 0 Then EZA.eza_ADRESSEN.Add(getEZAAresseFromLine(ADRTMP, "AA"))
''Postfachadresse
'ADRTMP = cEDI.getValuesFromLine(cEDI.getSimpleLine("NAD+AAP++", lines))
'If ADRTMP.Length > 0 Then EZA.eza_ADRESSEN.Add(getEZAAresseFromLine(ADRTMP, "AAP"))
''--
'AUFSCHUB
If FCFCDD.DutyDefermentApproval IsNot Nothing AndAlso FCFCDD.DutyDefermentApproval.Count > 0 Then
For Each TMP In FCFCDD.DutyDefermentApproval
Dim AUFSCHUB As New DAKOSY_Worker.cDakosy_EZA_Aufschub
If TMP.DutyDefermentApplicant IsNot Nothing AndAlso TMP.DutyDefermentApplicant.Identification IsNot Nothing Then
AUFSCHUB.ezaAfb_AufschubnehmerEORI = TMP.DutyDefermentApplicant.Identification.ReferenceNumber
End If
AUFSCHUB.ezaAfb_AufschuBIN = TMP.AuthorisationNumber
AUFSCHUB.ezaAfb_HZA = TMP.AccountPrefix
AUFSCHUB.ezaAfb_KontoNr = TMP.AccountNumber
AUFSCHUB.ezaAfb_Aufschubart = TMP.Type
AUFSCHUB.ezaAfb_ArtAufschubantrag = TMP.ApplicationType
EZA.eza_AUFSCHUB.Add(AUFSCHUB)
Next
End If
'Lieferbedingungen
If FCFCDD.Body.DeliveryTerms IsNot Nothing Then
EZA.eza_LieferbedingungCode = FCFCDD.Body.DeliveryTerms.Code
EZA.eza_LieferbedingungText = FCFCDD.Body.DeliveryTerms.Description
EZA.eza_LieferbedingungOrt = FCFCDD.Body.DeliveryTerms.Place
EZA.eza_LieferbedingungSchluessel = FCFCDD.Body.DeliveryTerms.Key
End If
' ###################################################
'POSITIONEN
' ###################################################
If FCFCDD.Body IsNot Nothing AndAlso FCFCDD.Body.GoodsItem IsNot Nothing AndAlso FCFCDD.Body.GoodsItem.Count > 0 Then
For Each GOODSITEM In FCFCDD.Body.GoodsItem
Dim POS As New DAKOSY_Worker.cDakosy_EZA_Warenposition
POS.ezaWP_PositionsNummer = GOODSITEM.SequenceNumber
If GOODSITEM.CommodityCode IsNot Nothing Then POS.ezaWP_WarennummerEZT = GOODSITEM.CommodityCode.CommodityCode
If GOODSITEM.Procedure IsNot Nothing Then POS.ezaWP_AnmeldeVErfahren = GOODSITEM.Procedure.RequestedPreviousProcedure
POS.ezaWP_AbgabensteuerungKz = GOODSITEM.CessionManagementFlag
POS.ezaWP_Warenbezeichnung = GOODSITEM.GoodsDescription
POS.ezaWP_PositionsZusatz = GOODSITEM.SupplementaryInformation
If GOODSITEM.CustomsValue IsNot Nothing Then
POS.ezaWP_OrtVerbringens = GOODSITEM.CustomsValue.DestinationPlace
POS.ezaWP_AbflughafenIATACode = GOODSITEM.CustomsValue.DepartureAirport
If GOODSITEM.CustomsValue.NetPrice IsNot Nothing Then
' POS.ezaWP_KursBetragVereinbart = GOODSITEM.CustomsValue.NetPrice.CurrencyCode
POS.ezaWP_KursVereinbartKz = GOODSITEM.CustomsValue.NetPrice.CurrencyRateAgreedFlag
POS.ezaWP_KursBetragVereinbart = GOODSITEM.CustomsValue.NetPrice.Value
'POS.ezaWP_KursDatum= GOODSITEM.CustomsValue.NetPrice.CurrencyRate
'POS.ezaWP_KursDatum = GOODSITEM.CustomsValue.NetPrice.
End If
If GOODSITEM.ForeignTradeStatistics IsNot Nothing Then
POS.ezaWP_Rohmasse = GOODSITEM.ForeignTradeStatistics.GrossMassMeasure
If GOODSITEM.ForeignTradeStatistics.Amount IsNot Nothing Then
POS.ezaWP_AHStatMengeQualifier = GOODSITEM.ForeignTradeStatistics.Amount.Qualifier
POS.ezaWP_AHStatMengeMasseinheit = GOODSITEM.ForeignTradeStatistics.Amount.MeasurementUnit
POS.ezaWP_AHStatMenge = GOODSITEM.ForeignTradeStatistics.Amount.Quantity
POS.ezaWP_AHStatWert = GOODSITEM.ForeignTradeStatistics.Quantity
End If
End If
POS.ezaWP_UrsprungslandCode = GOODSITEM.OriginCountry
POS.ezaWP_Eigenmasse = GOODSITEM.NetMassMeasure
' POS.ezaWP_BeguenstigungBenatragtCode = Bedingun.
POS.ezaWP_BedingungCode = GOODSITEM.Condition
'POS.ezaWP_EUCode = GOODSITEM.EUCode
'If GOODSITEM.Assessment IsNot Nothing Then
' POS.ezaWP_Zollwert = GOODSITEM.Assessment.Amount.
' POS.ezaWP_KostenEUSt = GOODSITEM.Assessment.TaxCosts
' POS.ezaWP_VeredelungWertsteigerung = GOODSITEM.Assessment.OutwardProcessingFee
'End If
''Packstücke
If GOODSITEM.Package IsNot Nothing Then
POS.ezaWP_PackstueckArt = GOODSITEM.Package.Kind
POS.ezaWP_PackstueckZeichen = GOODSITEM.Package.MarksNumbers
POS.ezaWP_PackstueckAnzahl = GOODSITEM.Package.Quantity
End If
''Packstücke
'If GOODSITEM.Package IsNot Nothing AndAlso GOODSITEM.Package.Count > 0 Then
' For Each PCK In GOODSITEM.Package
' Dim AUFSCHUB As New DAKOSY_Worker.cDakosy_EZA_Aufschub
' If PCK.DutyDefermentApplicant IsNot Nothing AndAlso PCK.DutyDefermentApplicant.Identification IsNot Nothing Then
' AUFSCHUB.ezaAfb_AufschubnehmerEORI = PCK.DutyDefermentApplicant.Identification.ReferenceNumber
' End If
' AUFSCHUB.ezaAfb_AufschuBIN = PCK.AuthorisationNumber
' AUFSCHUB.ezaAfb_KontoNr = PCK.AccountNumber
' AUFSCHUB.ezaAfb_Aufschubart = PCK.Type
' AUFSCHUB.ezaAfb_ArtAufschubantrag = PCK.ApplicationType
' EZA.eza_AUFSCHUB.Add(AUFSCHUB)
' Next
'End If
'Preisart
'-
POS.ezaWP_Artikelpreis = GOODSITEM.InvoiceAmount
'Zusatzcode
If GOODSITEM.SupplementaryCodes IsNot Nothing AndAlso GOODSITEM.SupplementaryCodes.Count > 0 Then
Dim cnt = 0
For Each s In GOODSITEM.SupplementaryCodes
If cnt = 0 Then POS.ezaWP_WarennummerZusatzCode1 = s.Code
If cnt = 1 Then POS.ezaWP_WarennummerZusatzCode2 = s.Code
If cnt = 2 Then POS.ezaWP_WarennummerZusatzCode3 = s.Code
If cnt = 3 Then POS.ezaWP_WarennummerZusatzCode4 = s.Code
If cnt = 4 Then POS.ezaWP_WarennummerZusatzCode5 = s.Code
If cnt = 5 Then POS.ezaWP_WarennummerZusatzCode6 = s.Code
If cnt = 6 Then POS.ezaWP_WarennummerZusatzCode7 = s.Code
If cnt = 7 Then POS.ezaWP_WarennummerZusatzCode8 = s.Code
If cnt = 8 Then POS.ezaWP_WarennummerZusatzCode9 = s.Code
If cnt = 9 Then POS.ezaWP_WarennummerZusatzCode10 = s.Code
cnt += 1
Next
End If
'Abgabenminderung
'-
'Sonderfalldaten
If GOODSITEM.SpecialCase IsNot Nothing AndAlso GOODSITEM.SpecialCase.Count > 0 Then
For Each s In GOODSITEM.SpecialCase
Dim SA As New DAKOSY_Worker.cDakosy_EZA_WarenpositionSonderfalldaten
SA.ezaWpSfd_SonderabgabenGruppeCode = s.Group
SA.ezaWpSfd_AnwendungArt = s.ApplicationType
SA.ezaWpSfd_SatzBetragFaktor = s.RateOrAmountOrFactor
POS.ezaWP_SONDERFALLDATEN.Add(SA)
Next
End If
'Verbrauchsteuer
If GOODSITEM.ExciseDuty IsNot Nothing AndAlso GOODSITEM.ExciseDuty.Count > 0 Then
For Each s In GOODSITEM.ExciseDuty
Dim VS As New DAKOSY_Worker.cDakosy_EZA_WarenpositionVerbrauchssteuer
VS.ezaWpVs_VerbrauchsteuerCode = s.Code
VS.ezaWpVs_VerbrauchssteuerWertbasis = s.Value
'VS.ezaWpVs_VerbrauchssteuerMenge = s.DegreePercentage
If s.Amount IsNot Nothing Then
VS.ezaWpVs_VerbrauchssteuerMasseinheitCode = s.Amount.Quantity
VS.ezaWpVs_VerbrauchssteuerMasseinheitQualifier = s.Amount.Qualifier
VS.ezaWpVs_VerbrauchssteuerMasseinheitCode = s.Amount.MeasurementUnit
End If
POS.ezaWP_VERBRAUCHSSTEUER.Add(VS)
Next
End If
If GOODSITEM.PreferentialTreatment IsNot Nothing Then
POS.ezaWP_BeguenstigungBenatragtCode = GOODSITEM.PreferentialTreatment.RequestedPreferentialTreatment
If GOODSITEM.PreferentialTreatment.Declaration IsNot Nothing AndAlso GOODSITEM.PreferentialTreatment.Declaration.PreferentialTreatmentQuantity IsNot Nothing Then
POS.ezaWP_BeguenstigungsMengeMasseinheitCode = GOODSITEM.PreferentialTreatment.Declaration.PreferentialTreatmentQuantity.MeasurementUnit
POS.ezaWP_BeguenstigungsMengeMenge = GOODSITEM.PreferentialTreatment.Declaration.PreferentialTreatmentQuantity.Quantity
POS.ezaWP_BeguenstigungsMengeQualifier = GOODSITEM.PreferentialTreatment.Declaration.PreferentialTreatmentQuantity.Qualifier
End If
End If
'Unterlagen
If GOODSITEM.Document IsNot Nothing AndAlso GOODSITEM.Document.Count > 0 Then
For Each s In GOODSITEM.Document
Dim UL As New DAKOSY_Worker.cDakosy_EZA_WarenpositionVorgelegteUnterlagen
UL.ezaWpUl_Bereich = s.Division
UL.ezaWpUl_VorlageKz = s.AtHandFlag
If s.WriteOff IsNot Nothing Then
UL.ezaWpUl_AbschreibungsMengeMasseinheitQualifier = s.WriteOff.Qualifier
UL.ezaWpUl_AbschreibungsMengeMasseinheit = s.WriteOff.MeasurementUnit
UL.ezaWpUl_AbschreibungsMenge = s.WriteOff.Quantity
End If
UL.ezaWpUl_Art = s.Type
UL.ezaWpUl_Nummer = s.ReferenceNumber
UL.ezaWpUl_DatumAusstellung = CDate(s.IssuingDate).ToShortDateString
POS.ezaWP_UNTERLAGEN.Add(UL)
Next
End If
End If
EZA.eza_WARENPOS.Add(POS)
Next
End If
If If(EZA.eza_Status, 0) <= 5 Then EZA.eza_Status = DAKOSY_Worker.cDY_Statusliste.S_05
If If(EZA.eza_Status_KEWILL_Equivalent, 0) <= 5 Then EZA.eza_Status_KEWILL_Equivalent = DAKOSY_Worker.cDY_Statusliste.S_05
If EZA.SAVE_ALL() Then
If If(EZA.eza_Status, 0) <= 5 Then DAKOSY_Worker.cDakosy_Statusmeldungen.InsertStatusMeldung(DY_TMP, DAKOSY_Worker.cDY_Statusliste.S_05)
Else
readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD = ""
End If
Try
System.IO.File.Delete(p)
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
addDGVEinarbeitung("EZA: FreierVerkehrAktVeredelUmwandlung", readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD)
End Using
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
readEZA_FreierVerkehrAktVeredelUmwandlungXML_FCFCDD = ""
End Try
End Function
Function readEZA_FreierVerkehrAktVeredelUmwandlungXML(doc As XmlDocument) As String
Try
readEZA_FreierVerkehrAktVeredelUmwandlungXML = ""
@@ -4989,7 +5612,7 @@ Public Class frmDYNachrichtenVerarbeitung
'Lösche File:
Try
System.IO.File.Delete(frmRoutineManager.Path & "\" & brgak_filename)
System.IO.File.Delete(frmRoutineManager.PathATLAS & "\" & brgak_filename)
Catch ex As Exception
writeLog("ERROR", "Fehler beim Löschen der Aufschub-Datei: " & ex.Message)
End Try