This commit is contained in:
2021-02-02 22:39:23 +01:00
parent 3e4a86ab76
commit 326c3fcb11
8 changed files with 288 additions and 67 deletions

View File

@@ -4293,7 +4293,7 @@ Public Class frmSendungsdetailsNEU
Blatt.Range("F13").Value = "" 'DDA
Blatt.Range("C26").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Gewicht
Blatt.Range("G26").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Colli
Blatt.Range("G26").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Colli.Replace(",", "").Replace(".", "")
Blatt.Range("D27").Value = "" 'Procedure
Blatt.Range("F29").Value = "" 'CPC
Blatt.Range("F30").Value = "" 'Supervising HMRC Adress
@@ -4307,6 +4307,169 @@ Public Class frmSendungsdetailsNEU
Blatt.Range("G42").Value = Now.ToShortDateString
Datei.Save
If False Then
Blatt.PrintOutEx()
Else
'Process.Start(Path)
.Visible = True
End If
End With
End If
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
End Try
Me.Cursor = Cursors.Default
End Sub
Private Sub ExportToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExportToolStripMenuItem.Click
Me.Cursor = Cursors.WaitCursor
Try
Dim Path = ""
If True Then
Dim sPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\ATANAK\"
If Not My.Computer.FileSystem.DirectoryExists(sPath) Then
My.Computer.FileSystem.CreateDirectory(sPath)
End If
Dim exclApp As Object 'as Application
Dim Datei As Object 'as WorkBook
Dim Blatt As Object 'Microsoft.Office.Interop.Excel.Worksheet 'As Object 'as Worksheet
exclApp = CreateObject("Excel.Application")
With exclApp
.Visible = False
Try
Path = sPath & "ATANAK_Export_" & SENDUNG_LIST(CURRENT_INDEX).FilialenNr & "-" & SENDUNG_LIST(CURRENT_INDEX).AbfertigungsNr & "" & " .xlsx"
While System.IO.File.Exists(Path)
Path = sPath & "ATANAK_Export_" & SENDUNG_LIST(CURRENT_INDEX).FilialenNr & "-" & SENDUNG_LIST(CURRENT_INDEX).AbfertigungsNr & "" & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
End While
My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.ATANAK_Instructions_Export, False)
Catch ex As System.Exception
' MsgBox(ex.Message)
MsgBox("ERROR 01: " & ex.Message & vbNewLine & ex.StackTrace)
Me.Cursor = Cursors.Default
Exit Sub
End Try
Datei = .Workbooks.Open(Path) 'Anpassen
Blatt = Datei.Worksheets(1) 'Anpassen
Blatt.Range("B8").Value = SENDUNG_LIST(CURRENT_INDEX).FilialenNr & "/" & SENDUNG_LIST(CURRENT_INDEX).AbfertigungsNr
Blatt.Range("D6").Value = AVISO.LKW_Nr
Dim absender = ""
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_AbsenderKdNr > 0 Then
Dim KD As New VERAG_PROG_ALLGEMEIN.cKunde(SENDUNG_LIST(CURRENT_INDEX).tblSnd_AbsenderKdNr)
If KD IsNot Nothing AndAlso If(KD.EORITIN, "") <> "" Then
absender = KD.EORITIN
End If
End If
absender = (absender & " " & SENDUNG_LIST(CURRENT_INDEX).tblSnd_Absender).Trim
Blatt.Range("E10").Value = absender
Blatt.Range("E11").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Empfaenger
'Blatt.Range("C26").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Gewicht
Blatt.Range("I15").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Colli.Replace(",", "").Replace(".", "")
Blatt.Range("B17").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenbezeichnung
Blatt.Range("C33").Value = VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.Fullname
Blatt.Range("H33").Value = Now.ToShortDateString
Datei.Save
If False Then
Blatt.PrintOutEx()
Else
'Process.Start(Path)
.Visible = True
End If
End With
End If
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
End Try
Me.Cursor = Cursors.Default
End Sub
Private Sub ExportT1ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExportT1ToolStripMenuItem.Click
Me.Cursor = Cursors.WaitCursor
Try
Dim Path = ""
If True Then
Dim sPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\ATANAK\"
If Not My.Computer.FileSystem.DirectoryExists(sPath) Then
My.Computer.FileSystem.CreateDirectory(sPath)
End If
Dim exclApp As Object 'as Application
Dim Datei As Object 'as WorkBook
Dim Blatt As Object 'Microsoft.Office.Interop.Excel.Worksheet 'As Object 'as Worksheet
exclApp = CreateObject("Excel.Application")
With exclApp
.Visible = False
Try
Path = sPath & "ATANAK_ExportT1_" & AVISO.AvisoID & "" & " .xlsx"
While System.IO.File.Exists(Path)
Path = sPath & "ATANAK_ExportT1_" & AVISO.AvisoID & "" & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
End While
My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.ATANAK_Instructions_Export_T1, False)
Catch ex As System.Exception
' MsgBox(ex.Message)
MsgBox("ERROR 01: " & ex.Message & vbNewLine & ex.StackTrace)
Me.Cursor = Cursors.Default
Exit Sub
End Try
Datei = .Workbooks.Open(Path) 'Anpassen
Blatt = Datei.Worksheets(1) 'Anpassen
Blatt.Range("F7").Value = AVISO.AvisoID
Blatt.Range("F6").Value = AVISO.LKW_Nr
Dim fraechter = ""
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_FrachtfuehrerKdNr > 0 Then
Dim AD As New VERAG_PROG_ALLGEMEIN.cAdressen(SENDUNG_LIST(CURRENT_INDEX).tblSnd_AbsenderKdNr)
If AD IsNot Nothing Then
Blatt.Range("E13").Value = AD.Name_1
Blatt.Range("E14").Value = (If(AD.LandKz, "") & " " & If(AD.PLZ, "") & " " & If(AD.Ort, "") & " " & If(AD.Straße, "")).trim
End If
Blatt.Range("E13").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Frachtfuehrer
Else
Blatt.Range("E13").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Frachtfuehrer
End If
'Blatt.Range("C26").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Gewicht
Blatt.Range("I17").Value = SENDUNG_LIST(CURRENT_INDEX).tblSnd_Colli.Replace(",", "").Replace(".", "")
Blatt.Range("C25").Value = VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.Fullname
Blatt.Range("H25").Value = Now.ToShortDateString
Datei.Save
If False Then