ATEZ API: NCTS-TR, Tariff: TELOTEC-API

This commit is contained in:
2024-12-10 10:53:38 +01:00
parent f83bc4c417
commit c5dec0266a
18 changed files with 824 additions and 1506 deletions

View File

@@ -5,6 +5,9 @@ Imports Tamir.SharpSsh
Imports Microsoft.Office.Interop
Imports Org.BouncyCastle.Crypto.Agreement
Imports VERAG_PROG_ALLGEMEIN
Imports TAlex.WPF.Helpers
Imports GrapeCity.DataVisualization.TypeScript
Imports Org.BouncyCastle.Math.EC.Multiplier
Public Class usrCntlTCeZOLL_EZA
Property ALLG As usrCntlTCeZOLL_EZA_Allg
@@ -543,7 +546,7 @@ Public Class usrCntlTCeZOLL_EZA
TC_ANM.telanm_SendungsId = If(SENDUNG Is Nothing, Nothing, SENDUNG.tblSnd_SendungID)
'Status?
TC_ANM.initData()
TC_ANM.SAVE() 'Speichern, ID wird erzeugt
'TC_ANM.SAVE() 'Speichern, ID wird erzeugt
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
@@ -552,7 +555,9 @@ Public Class usrCntlTCeZOLL_EZA
cboDakosyAction.Focus() 'nur, damit alle _value aktualisuiert sind...
If sentToDakosy OrElse vbYes = MsgBox("Sollen die Daten abgeschickt werden?" & vbNewLine & "Eine Änderung ist nur noch in der Telotec Software möglich.", vbYesNoCancel) Then
' Dim cDyAnm As New cDakosy_Zollanmeldungen(cDy_ART, BezugsNr, AVISO.AvisoID, SENDUNG.tblSnd_SendungID)
loadDYZollanmeldungen()
loadDYZollanmeldungen() '--> SAVE Ausgebelende!!!!!!!!!
If TC_ANM IsNot Nothing Then
'Dim cDY As New cDakosyEZA(cDyAnm.dy_Id, cDyAnm.dy_Erstellung_SB)
@@ -573,18 +578,19 @@ Public Class usrCntlTCeZOLL_EZA
TC_ANM.Hea_DecDT = Now 'Anmeldedatum
' TC_ANM.Hea_DecPlc Ort
'C_ANM.Mandant_ID = "VERCUS"
TC_ANM.Transp_ContInd = 0
TC_ANM.Declarant_TIN = "ATEOS1000059735" 'EORI
cTELOTECInterface_Send.loadInClass_VersandanmeldungEZA(TC_ANM, Me)
If Not TC_ANM.SAVE() Then Exit Sub
' If Not TC_ANM.SAVE() Then Exit Sub
Dim saveFile = ""
If cTELOTECInterface_Send.generateVersandanmeldungEZA(TC_ANM, saveFile, cboDakosyAction._value) Then
MsgBox(saveFile)
'MsgBox(saveFile)
If saveFile <> "" Then
If Not cTC_Functions.send_Data_To_TC(saveFile, BezugsNr, TC_ANM.telanm_id, FIRMA_DY) Then
MsgBox("Sendefehler!")
@@ -708,6 +714,7 @@ Public Class usrCntlTCeZOLL_EZA
'Laden des Bereiches aus dem Excel:
Dim myRange As Excel.Range
myRange = Blatt.Range("B" & startRows & ":N" & endRows & "")
' MsgBox("B" & startRows & ":N" & endRows & "")
Dim myArray As Object(,) '<-- declared as 2D Array
myArray = myRange.Value 'store the content of each cell
'myArray(i_soll2 - startRows + 1, 4)
@@ -717,8 +724,9 @@ Public Class usrCntlTCeZOLL_EZA
If splitTNR Then
DT = aggregierenTrendxolTNR(myArray) '--> TNR, Orig, Curr
Else
aggregierenTrendxol(myArray) '--> !!BEschreibung!! , TNR, Orig, Curr
DT = aggregierenTrendxol(myArray) '--> !!BEschreibung!! , TNR, Orig, Curr
End If
' MsgBox("agg" & myArray.Count)
Dim cnt = 0
@@ -747,7 +755,8 @@ Public Class usrCntlTCeZOLL_EZA
POSITION.PACKSTUECKE.Clear()
Dim PK As New TELOTEC_Worker.cTelotec_Packstuecke
PK.Pack_Kind = "PK"
PK.Pack_Nr = row("SumQty").ToString()
' MsgBox(row("SumQty"))
PK.Pack_Nr = CInt(row("SumQty"))
POSITION.PACKSTUECKE.Add(PK)
If row("Currency") = "EUR" Then
@@ -758,6 +767,7 @@ Public Class usrCntlTCeZOLL_EZA
POSITION.Item_GdsDes = desc
POSITION.Item_Orig = row("Origin").ToString()
' MsgBox(POSITION.Item_GdsDes)
TC_ANM.POSITIONSDATEN.Add(POSITION)
@@ -850,6 +860,7 @@ Public Class usrCntlTCeZOLL_EZA
'DT.Columns.Add("A")
DT.Columns.Add("Description")
DT.Columns.Add("Tariff")
DT.Columns.Add("TariffNf")
DT.Columns.Add("Currency")
DT.Columns.Add("Origin")
DT.Columns.Add("SumQty")
@@ -899,17 +910,20 @@ Public Class usrCntlTCeZOLL_EZA
' 'MsgBox("h> " & r("H"))
' MsgBox("i> " & r("I"))
'Next
'Key .Description = row.Field(Of String)("D") & ", " & row.Field(Of String)("F"),
Dim amountGrpByDates = From row In DT
Group row By groupKeys = New With {
Key .Orig = row.Field(Of String)("E"),
Key .Description = row.Field(Of String)("D") & ", " & row.Field(Of String)("F"),
Key .Description = VERAG_PROG_ALLGEMEIN.cTariffKN8_Interface.getKN8FromTNR(row.Field(Of String)("G")) & ", hier: " & row.Field(Of String)("D") & "," & row.Field(Of String)("F") & ",etc.",
Key .Tnr = row.Field(Of String)("G"),
Key .Curr = row.Field(Of String)("N")
} Into Group
Select New With {
Key .Params = groupKeys,
.SumQTY = Group.Sum(Function(x) x.Field(Of Integer)("I")),
.SumAmount = Group.Sum(Function(x) x.Field(Of Decimal)("M"))}
.SumAmount = Group.Sum(Function(x) x.Field(Of Decimal)("M"))}
' .SumQTY = Group.Sum(Function(x) x.Field(Of Integer)("I"))}
@@ -917,12 +931,22 @@ Public Class usrCntlTCeZOLL_EZA
Call CreateDataTableAgg(DT_AGG) 'Create the DataTable and all Columns
For Each grp In amountGrpByDates
'Dim row As New DataRow
'MsgBox("" & grp.Params.Orig & " " & grp.Params.Description & " " & grp.Params.Tnr & " " & grp.Params.Curr & "= " & grp.SumQTY & " " & grp.SumAmount & "")
DT_AGG.Rows.Add({grp.Params.Description, grp.Params.Tnr, grp.Params.Curr, grp.Params.Orig, grp.SumQTY, grp.SumAmount})
DT_AGG.Rows.Add({grp.Params.Description, grp.Params.Tnr, "", grp.Params.Curr, grp.Params.Orig, grp.SumQTY, grp.SumAmount})
Next
If MsgBox("Excel ausgeben?", vbYesNo) = vbYes Then
'Excel ausgeben
SDL.cProgramFunctions.genExcelCSVFromDT(DT_AGG)
End If
'DT.AsEnumerable().GroupBy(row >= row.Field < Int() > ("G"))
'Dim myArrayAgg As Object(,) '<-- declared as 2D Array
@@ -974,6 +998,7 @@ Public Class usrCntlTCeZOLL_EZA
End Function
Function aggregierenTrendxolTNR(myArray) As DataTable
Try
Dim DT As DataTable = New DataTable()
@@ -1017,17 +1042,20 @@ Public Class usrCntlTCeZOLL_EZA
' 'MsgBox("h> " & r("H"))
' MsgBox("i> " & r("I"))
'Next
VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat()
Dim amountGrpByDates = From row In DT
Group row By groupKeys = New With {
Key .Orig = row.Field(Of String)("E"),
Key .Tnr = row.Field(Of String)("G"),
Key .Description = VERAG_PROG_ALLGEMEIN.cTariffKN8_Interface.getKN8FromTNR(row.Field(Of String)("G")),
Key .Curr = row.Field(Of String)("N")
} Into Group
Select New With {
Key .Params = groupKeys,
.SumQTY = Group.Sum(Function(x) x.Field(Of Integer)("I")),
.Desc = "zB: " & Group.Min(Function(x) (x.Field(Of String)("D") & ", " & x.Field(Of String)("F"))) & " / " & Group.Max(Function(x) (x.Field(Of String)("D") & ", " & x.Field(Of String)("F"))) & ", etc.",
.SumAmount = Group.Sum(Function(x) x.Field(Of Decimal)("M"))}
.Desc = ", hier: " & Group.Min(Function(x) (x.Field(Of String)("D") & ", " & x.Field(Of String)("F"))) & " / " & Group.Max(Function(x) (x.Field(Of String)("D") & ", " & x.Field(Of String)("F"))) & ", etc.",
.SumAmount = Group.Sum(Function(x) x.Field(Of Decimal)("M"))}
' .SumQTY = Group.Sum(Function(x) x.Field(Of Integer)("I"))}
'row.Field(Of String)("D") & ", " & row.Field(Of String)("F")
@@ -1038,12 +1066,19 @@ Public Class usrCntlTCeZOLL_EZA
For Each grp In amountGrpByDates
'Dim row As New DataRow
'MsgBox("" & grp.Params.Orig & " " & grp.Params.Description & " " & grp.Params.Tnr & " " & grp.Params.Curr & "= " & grp.SumQTY & " " & grp.SumAmount & "")
MsgBox(grp.SumQTY)
DT_AGG.Rows.Add({grp.Desc, grp.Params.Tnr, grp.Params.Curr, grp.Params.Orig, grp.SumQTY, grp.SumAmount})
' MsgBox(grp.SumQTY)
DT_AGG.Rows.Add({grp.Params.Description & grp.Desc, grp.Params.Tnr, "", grp.Params.Curr, grp.Params.Orig, grp.SumQTY, grp.SumAmount})
Next
If MsgBox("Excel ausgeben?", vbYesNo) = vbYes Then
'Excel ausgeben
SDL.cProgramFunctions.genExcelCSVFromDT(DT_AGG)
End If
'DT.AsEnumerable().GroupBy(row >= row.Field < Int() > ("G"))
'Dim myArrayAgg As Object(,) '<-- declared as 2D Array
@@ -1117,7 +1152,7 @@ Public Class usrCntlTCeZOLL_EZA
' MsgBox(Blatt.Range("B" & zeile).Value.ToString())
' Überprüfen, ob in Spalte B (2) "DESCRIPTION" steht
If Blatt.Range("B" & zeile).Value IsNot Nothing AndAlso Blatt.Range("B" & zeile).Value.ToString().Trim().ToUpper() = "DESCRIPTION" Then
MsgBox(Blatt.Range("B" & zeile).Value.ToString())
' MsgBox(Blatt.Range("B" & zeile).Value.ToString())
startRows = zeile + 1
gefunden = True
Exit While