TC Einarbeitung + DB Telo/SpedBuch

This commit is contained in:
2025-08-12 11:33:32 +02:00
parent c677846f7b
commit ede8b3a4f0
7 changed files with 1307 additions and 918 deletions

View File

@@ -381,6 +381,59 @@ Public Class cTelotec_Anmeldung
Public Sub SAVE_ME_AKTUELLSTE_NACHRICHT(Optional saveAll = True)
''''Aktuellste Nachricht
If Me.Refs_LRN <> "" Then
SQL.doSQL(" UPDATE [tblTelotec_Anmeldung] SET telnam_aktuellsteNachricht = 0 WHERE Refs_LRN='" & Me.Refs_LRN & "' ", "FMZOLL")
Me.telnam_aktuellsteNachricht = 1
Me.SAVE(False) 'nur die Nachricht speichern
End If
End Sub
Shared Sub Update_Anmeldedatum(Refs_LRN As String, Anmeldedatum As Date)
''''Aktuellste Nachricht
If Refs_LRN <> "" Then
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
sql.doSQL(" UPDATE [tblTelotec_Anmeldung] SET telanm_Erstellung='" & Anmeldedatum.ToShortDateString & "' , dec_CreateDate='" & Anmeldedatum.ToShortDateString & "' WHERE Refs_LRN='" & Refs_LRN & "' ", "FMZOLL")
End If
End Sub
Shared Sub Update_Status_LRN(Refs_LRN As String, status As String)
''''Aktuellste Nachricht
If Refs_LRN <> "" Then
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
sql.doSQL(" UPDATE [tblTelotec_Anmeldung] SET telanm_status='" & status & "' , telanm_Status_KEWILL_Equivalent='" & status & "' WHERE Refs_LRN='" & Refs_LRN & "' AND [telnam_aktuellsteNachricht]=1 ", "FMZOLL")
End If
End Sub
Shared Sub Update_writeOffDate(Refs_LRN As String, writeOffDate As Date)
''''Aktuellste Nachricht
If Refs_LRN <> "" Then
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
sql.doSQL(" UPDATE [tblTelotec_Anmeldung] SET Hea_WoffD='" & writeOffDate.ToShortDateString & "' , Hea_DecDT='" & writeOffDate.ToShortDateString & "' WHERE Refs_LRN='" & Refs_LRN & "' ", "FMZOLL")
End If
End Sub
Public Function tryFindAviso() As Boolean
Dim srchStrFiliale = ""
@@ -499,6 +552,7 @@ Public Class cTelotec_Anmeldung
Return Nothing
End Function
Public Function UPDATE_Status(status As Integer) As String
If telanm_id > 0 Then
Try
@@ -717,22 +771,24 @@ Public Class cTelotec_Anmeldung
Public Shared Sub TELOTECDatenbereitstellung(ByVal SPEDITIONSBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, telanm_Nr As String, ByVal notFound As Boolean, ByVal art As String, ByRef PosAnzahl As Integer)
Public Shared Sub TELOTECDatenbereitstellung(ByVal SPEDITIONSBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, telanm_Nr As String, ByRef notFound As Boolean, ByVal art As String, ByRef PosAnzahl As Integer)
Dim DY As cTelotec_Anmeldung = cTelotec_Anmeldung.LOADByBezugsNr(telanm_Nr)
If DY Is Nothing Then
notFound = True
Exit Sub
End If
notFound = False
TELOTECDatenbereitstellung(SPEDITIONSBUCH, DY, notFound, art, PosAnzahl)
End Sub
Public Shared Sub TELOTECDatenbereitstellung(ByRef SPEDITIONSBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, DY As cTelotec_Anmeldung, ByVal notFound As Boolean, ByVal art As String, ByRef PosAnzahl As Integer)
Public Shared Sub TELOTECDatenbereitstellung(ByRef SPEDITIONSBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, DY As cTelotec_Anmeldung, ByRef notFound As Boolean, ByVal art As String, ByRef PosAnzahl As Integer)
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
notFound = False
Select Case art
Case "EZA", "EUA" : TELOTECDatenbereitstellung_EZA(SPEDITIONSBUCH, DY, notFound, PosAnzahl)
Case "NCTS" : TELOTECDatenbereitstellung_NCTS(SPEDITIONSBUCH, DY, notFound, PosAnzahl)
Case Else : TELOTECDatenbereitstellung_NCTS(SPEDITIONSBUCH, DY, notFound, PosAnzahl)
End Select
'Personal Abfertigung:
@@ -747,7 +803,7 @@ Public Class cTelotec_Anmeldung
End Sub
Public Shared Sub TELOTECDatenbereitstellung_EZA(ByVal SPEDITIONSBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, DY As cTelotec_Anmeldung, ByVal notFound As Boolean, ByRef PosAnzahl As Integer)
Public Shared Sub TELOTECDatenbereitstellung_EZA(ByVal SPEDITIONSBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, DY As cTelotec_Anmeldung, ByRef notFound As Boolean, ByRef PosAnzahl As Integer)
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
notFound = False
@@ -898,7 +954,7 @@ Public Class cTelotec_Anmeldung
Return False
End Function
Public Shared Sub TELOTECDatenbereitstellung_NCTS(ByRef SPEDITIONSBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, DY As cTelotec_Anmeldung, ByVal notFound As Boolean, ByRef PosAnzahl As Integer)
Public Shared Sub TELOTECDatenbereitstellung_NCTS(ByRef SPEDITIONSBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, DY As cTelotec_Anmeldung, ByRef notFound As Boolean, ByRef PosAnzahl As Integer)
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
notFound = False
@@ -906,7 +962,7 @@ Public Class cTelotec_Anmeldung
Try
If SPEDITIONSBUCH.Abfertigungsdatum Is Nothing Then SPEDITIONSBUCH.Abfertigungsdatum = Now 'CDate(DY.eza_Trans_DatumZeit).ToShortDateString
SPEDITIONSBUCH.Zollsystem_Land = "AT"
SPEDITIONSBUCH.Versendungsland = DY.Locs_Disp
SPEDITIONSBUCH.Bestimmungsland = DY.Locs_Dest
SPEDITIONSBUCH.LKW_Kennzeichen = DY.Transp_DepIdnt 'Transp_BordMo
@@ -981,8 +1037,8 @@ Public Class cTelotec_Anmeldung
'Personal Abfertigung:
Try
If DY.Represent_Na IsNot Nothing Then
Dim p = SQL.getValueTxtBySql("SELECT ISNULL(CASE WHEN [mit_FMZollPersIDKasseIsnotSpedBuch]=1 THEN [mit_FMZollPersIDSpedBuch] ELSE [mit_FMZollPersID] END ,-1) as [mit_FMZollPersID] FROM [ADMIN].[dbo].[tblMitarbeiter] WHERE [mit_TELOTEC_SB]='" & DY.Represent_Na & "'", "ADMIN")
If If(DY.dec_CreatePersonalID, DY.Represent_Na) IsNot Nothing Then
Dim p = SQL.getValueTxtBySql("SELECT ISNULL(CASE WHEN [mit_FMZollPersIDKasseIsnotSpedBuch]=1 THEN [mit_FMZollPersIDSpedBuch] ELSE [mit_FMZollPersID] END ,-1) as [mit_FMZollPersID] FROM [ADMIN].[dbo].[tblMitarbeiter] WHERE [mit_TELOTEC_SB]='" & If(DY.dec_CreatePersonalID, DY.Represent_Na) & "'", "ADMIN")
SPEDITIONSBUCH.Personalnummer = If(IsNumeric(p), p, Nothing)
End If
Catch ex As Exception
@@ -1251,18 +1307,29 @@ Public Class cTelotec_Anmeldung
With msg
If .declarationContent IsNot Nothing Then
Dim decl = .declarationContent
telotec.initData()
telotec.telanm_ART = "TA"
telotec.telanm_BezugsNr = .lrn
telotec.telanm_CRN = .mrn
telotec.MsgType = .msgType
Select Case .msgType
Case "CC029C" : telotec.telanm_Status = "50"
'Case "CC045C" : telotec.status = "53"
Case "CC045C" : telotec.telanm_Status = "60"
End Select
telotec.telanm_Status_KEWILL_Equivalent = telotec.telanm_Status
telotec.Refs_LRN = .lrn
telotec.Refs_CRN = .mrn
telotec.Represent_Na = decl.erstellPersonalID
telotec.Mandant_ID = decl.mandant_ID
telotec.Referenz_ID = decl.interfaceReferenceId
telotec.dec_CreatePersonalID = decl.erstellPersonalID
telotec.dec_CreateDate = decl.erstellDatum
telotec.dec_CreateDate = decl.anmeldedatum
telotec.dec_Template_ID = decl.template_ID
telotec.dec_TotNet = decl.totNet
telotec.dec_TotNetSplit_IND = decl.totNetSplit_IND
@@ -1272,7 +1339,7 @@ Public Class cTelotec_Anmeldung
telotec.Hea_DecTy = decl.declarationType
telotec.Hea_Simp = decl.reducedDatasetIndicator
telotec.Hea_DecDT = decl.declarationAcceptanceDate
telotec.Hea_WoffD = decl.writeOffDate
telotec.Hea_WoffD = decl.writeOffDate 'Gestetellt am...
telotec.Hea_AccDT = decl.declarationAcceptanceDate
telotec.Hea_ProArrDT = decl.presentationOfTheGoodsDateAndTime
telotec.Hea_PlaDepDT = decl.presentationOfTheGoodsDateAndTime
@@ -1284,8 +1351,15 @@ Public Class cTelotec_Anmeldung
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)
If decl.activeBorderTransportMeans IsNot Nothing AndAlso decl.activeBorderTransportMeans.Count > 0 Then
telotec.Transp_CrossIdnt = decl.activeBorderTransportMeans(0).identificationNumber
telotec.Transp_CrossIdntNat = decl.activeBorderTransportMeans(0).nationality
telotec.Transp_DepIdnt = decl.activeBorderTransportMeans(0).identificationNumber
telotec.Transp_DepNat = decl.activeBorderTransportMeans(0).nationality
End If
' Consignor/Consignee
telotec.ConorTra_Na = SafeGetName(decl.consignor)
@@ -1302,13 +1376,41 @@ Public Class cTelotec_Anmeldung
telotec.ConeeTra_Ctry = decl.consignee?.country
telotec.ConeeTra_TIN = decl.consignee?.identificationNumber
telotec.Represent_Na = decl.representative?.contactPersonName
'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
telotec.CtrlRslt_DLimit = decl.limitDate
If decl.guarantee IsNot Nothing Then
telotec.SICHERHEIT = New List(Of cTelotec_Sicherheit)
Dim TC_GRT As New cTelotec_Sicherheit()
TC_GRT.GVal = 0
TC_GRT.Mandant_ID = telotec.Mandant_ID
TC_GRT.Bereich_ID = If(telotec.Bereich_ID, "")
TC_GRT.Referenz_ID = If(telotec.Referenz_ID, "")
TC_GRT.ComIndicator = If(telotec.ComIndicator, "0")
For Each grt In decl.guarantee
TC_GRT.GrteeRef_GTy = grt.guaranteeType
For Each hc In grt.guaranteeReference
TC_GRT.GRN = hc.grn
TC_GRT.Curr = hc.currency
TC_GRT.Acc = hc.accessCode
TC_GRT.GVal += CDbl(hc.amountToBeCovered)
Next
telotec.SICHERHEIT.Add(TC_GRT)
Next
End If
' HouseConsignments inkl. ConsignmentItems und Packaging
'If decl.houseConsignment IsNot Nothing Then
@@ -1362,7 +1464,7 @@ Public Class cTelotec_Anmeldung
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