Telotec API

This commit is contained in:
2025-04-24 17:06:16 +02:00
parent 14383d5cbe
commit 37fc5ad3ad
5 changed files with 305 additions and 25 deletions

View File

@@ -53,9 +53,6 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="VERAG_PROG_ALLGEMEIN">
<HintPath>..\VERAG_PROG_ALLGEMEIN\bin\Debug\VERAG_PROG_ALLGEMEIN.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
@@ -113,5 +110,11 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\SDL\SDL\VERAG_PROG_ALLGEMEIN\VERAG_PROG_ALLGEMEIN.vbproj">
<Project>{a3b497bd-842c-4a2b-b398-ed1976849df1}</Project>
<Name>VERAG_PROG_ALLGEMEIN</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

@@ -1244,6 +1244,139 @@ Public Class cTelotec_Anmeldung
End Function
Public Shared Function ConvertTAMessageToTelotec(msg As VERAG_PROG_ALLGEMEIN.cTelotecAPI.TAMessage) As cTelotec_Anmeldung
Dim telotec As New cTelotec_Anmeldung()
With msg
If .declarationContent IsNot Nothing Then
Dim decl = .declarationContent
telotec.telanm_ART = "TA"
telotec.telanm_BezugsNr = .lrn
telotec.telanm_CRN = .mrn
telotec.MsgType = .msgType
telotec.Refs_LRN = .lrn
telotec.Refs_CRN = .mrn
telotec.Mandant_ID = decl.mandant_ID
telotec.Referenz_ID = decl.interfaceReferenceId
telotec.dec_CreatePersonalID = decl.erstellPersonalID
telotec.dec_CreateDate = decl.erstellDatum
telotec.dec_Template_ID = decl.template_ID
telotec.dec_TotNet = decl.totNet
telotec.dec_TotNetSplit_IND = decl.totNetSplit_IND
telotec.dec_FillPackList_IND = decl.fillPackList_IND
telotec.dec_Memo = decl.memo
telotec.Hea_DecTy = decl.declarationType
telotec.Hea_Simp = decl.reducedDatasetIndicator
telotec.Hea_DecDT = decl.declarationAcceptanceDate
telotec.Hea_WoffD = decl.writeOffDate
telotec.Hea_AccDT = decl.declarationAcceptanceDate
telotec.Hea_ProArrDT = decl.presentationOfTheGoodsDateAndTime
telotec.Hea_PlaDepDT = decl.presentationOfTheGoodsDateAndTime
telotec.Hea_TotGross = decl.grossMass
' telotec.Hea_PayMet = decl.methodOfPayment int erw
telotec.Hea_SecInd = decl.security
telotec.Hea_DestLNG = decl.countryOfDestination
telotec.Hea_DepLNG = decl.countryOfDispatch
telotec.Transp_InMo = decl.inlandModeOfTransport
telotec.Transp_BordMo = decl.modeOfTransportAtTheBorder
telotec.Transp_ContInd = decl.containerIndicator
telotec.Transp_DepIdnt = SafeFirst(decl.departureTransportMeans, Function(dt) dt.identificationNumber)
telotec.Transp_DepNat = SafeFirst(decl.departureTransportMeans, Function(dt) dt.nationality)
' Consignor/Consignee
telotec.ConorTra_Na = SafeGetName(decl.consignor)
'telotec.ConorTra_Strt = decl.consignor.streetAndNumber
'telotec.ConorTra_Pst = decl.consignor?.postcode
'telotec.ConorTra_Cty = decl.consignor?.city
'telotec.ConorTra_Ctry = decl.consignor?.country
telotec.ConorTra_TIN = decl.consignor?.identificationNumber
telotec.ConeeTra_Na = SafeGetName(decl.consignee)
telotec.ConeeTra_Strt = decl.consignee?.streetAndNumber
telotec.ConeeTra_Pst = decl.consignee?.postcode
telotec.ConeeTra_Cty = decl.consignee?.city
telotec.ConeeTra_Ctry = decl.consignee?.country
telotec.ConeeTra_TIN = decl.consignee?.identificationNumber
telotec.Represent_Na = decl.representative?.contactPersonName
telotec.Represent_RIN = decl.representative?.identificationNumber
telotec.Locs_Disp = decl.countryOfDispatch
telotec.Locs_Dest = decl.countryOfDestination
telotec.Locs_GdsLoc = decl.locationOfGoods_PlaceOfGoods
telotec.Locs_GdsLocCd = decl.locationOfGoods_CustomsOffice
' HouseConsignments inkl. ConsignmentItems und Packaging
'If decl.houseConsignment IsNot Nothing Then
' telotec.HouseConsignments = New List(Of cTelotec_Positionsdaten)()
' For Each hc In decl.houseConsignment
' Dim newHc As New cTelotec_HouseConsignment()
' newHc.CountryOfDispatch = hc.countryOfDispatch
' newHc.CountryOfDestination = hc.countryOfDestination
' newHc.GrossMass = hc.grossMass
' newHc.ReferenceNumberUCR = hc.referenceNumberUCR
' newHc.MethodOfPayment = hc.methodOfPayment
' If hc.consignmentItem IsNot Nothing Then
' newHc.ConsignmentItems = New List(Of cTelotec_ConsignmentItem)()
' For Each item In hc.consignmentItem
' Dim newItem As New cTelotec_ConsignmentItem()
' newItem.GoodsItemNumber = item.goodsItemNumber
' newItem.DeclarationGoodsItemNumber = item.declarationGoodsItemNumber
' newItem.DeclarationType = item.declarationType
' newItem.CountryOfDispatch = item.countryOfDispatch
' newItem.CountryOfDestination = item.countryOfDestination
' newItem.DescriptionOfGoods = item.descriptionOfGoods
' newItem.GrossMass = item.grossMass
' newItem.NetMass = item.netMass
' newItem.MethodOfPayment = item.methodOfPayment
' newItem.ReferenceNumberUCR = item.referenceNumberUCR
' If item.packaging IsNot Nothing Then
' newItem.Packaging = New List(Of cTelotec_Packaging)()
' For Each pack In item.packaging
' Dim newPack As New cTelotec_Packaging()
' newPack.TypeOfPackages = pack.typeOfPackages
' newPack.NumberOfPackages = pack.numberOfPackages
' newPack.ShippingMarks = pack.shippingMarks
' newItem.Packaging.Add(newPack)
' Next
' End If
' newHc.ConsignmentItems.Add(newItem)
' Next
' End If
' telotec.HouseConsignments.Add(newHc)
' Next
'End If
End If
End With
telotec.telanm_LetzteBearbeitung = Now
telotec.telanm_Erstellung = Now
telotec.telanm_Erstellung_SB = VERAG_PROG_ALLGEMEIN.cAllgemein.USRID
telotec.telanm_LetzteBearbeitung_SB = VERAG_PROG_ALLGEMEIN.cAllgemein.USRID
telotec.ComIndicator = True
telotec.initData()
Return telotec
End Function
Private Shared Function SafeFirst(Of T, R)(list As List(Of T), selector As Func(Of T, R)) As R
If list Is Nothing OrElse list.Count = 0 Then Return Nothing
Return selector(list(0))
End Function
Private Shared Function SafeGetName(party As Object) As String
If party Is Nothing Then Return Nothing
Return If(party?.consignorName, party?.consigneeName, "")
End Function
End Class
@@ -1971,5 +2104,7 @@ Public Class cTelotec_PositionsdatenDokumente
Return ""
End Function
End Class