GVMS Feature implementiert

This commit is contained in:
2022-11-15 15:54:10 +01:00
parent 4598cce1d1
commit c4aaf70bee
6 changed files with 654 additions and 448 deletions

View File

@@ -7,6 +7,7 @@ Imports System.Data.SqlClient
Imports iTextSharp.text.pdf
Imports Microsoft.Office.Interop
Imports DocumentFormat.OpenXml.Presentation
Imports CefSharp
Public Class frmSendungsdetailsNEU
Public AvisoId As Integer
@@ -2170,6 +2171,8 @@ Public Class frmSendungsdetailsNEU
btnAufschub_Empf.Visible = (cboAbfertigungsart._value <> "23")
btnAufschub_VERAG.Visible = (cboAbfertigungsart._value <> "23")
setContextMenuGVMSControl()
If cboAbfertigungsart._value = "23" Then
SENDUNG_LIST(CURRENT_INDEX).tblSnd_aufschub = ""
ElseIf cboAbfertigungsart._value = "9" Then
@@ -2909,6 +2912,7 @@ Public Class frmSendungsdetailsNEU
Dim FilialeAktFirma = VERAG_PROG_ALLGEMEIN.cAllgemein.getFirmaFromFiliale2(SENDUNG_LIST(CURRENT_INDEX).FilialenNr,, "")
Dim FilialeNeuFirma = VERAG_PROG_ALLGEMEIN.cAllgemein.getFirmaFromFiliale2(cboFiliale._value,, "")
setContextMenuGVMSControl()
If FilialeNeuFirma <> "FRONTOFFICE" And FilialeAktFirma <> "FRONTOFFICE" Then
If FilialeAktFirma <> "" And FilialeNeuFirma <> "" Then
@@ -5126,7 +5130,6 @@ Public Class frmSendungsdetailsNEU
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
Mail = outl.CreateItem(0)
Dim OnylSND = -1
If sender Is AktuelleSendungAnhängeWählenToolStripMenuItem Then
'For Each r As DataGridViewRow In dgvAnhang.SelectedRows
@@ -5293,6 +5296,144 @@ Public Class frmSendungsdetailsNEU
Me.Cursor = Cursors.Default
End Sub
Private Sub AktuelleSendungGVMSToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AlleEIDRSendungenToolStripMenuItem.Click, AktuelleSendungToolStripMenuItem.Click
Me.Cursor = Cursors.WaitCursor
Try
VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.clearTMPPath("ClipBoard_TMP")
If True Then
Try
Dim outl As New Outlook.Application
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
Dim isReply As Boolean = False
If dgvAnhang.SelectedRows.Count = 1 AndAlso dgvAnhang.CurrentRow.Cells("anh_Typ").Value = "MSG" Then
Dim olSess = outl.Session
Dim PathTmpANH = VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(dgvAnhang.CurrentRow.Cells("anh_docId").Value)
Mail = CType(olSess.OpenSharedItem(PathTmpANH), Outlook.MailItem)
Mail = Mail.Reply()
isReply = True
Else
Mail = outl.CreateItem(0)
End If
Dim OnylSND = -1
If sender Is AktuelleSendungToolStripMenuItem Then
'For Each r As DataGridViewRow In dgvAnhang.SelectedRows
' Mail.Attachments.Add(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(r.Cells("anh_docId").Value), Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue)
'Next
OnylSND = CURRENT_INDEX
End If
'LEX
Mail.Subject = "GVMS: Kennzeichen: " & AVISO.LKW_Nr & " | Pos: " & SENDUNG_LIST(CURRENT_INDEX).FilialenNr & "/" & SENDUNG_LIST(CURRENT_INDEX).AbfertigungsNr
Dim DETextHTML = ""
DETextHTML &= "Sehr geehrter Geschäftspartner,<br>"
DETextHTML &= "<br>"
DETextHTML &= "hiermit bestätigen wir, dass die folgende(n) Sendung(en) durch uns im EIDR Verfahren erfasst wurden.<br>
Sie dürfen somit ins Zollgebiet des Vereinigten Königreichs einfahren und die Waren in den Freien Verkehr bringen.<br>"
DETextHTML &= "Bitte beachten Sie, dass Sie vor der Überfahrt einen GVMS-Eintrag erstellen müssen.<br>"
DETextHTML &= "Bitte verwenden Sie als Deklarationstyp die Entry In Declarant's Records (EIDR) und als Referenz die EORI-Nr.<br>"
DETextHTML &= "Wir übernehmen gerne die Eintragung für Sie bitte antworten Sie auf dieses Mail, wenn die Anmeldung durch uns durchgeführt werden sollte.<br><br>"
Dim ENTextHTML = ""
ENTextHTML &= "<br>"
ENTextHTML &= "Dear Business Partner,<br>"
ENTextHTML &= "<br>"
ENTextHTML &= "We hereby confirm that the following shipment(s) have been registered by us under the EIDR procedure.<br>
You may therefore enter the customs territory of the United Kingdom and release the goods for free circulation.<br>"
ENTextHTML &= "Please use Entry In Declarant's Records (EIDR) as declaration type and EORI no. as reference.<br>"
ENTextHTML &= "Please note that you must create a GVMS entry before crossing.<br>
We will be happy to make the entry for you - please reply to this email if the entry should be made by us"
ENTextHTML &= "You will find instructions attached.<br><br>"
ENTextHTML &= "Sendungen/Shipment(s):<br>"
Dim TextHTMLtable = ""
TextHTMLtable &= "<table border=1>"
TextHTMLtable &= "<tr><td>Pos</td><td>Referenz</td><td>Absender/Sender</td><td>Empfänger/Recipient</td><td>Sendung/Shipment</td><td>Kennzeichen/License plate</td><td>Frächter/Carrier</td><td>EORI</td></tr>"
Dim cnt = 1
For Each SND In SENDUNG_LIST
If True Then '(OnylSND >= 0 AndAlso SND Is SENDUNG_LIST(OnylSND)) Or (OnylSND < 0 And SND.FilialenNr = 7001) Then
TextHTMLtable &= "<tr>"
TextHTMLtable &= "<td><b>" & cnt & "</b></td>"
TextHTMLtable &= "<td><b>" & SND.FilialenNr & "/" & SND.AbfertigungsNr & "</b></td>"
TextHTMLtable &= "<td><b>" & SND.tblSnd_Absender & "</b></td>"
TextHTMLtable &= "<td><b>" & SND.tblSnd_Empfaenger & "</b></td>"
TextHTMLtable &= "<td><b>" & SND.tblSnd_Colli & " Pk. " & SND.tblSnd_Warenbezeichnung & " - " & SND.tblSnd_Gewicht & " kg </b></td>"
TextHTMLtable &= "<td><b>" & AVISO.LKW_Nr & "</b></td>"
TextHTMLtable &= "<td><b>" & AVISO.Frächter_KdNr & "</b></td>"
Dim KD As New VERAG_PROG_ALLGEMEIN.cKunde(SND.tblSnd_EmpfaengerKdNr)
If KD IsNot Nothing AndAlso KD IsNot Nothing Then
TextHTMLtable &= "<td><b>" & If(KD.EORITIN, "") & "</b></td>"
Else
TextHTMLtable &= "<td><b>-</b></td>"
End If
TextHTMLtable &= "</tr>"
cnt += 1
End If
Next
TextHTMLtable &= "</table>"
Dim EndTextHTML = ""
EndTextHTML &= "<br>"
EndTextHTML &= "<br>"
EndTextHTML &= "Für Rückfragen stehen wir gerne zur Verfügung/We are at your disposal for any questions<br>"
EndTextHTML &= "<br>"
EndTextHTML &= "Mit freundlichen Grüßen/Best regards<br>"
EndTextHTML &= VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME & "<br>"
EndTextHTML &= "<br>"
If isReply Then
Dim HTML = DETextHTML & ENTextHTML & TextHTMLtable & EndTextHTML & SDL.cFakturierung.getSignature("DE") & Mail.HTMLBody
Mail.HTMLBody = HTML
Mail.Display()
Else
Mail.HTMLBody = "<div style=""font-family:Calibri, Arial;font-size:15px;"">" & DETextHTML & ENTextHTML & TextHTMLtable & EndTextHTML & SDL.cFakturierung.getSignature("DE") & "</div>"
Mail.Display()
End If
'AvisoStatusFunctions.insertSendungsVermerk(SENDUNG_LIST(CURRENT_INDEX).tblSnd_SendungID, AvisoId, "Doks an Fremdspedition (SUBEN) weitergeleitet.", 46)
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name,, "Fehler beim Öffnen der Mail!")
End Try
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name,, "Fehler beim Öffnen der Mail!")
End Try
Me.Cursor = Cursors.Default
End Sub
Private Sub AMBARZollbeschauToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AMBARZollbeschauToolStripMenuItem.Click
Me.Cursor = Cursors.WaitCursor
@@ -5481,4 +5622,16 @@ Public Class frmSendungsdetailsNEU
Me.Cursor = Cursors.Default
End Sub
Private Sub setContextMenuGVMSControl()
If cboFiliale._value = "7001" AndAlso cboAbfertigungsart._value = "46" Then
GVMSInfoToolStripMenuItem.Visible = True
Else
GVMSInfoToolStripMenuItem.Visible = False
End If
End Sub
End Class