Zollartikel, EZA Import, Tariff

This commit is contained in:
2025-12-11 09:31:45 +01:00
parent 8c23aa4f8f
commit d1c23ac18c
9 changed files with 282 additions and 151 deletions

View File

@@ -38,6 +38,10 @@ Partial Class cATLAS_EZA_IMPORT
Me.cbxGezeTNR8to11 = New System.Windows.Forms.CheckBox()
Me.cbxVERAG_V1_TNR8to11 = New System.Windows.Forms.CheckBox()
Me.Button7 = New System.Windows.Forms.Button()
Me.cboTnrTrg_VERAGImp = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cboTnrSrc_VERAGImp = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cboTnrTrg_Geze = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cboTnrDrc_Geze = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.SuspendLayout()
'
'Button1
@@ -210,12 +214,72 @@ Partial Class cATLAS_EZA_IMPORT
Me.Button7.TextAlign = System.Drawing.ContentAlignment.BottomCenter
Me.Button7.UseVisualStyleBackColor = False
'
'cboTnrTrg_VERAGImp
'
Me.cboTnrTrg_VERAGImp._allowedValuesFreiText = Nothing
Me.cboTnrTrg_VERAGImp._allowFreiText = False
Me.cboTnrTrg_VERAGImp._value = ""
Me.cboTnrTrg_VERAGImp.FormattingEnabled = True
Me.cboTnrTrg_VERAGImp.Items.AddRange(New Object() {"TR", "EU", "DE"})
Me.cboTnrTrg_VERAGImp.Location = New System.Drawing.Point(92, 164)
Me.cboTnrTrg_VERAGImp.Name = "cboTnrTrg_VERAGImp"
Me.cboTnrTrg_VERAGImp.Size = New System.Drawing.Size(41, 21)
Me.cboTnrTrg_VERAGImp.TabIndex = 31
Me.cboTnrTrg_VERAGImp.Tag = ""
Me.cboTnrTrg_VERAGImp.Text = "DE"
'
'cboTnrSrc_VERAGImp
'
Me.cboTnrSrc_VERAGImp._allowedValuesFreiText = Nothing
Me.cboTnrSrc_VERAGImp._allowFreiText = False
Me.cboTnrSrc_VERAGImp._value = ""
Me.cboTnrSrc_VERAGImp.FormattingEnabled = True
Me.cboTnrSrc_VERAGImp.Items.AddRange(New Object() {"TR", "EU", "DE"})
Me.cboTnrSrc_VERAGImp.Location = New System.Drawing.Point(49, 164)
Me.cboTnrSrc_VERAGImp.Name = "cboTnrSrc_VERAGImp"
Me.cboTnrSrc_VERAGImp.Size = New System.Drawing.Size(41, 21)
Me.cboTnrSrc_VERAGImp.TabIndex = 30
Me.cboTnrSrc_VERAGImp.Tag = ""
Me.cboTnrSrc_VERAGImp.Text = "TR"
'
'cboTnrTrg_Geze
'
Me.cboTnrTrg_Geze._allowedValuesFreiText = Nothing
Me.cboTnrTrg_Geze._allowFreiText = False
Me.cboTnrTrg_Geze._value = ""
Me.cboTnrTrg_Geze.FormattingEnabled = True
Me.cboTnrTrg_Geze.Items.AddRange(New Object() {"TR", "EU", "DE"})
Me.cboTnrTrg_Geze.Location = New System.Drawing.Point(92, 341)
Me.cboTnrTrg_Geze.Name = "cboTnrTrg_Geze"
Me.cboTnrTrg_Geze.Size = New System.Drawing.Size(41, 21)
Me.cboTnrTrg_Geze.TabIndex = 33
Me.cboTnrTrg_Geze.Tag = ""
Me.cboTnrTrg_Geze.Text = "DE"
'
'cboTnrDrc_Geze
'
Me.cboTnrDrc_Geze._allowedValuesFreiText = Nothing
Me.cboTnrDrc_Geze._allowFreiText = False
Me.cboTnrDrc_Geze._value = ""
Me.cboTnrDrc_Geze.FormattingEnabled = True
Me.cboTnrDrc_Geze.Items.AddRange(New Object() {"TR", "EU", "DE"})
Me.cboTnrDrc_Geze.Location = New System.Drawing.Point(49, 341)
Me.cboTnrDrc_Geze.Name = "cboTnrDrc_Geze"
Me.cboTnrDrc_Geze.Size = New System.Drawing.Size(41, 21)
Me.cboTnrDrc_Geze.TabIndex = 32
Me.cboTnrDrc_Geze.Tag = ""
Me.cboTnrDrc_Geze.Text = "TR"
'
'cATLAS_EZA_IMPORT
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.White
Me.ClientSize = New System.Drawing.Size(563, 355)
Me.ClientSize = New System.Drawing.Size(563, 371)
Me.Controls.Add(Me.cboTnrTrg_Geze)
Me.Controls.Add(Me.cboTnrDrc_Geze)
Me.Controls.Add(Me.cboTnrTrg_VERAGImp)
Me.Controls.Add(Me.cboTnrSrc_VERAGImp)
Me.Controls.Add(Me.Button7)
Me.Controls.Add(Me.cbxVERAG_V1_TNR8to11)
Me.Controls.Add(Me.cbxGezeTNR8to11)
@@ -255,4 +319,8 @@ Partial Class cATLAS_EZA_IMPORT
Friend WithEvents cbxGezeTNR8to11 As CheckBox
Friend WithEvents cbxVERAG_V1_TNR8to11 As CheckBox
Friend WithEvents Button7 As Button
Friend WithEvents cboTnrTrg_VERAGImp As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents cboTnrSrc_VERAGImp As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents cboTnrTrg_Geze As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents cboTnrDrc_Geze As VERAG_PROG_ALLGEMEIN.MyComboBox
End Class

