This commit is contained in:
2020-08-04 16:34:47 +02:00
parent 40295a2819
commit 89d8e0a3a8
95 changed files with 3655 additions and 697 deletions

View File

@@ -426,15 +426,33 @@ Public Class usrCntlATLAS_EZA
Try
Dim SH As New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_FULL(CInt(SENDUNG.VORSYSTEM_Id))
If SH IsNot Nothing Then
Dim ABFERTIGUNGSART = 1 'DEFAULT Fiskal?
EZA.eza_GesamtRohmasse = SH.EZA.TotGrossWeight
If If(SH.EZA.Incoterm, "") <> "" Then EZA.eza_LieferbedingungCode = SH.EZA.Incoterm
If If(SH.EZA.Incoterm, "") <> "" Then
EZA.eza_LieferbedingungCode = SH.EZA.Incoterm
End If
'EZA.pack= SH.EZA.TotPackage
'EZA.eza_Rechnungspreis = SH.EZA.TotGrossWeight
'EZA.eza_Rechnungswaehrung = SENDUNG.tblSnd_WarenwertWaehrung
' If If(SH.EZA.TransportModeBorder, "") <> "" Then EZA.eza_BeförderungsmittelGrenzeArt = SH.EZA.TransportModeBorder
' If If(SH.EZA.TransportModeBorder, "") <> "" Then EZA.eza_BeförderungsmittelGrenzeArt = SH.EZA.TransportModeBorder
'If If(SH.EZA.TransportBorderType, "") <> "" Then EZA.bef = SH.EZA.TransportBorderType
If If(SH.EZA.PrePaperCode, "") <> "" Then EZA.eza_VorpapierArtCode = SH.EZA.PrePaperCode
If If(SH.EZA.PrePaperNr, "") <> "" Then EZA.eza_VorpapierNr = SH.EZA.PrePaperNr
If If(SH.EZA.CountryCodeDeparture, "") <> "" Then EZA.eza_VersendungsLandCode = SH.EZA.CountryCodeDeparture
If If(SH.EZA.TransportBorderType, "") <> "" Then EZA.eza_VerkehrszweigInland = SH.EZA.TransportBorderType
If If(SH.EZA.TransportBorderType, "") <> "" Then EZA.eza_VerkehrszweigGrenze = SH.EZA.TransportBorderType
'If If(AD.ezaAd_LandCode, "") = "DE" And AD.ezaAd_PLZ IsNot Nothing Then
' EZA.eza_Bestimmungsbundesland = VERAG_PROG_ALLGEMEIN.cDEBundeslaenderPLZ.LOADBundeslandCode_ByPLZ(AD.ezaAd_PLZ)
'ElseIf If(AD.ezaAd_LandCode, "") <> "" Then
' EZA.eza_Bestimmungsbundesland = 25
'End If
Dim InvoiceSum As Double = 0.0
Dim InvoiceCurr As String = ""
For Each SH_POS In SH.EZA.POSITIONS
Dim EZA_POS As New DAKOSY_Worker.cDakosy_EZA_Warenposition
EZA_POS.ezaWP_PackstueckAnzahl = SH_POS.NumberOfPackages
@@ -443,27 +461,50 @@ Public Class usrCntlATLAS_EZA
EZA_POS.ezaWP_Warenbezeichnung = SH_POS.GoodsDescription
EZA_POS.ezaWP_WarennummerEZT = SH_POS.GoodsTariff
EZA_POS.ezaWP_UrsprungslandCode = SH_POS.OriginCountryCode
If If(SH_POS.KindOfPackages, "") <> "" Then EZA_POS.ezaWP_PackstueckArt = SH_POS.KindOfPackages
If SH_POS.ItemInvoiceAmount IsNot Nothing Then
EZA_POS.ezaWP_Artikelpreis = SH_POS.ItemInvoiceAmount
EZA_POS.ezaWP_AHStatWert = SH_POS.ItemInvoiceAmount
Else
InvoiceSum += CDbl(SH_POS.ItemInvoiceAmount)
If SH_POS.ItemInvoiceCurrency = "" Then
InvoiceCurr = SH_POS.ItemInvoiceCurrency
ElseIf SH_POS.ItemInvoiceCurrency <> InvoiceCurr Then
InvoiceCurr = "XXX" ' Wenn währung unterschiedlich XX --> kein Übertrag
End If
End If
For Each SH_POS_DOC In SH_POS.DOCUMENTS
Dim bool_add = False
Dim EZA_POS_DOC As New DAKOSY_Worker.cDakosy_EZA_WarenpositionVorgelegteUnterlagen
EZA_POS_DOC.ezaWpUl_DatumAusstellung = SH_POS_DOC.DocumentDate
EZA_POS_DOC.ezaWpUl_Nummer = SH_POS_DOC.DocumentNr
Select Case SH_POS_DOC.DocumentType
Case "CMR" : EZA_POS_DOC.ezaWpUl_Art = "7HHF" : EZA_POS_DOC.ezaWpUl_Bereich = "4" : EZA_POS_DOC.ezaWpUl_VorlageKz = "J" : bool_add = True
Case "INV" : EZA_POS_DOC.ezaWpUl_Art = "N380" : EZA_POS_DOC.ezaWpUl_Bereich = "4" : EZA_POS_DOC.ezaWpUl_VorlageKz = "J" : bool_add = True
Case "ATR" : EZA_POS_DOC.ezaWpUl_Art = "N018" : EZA_POS_DOC.ezaWpUl_Bereich = "6" : EZA_POS_DOC.ezaWpUl_VorlageKz = "J" : bool_add = True
' Case "EX" : EZA_POS_DOC.ezaWpUl_Art = "N380": EZA_POS_DOC.ezaWpUl_Bereich = "4
End Select
If bool_add Then EZA_POS.ezaWP_UNTERLAGEN.Add(EZA_POS_DOC)
Next
EZA.eza_WARENPOS.Add(EZA_POS)
Next
EZA.eza_Rechnungspreis = InvoiceSum
If InvoiceCurr <> "XXX" Then EZA.eza_Rechnungswaehrung = InvoiceCurr
Dim LieferbedingungOrtAbsedner = ""
Dim LieferbedingungOrtEmpfaenger = ""
For Each SH_AD In SH.EZA.ADDRESS
Dim EZA_AD As New DAKOSY_Worker.cDakosy_EZA_Adressen
EZA_AD.ezaAd_AdressTyp = SH_AD.AddressCode
EZA_AD.ezaAd_LandCode = SH_AD.CountryCode
EZA_AD.ezaAd_TeilnehmerEORI = SH_AD.EORI
EZA_AD.ezaAd_TeilnehmerNLNR = SH_AD.NLNR
EZA_AD.ezaAd_NameFirma1 = SH_AD.Name1
EZA_AD.ezaAd_NameFirma2 = SH_AD.Name2
EZA_AD.ezaAd_NameFirma3 = SH_AD.Name3
@@ -473,9 +514,37 @@ Public Class usrCntlATLAS_EZA
EZA_AD.ezaAd_PLZ = SH_AD.PostalCode
EZA_AD.ezaAd_UStIDAnmelder = SH_AD.UStID
If EZA_AD.ezaAd_AdressTyp = "CN" Then 'EMPFÄNGER
EZA_AD.ezaAd_TeilnehmerEORI = SH_AD.EORI
EZA_AD.ezaAd_TeilnehmerNLNR = SH_AD.NLNR
If If(EZA_AD.ezaAd_LandCode, "") = "DE" And EZA_AD.ezaAd_PLZ IsNot Nothing Then
EZA.eza_Bestimmungsbundesland = VERAG_PROG_ALLGEMEIN.cDEBundeslaenderPLZ.LOADBundeslandCode_ByPLZ(EZA_AD.ezaAd_PLZ)
ElseIf If(EZA_AD.ezaAd_LandCode, "") <> "" Then
EZA.eza_Bestimmungsbundesland = 25
End If
If If(EZA_AD.ezaAd_Ort, "") <> "" Then LieferbedingungOrtEmpfaenger = EZA_AD.ezaAd_Ort
End If
If EZA_AD.ezaAd_AdressTyp = "CZ" Then 'ABSENDER
If If(EZA_AD.ezaAd_Ort, "") <> "" Then LieferbedingungOrtAbsedner = EZA_AD.ezaAd_Ort
End If
EZA.eza_ADRESSEN.Add(EZA_AD)
Next
Select Case If(EZA.eza_LieferbedingungCode, "")
Case ""
Case "EXW", "FCA", "FOB", "FAS"
EZA.eza_LieferbedingungSchluessel = 1
EZA.eza_LieferbedingungOrt = LieferbedingungOrtAbsedner
Case Else
EZA.eza_LieferbedingungSchluessel = 3
EZA.eza_LieferbedingungOrt = LieferbedingungOrtEmpfaenger
End Select
Vorsystem = True
End If