View File

@@ -25,8 +25,9 @@ Public Class cATLAS_EZA_IMPORT
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Me.Cursor = Cursors.WaitCursor
importExcel_DynamicAutomotive()
Me.Cursor = Cursors.Default
End Sub
@@ -80,17 +81,20 @@ Public Class cATLAS_EZA_IMPORT
End Function
Private Function importExcel_DynamicAutomotive() As Boolean
' --- Dateiauswahl wie gehabt ---
Dim f As New frmImportFromAVISOAnhaenge(AVISO, SENDUNG)
f.ShowDialog(Me)
If f.DialogResult <> DialogResult.OK Then Return False
If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count = 0 Then Return False
If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count > 1 Then MsgBox("Nur 1 File auswählen!") : Return False
Dim fd As New OpenFileDialog
fd.Filter = "Excel Dateien|*.xls;*.xlsx"
Dim result As DialogResult = fd.ShowDialog()
If Not fd.FileName.EndsWith(".xls") And Not fd.FileName.EndsWith(".xlsx") Then
Dim filepath = f.LIST_FILES(0)
If Not filepath.ToLower.EndsWith(".xls") And Not filepath.ToLower.EndsWith(".xlsx") Then
Me.Cursor = Cursors.Default
Return False
End If
If result = System.Windows.Forms.DialogResult.OK Then
If True Then
Me.Cursor = Cursors.WaitCursor
@@ -106,7 +110,7 @@ Public Class cATLAS_EZA_IMPORT
.DisplayAlerts = False
Datei = .Workbooks.Open(fd.FileName)
Datei = .Workbooks.Open(filepath)
Blatt = Datei.Worksheets(1)
Datei.Activate()
@@ -225,17 +229,20 @@ Public Class cATLAS_EZA_IMPORT
Private Function importExcel_Geze(OP_addKN8, OP_translate, OP_TNR8to11) As Boolean
' --- Dateiauswahl wie gehabt ---
Dim f As New frmImportFromAVISOAnhaenge(AVISO, SENDUNG)
f.ShowDialog(Me)
If f.DialogResult <> DialogResult.OK Then Return False
If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count = 0 Then Return False
If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count > 1 Then MsgBox("Nur 1 File auswählen!") : Return False
Dim fd As New OpenFileDialog
fd.Filter = "Excel Dateien|*.xls;*.xlsx"
Dim result As DialogResult = fd.ShowDialog()
If Not fd.FileName.ToLower.EndsWith(".xls") And Not fd.FileName.ToLower.EndsWith(".xlsx") Then
Dim filepath = f.LIST_FILES(0)
If Not filepath.ToLower.EndsWith(".xls") And Not filepath.ToLower.EndsWith(".xlsx") Then
Me.Cursor = Cursors.Default
Return False
End If
If result = System.Windows.Forms.DialogResult.OK Then
If True Then
Me.Cursor = Cursors.WaitCursor
@@ -251,7 +258,7 @@ Public Class cATLAS_EZA_IMPORT
.DisplayAlerts = False
Datei = .Workbooks.Open(fd.FileName)
Datei = .Workbooks.Open(filepath)
Blatt = Datei.Worksheets(1)
Datei.Activate()
@@ -316,11 +323,14 @@ Public Class cATLAS_EZA_IMPORT
For i As Integer = 1 To endRows - startRows + 1 Step 1
If myArray(i, 1) IsNot Nothing AndAlso myArray(i, 1).ToString() <> "" Then
Dim POSITION As New DAKOSY_Worker.cDakosy_EZA_Warenposition
If cnt = 0 Then
POSITION.ezaWP_PackstueckAnzahl = SENDUNG.tblSnd_Colli
POSITION.ezaWP_PackstueckArt = "PK"
End If
POSITION.ezaWP_WarennummerEZT = myArray(i, 9).ToString()
POSITION.ezaWP_PackstueckAnzahl = "0" 'myArray(i, 6).ToString()
POSITION.ezaWP_PackstueckArt = "PK"
'POSITION.ezaWP_PackstueckAnzahl = myArray(i, 6).ToString()
POSITION.ezaWP_PackstueckArt = "" '"PK"
POSITION.ezaWP_Artikelpreis = CDbl(myArray(i, 7).ToString()).ToString("N2")
POSITION.ezaWP_ArtikelpreisWaehrung = myArray(i, 8).ToString()
POSITION.ezaWP_Warenbezeichnung = myArray(i, 4).ToString()
@@ -342,7 +352,8 @@ Public Class cATLAS_EZA_IMPORT
'Wenn EZT Nummer 8-stellig ist, dann auf 11-stellig erweitern
If OP_TNR8to11 Then
If If(POSITION.ezaWP_WarennummerEZT, "") <> "" AndAlso (POSITION.ezaWP_WarennummerEZT.ToString.Length >= 8 And POSITION.ezaWP_WarennummerEZT.ToString.Length < 11) Then
Dim COMM_TARIFF = VERAG_PROG_ALLGEMEIN.cATEZ_Tariff.GetFullTariff_Only1Result(POSITION.ezaWP_WarennummerEZT, "TR")
Dim COMM_TARIFF = VERAG_PROG_ALLGEMEIN.cATEZ_Tariff.GetFullTariff_Only1Result(POSITION.ezaWP_WarennummerEZT, "TR", cboTnrDrc_Geze._value, cboTnrTrg_Geze._value)
' MsgBox(COMM_TARIFF)
If COMM_TARIFF <> "" Then
POSITION.ezaWP_WarennummerEZT = COMM_TARIFF
End If
@@ -418,12 +429,12 @@ Public Class cATLAS_EZA_IMPORT
End Function
Private Function importExcel_MEYLE() As Boolean
' --- Dateiauswahl wie gehabt ---
Dim f As New frmImportFromAVISOAnhaenge(AVISO, SENDUNG)
f.ShowDialog(Me)
Dim LIST_FILES = f.LIST_FILES
If Not f.DialogResult = DialogResult.OK Then Return False
If LIST_FILES.Count = 0 Then Return False
If f.DialogResult <> DialogResult.OK Then Return False
If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count = 0 Then Return False
If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count > 1 Then MsgBox("Nur 1 File auswählen!") : Return False
@@ -438,7 +449,7 @@ Public Class cATLAS_EZA_IMPORT
Me.Cursor = Cursors.WaitCursor
For Each filePath As String In LIST_FILES
For Each filePath As String In f.LIST_FILES
If Not filePath.ToLower.EndsWith(".xls") AndAlso Not filePath.ToLower.EndsWith(".xlsx") Then
' Ungültige Datei überspringen oder abbrechen
Continue For
@@ -701,27 +712,33 @@ Public Class cATLAS_EZA_IMPORT
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.Cursor = Cursors.WaitCursor
importExcel_Geze(cbxGezeKN8.Checked, cbxGezeTranslate.Checked, cbxGezeTNR8to11.Checked)
Me.Cursor = Cursors.Default
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.Cursor = Cursors.WaitCursor
importExcel_MEYLE()
Me.Cursor = Cursors.Default
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Me.Cursor = Cursors.WaitCursor
importExcel_Fressnapf()
Me.Cursor = Cursors.Default
End Sub
Private Function importExcel_Fressnapf() As Boolean
' --- Dateiauswahl wie gehabt ---
Dim f As New frmImportFromAVISOAnhaenge(AVISO, SENDUNG)
f.ShowDialog(Me)
Dim LIST_FILES = f.LIST_FILES
If Not f.DialogResult = DialogResult.OK Then Return False
If LIST_FILES.Count = 0 Then Return False
If f.DialogResult <> DialogResult.OK Then Return False
If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count = 0 Then Return False
If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count > 1 Then MsgBox("Nur 1 File auswählen!") : Return False
@@ -736,7 +753,7 @@ Public Class cATLAS_EZA_IMPORT
Me.Cursor = Cursors.WaitCursor
For Each filePath As String In LIST_FILES
For Each filePath As String In f.LIST_FILES
If Not (filePath.ToLower().EndsWith(".xls") OrElse filePath.ToLower().EndsWith(".xlsx")) Then
Continue For
End If
@@ -1011,8 +1028,9 @@ Public Class cATLAS_EZA_IMPORT
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.Cursor = Cursors.WaitCursor
ImportExcel_CustomsTemplate_V1(cbxVERAG_V1_Kn8.Checked, cbxVERAG_V1_translate.Checked, cbxVERAG_V1_TNR8to11.Checked)
Me.Cursor = Cursors.Default
'ImportExcel_CustomsTemplate_V1_1(cbxVERAG_V1_Kn8.Checked, cbxVERAG_V1_translate.Checked, cbxVERAG_V1_TNR8to11.Checked)
End Sub
@@ -1310,7 +1328,7 @@ Public Class cATLAS_EZA_IMPORT
If tariffCache.ContainsKey(hsTmp) Then
pos.ezaWP_WarennummerEZT = tariffCache(hsTmp)
Else
pos.ezaWP_WarennummerEZT = VERAG_PROG_ALLGEMEIN.cATEZ_Tariff.GetFullTariff_Only1Result(hsTmp, "TR")
pos.ezaWP_WarennummerEZT = VERAG_PROG_ALLGEMEIN.cATEZ_Tariff.GetFullTariff_Only1Result(hsTmp, cboTnrSrc_VERAGImp._value, cboTnrTrg_VERAGImp._value)
tariffCache(hsTmp) = pos.ezaWP_WarennummerEZT
End If
End If
@@ -1518,10 +1536,13 @@ Public Class cATLAS_EZA_IMPORT
Return 0
End Function
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click, Button7.Click
Try
' Zielpfad im Temp-Ordner festlegen
Dim tempFile As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Customs_Clearance_Template_2025V1.xlsx")
Dim tempFile As String = ""
If sender Is Button7 Then : tempFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Customs_Clearance_Template_2025V1.xlsx")
ElseIf sender Is Button4 Then : tempFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Customs_Clearance_Template_V1.1.xlsx")
End If
' Ressource (als Binärdatei eingebunden) schreiben
System.IO.File.WriteAllBytes(tempFile, My.Resources.Customs_Clearance_Template)

View File

@@ -54,12 +54,6 @@ Partial Class usrCntlATLAS_EZA
Me.LadenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.XMLExampleToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.DateiimportToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.DynamicAutomotiveXLSToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.GEZEXLSXToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.MEYLEXLSXToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.FressnapToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.VERAGIMPORTFormatToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.VERAGFormatÖffnen2025V1ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
Me.EZAIDToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -448,47 +442,10 @@ Partial Class usrCntlATLAS_EZA
'
'DateiimportToolStripMenuItem
'
Me.DateiimportToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DynamicAutomotiveXLSToolStripMenuItem, Me.GEZEXLSXToolStripMenuItem, Me.MEYLEXLSXToolStripMenuItem, Me.FressnapToolStripMenuItem, Me.VERAGIMPORTFormatToolStripMenuItem, Me.VERAGFormatÖffnen2025V1ToolStripMenuItem})
Me.DateiimportToolStripMenuItem.Name = "DateiimportToolStripMenuItem"
Me.DateiimportToolStripMenuItem.Size = New System.Drawing.Size(87, 20)
Me.DateiimportToolStripMenuItem.Text = "Datei-Import"
'
'DynamicAutomotiveXLSToolStripMenuItem
'
Me.DynamicAutomotiveXLSToolStripMenuItem.Name = "DynamicAutomotiveXLSToolStripMenuItem"
Me.DynamicAutomotiveXLSToolStripMenuItem.Size = New System.Drawing.Size(244, 22)
Me.DynamicAutomotiveXLSToolStripMenuItem.Text = "Dynamic Automotive (XLSX)"
'
'GEZEXLSXToolStripMenuItem
'
Me.GEZEXLSXToolStripMenuItem.Name = "GEZEXLSXToolStripMenuItem"
Me.GEZEXLSXToolStripMenuItem.Size = New System.Drawing.Size(244, 22)
Me.GEZEXLSXToolStripMenuItem.Text = "GEZE (XLSX)"
'
'MEYLEXLSXToolStripMenuItem
'
Me.MEYLEXLSXToolStripMenuItem.Name = "MEYLEXLSXToolStripMenuItem"
Me.MEYLEXLSXToolStripMenuItem.Size = New System.Drawing.Size(244, 22)
Me.MEYLEXLSXToolStripMenuItem.Text = "MEYLE (XLSX)"
'
'FressnapToolStripMenuItem
'
Me.FressnapToolStripMenuItem.Name = "FressnapToolStripMenuItem"
Me.FressnapToolStripMenuItem.Size = New System.Drawing.Size(244, 22)
Me.FressnapToolStripMenuItem.Text = "Fressnapf (XLSX)"
'
'VERAGIMPORTFormatToolStripMenuItem
'
Me.VERAGIMPORTFormatToolStripMenuItem.Name = "VERAGIMPORTFormatToolStripMenuItem"
Me.VERAGIMPORTFormatToolStripMenuItem.Size = New System.Drawing.Size(244, 22)
Me.VERAGIMPORTFormatToolStripMenuItem.Text = "VERAG-IMPORT-Format (XLSX)"
'
'VERAGFormatÖffnen2025V1ToolStripMenuItem
'
Me.VERAGFormatÖffnen2025V1ToolStripMenuItem.Name = "VERAGFormatÖffnen2025V1ToolStripMenuItem"
Me.VERAGFormatÖffnen2025V1ToolStripMenuItem.Size = New System.Drawing.Size(244, 22)
Me.VERAGFormatÖffnen2025V1ToolStripMenuItem.Text = "VERAG-Format öffnen (2025-V1)"
'
'ToolStripMenuItem1
'
Me.ToolStripMenuItem1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EZAIDToolStripMenuItem})
@@ -557,11 +514,5 @@ Partial Class usrCntlATLAS_EZA
Friend WithEvents EZAIDToolStripMenuItem As ToolStripMenuItem
Friend WithEvents BezugsnummerKopierenToolStripMenuItem As ToolStripMenuItem
Friend WithEvents DateiimportToolStripMenuItem As ToolStripMenuItem
Friend WithEvents DynamicAutomotiveXLSToolStripMenuItem As ToolStripMenuItem
Friend WithEvents XMLExampleToolStripMenuItem As ToolStripMenuItem
Friend WithEvents GEZEXLSXToolStripMenuItem As ToolStripMenuItem
Friend WithEvents MEYLEXLSXToolStripMenuItem As ToolStripMenuItem
Friend WithEvents FressnapToolStripMenuItem As ToolStripMenuItem
Friend WithEvents VERAGIMPORTFormatToolStripMenuItem As ToolStripMenuItem
Friend WithEvents VERAGFormatÖffnen2025V1ToolStripMenuItem As ToolStripMenuItem
End Class