div Änderungen (Mailsender, MDM-Einarbeitung, USTVA, Aufschubkonen,etc.)
This commit is contained in:
@@ -57,7 +57,7 @@ Module Mail
|
||||
|
||||
' PARAM = "MDM_IT_Verguetung"
|
||||
'PARAM = "JAHRESABRECHNUNG AG-ZS"
|
||||
'PARAM = ""
|
||||
'PARAM = "KANADEVIA_DETAIL"
|
||||
|
||||
|
||||
'------------------------------------------------------------------------------------
|
||||
@@ -278,21 +278,25 @@ Module Mail
|
||||
|
||||
Case "KANADEVIA_DETAIL"
|
||||
|
||||
Dim von = CDate("01.01." & Now.Year)
|
||||
Dim bis As Date = New Date(Now.Year, Now.Month, 1).AddDays(-1)
|
||||
Dim von As Date
|
||||
Dim bis As Date
|
||||
|
||||
If Now.Month = 1 Then
|
||||
von = New Date(Now.Year - 1, 1, 1)
|
||||
bis = New Date(Now.Year - 1, 12, 31)
|
||||
Else
|
||||
von = New Date(Now.Year, 1, 1)
|
||||
bis = New Date(Now.Year, Now.Month, 1).AddDays(-1)
|
||||
End If
|
||||
|
||||
Dim mailTo = "Julie.Garton@kanadevia-inova.com; Mark.Stauffer@kanadevia-inova.com;Sevda.Aksoy@kanadevia-inova.com; Iryna.Hauser@kanadevia-inova.com"
|
||||
Dim mailToBCC = "ml@verag.ag;al@verag.ag"
|
||||
|
||||
'mailToBCC = "d.breimaier@verag.ag;"
|
||||
'mailTo = "d.breimaier@verag.ag;"
|
||||
'mailToBCC = "d.breimaier@verag.ag"
|
||||
'mailTo = "d.breimaier@verag.ag"
|
||||
|
||||
|
||||
Dim ListOfKdNr As New List(Of Integer)
|
||||
Dim Body As String = "Please find attached the reports on customs declarations for the period from " & von.ToShortDateString & " to " & bis.ToShortDateString & "." &
|
||||
"<br><br>Generated on: " & Now.ToShortDateString & ", um " & Now.ToShortTimeString &
|
||||
"<br><br><br>This is an automatically generated email. Please do not reply to this email." &
|
||||
"<br><br>VERAG SPEDITION AG"
|
||||
|
||||
ListOfKdNr.Add(770931)
|
||||
ListOfKdNr.Add(772819)
|
||||
@@ -301,6 +305,13 @@ Module Mail
|
||||
|
||||
For Each kdNr As Integer In ListOfKdNr
|
||||
|
||||
Dim Adr As New cAdressen(kdNr)
|
||||
|
||||
Dim Body As String = "Please find attached the reports on customs declarations for the period from " & von.ToShortDateString & " to " & bis.ToShortDateString & " from " & Adr.Name_1 & " (Customer-No.: " & Adr.AdressenNr & ") " &
|
||||
"<br><br>Generated on: " & Now.ToShortDateString & ", um " & Now.ToShortTimeString &
|
||||
"<br><br><br>This is an automatically generated email. Please do not reply to this email." &
|
||||
"<br><br>VERAG SPEDITION AG"
|
||||
|
||||
Dim RPT As New VERAG_PROG_ALLGEMEIN.cSpeditionsbuchReport
|
||||
|
||||
System.Console.WriteLine("Auswertung " & PARAM & " gestartet...")
|
||||
@@ -311,13 +322,18 @@ Module Mail
|
||||
Next
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Case "KANADEVIA_GENERAL"
|
||||
|
||||
Dim von = CDate("01.01." & Now.Year)
|
||||
Dim bis As Date = New Date(Now.Year, Now.Month, 1).AddDays(-1)
|
||||
Dim von As Date
|
||||
Dim bis As Date
|
||||
|
||||
If Now.Month = 1 Then
|
||||
von = New Date(Now.Year - 1, 1, 1)
|
||||
bis = New Date(Now.Year - 1, 12, 31)
|
||||
Else
|
||||
von = New Date(Now.Year, 1, 1)
|
||||
bis = New Date(Now.Year, Now.Month, 1).AddDays(-1)
|
||||
End If
|
||||
|
||||
Dim mailTo = "Julie.Garton@kanadevia-inova.com; Mark.Stauffer@kanadevia-inova.com;Sevda.Aksoy@kanadevia-inova.com; Iryna.Hauser@kanadevia-inova.com;"
|
||||
Dim mailToBCC = "ml@verag.ag;al@verag.ag;"
|
||||
@@ -327,10 +343,6 @@ Module Mail
|
||||
|
||||
|
||||
Dim ListOfKdNr As New List(Of Integer)
|
||||
Dim Body As String = "Please find attached the reports on customs declarations for the period from " & von.ToShortDateString & " to " & bis.ToShortDateString & "." &
|
||||
"<br><br>Generated on: " & Now.ToShortDateString & ", um " & Now.ToShortTimeString &
|
||||
"<br><br><br>This is an automatically generated email. Please do not reply to this email." &
|
||||
"<br><br>VERAG SPEDITION AG"
|
||||
|
||||
|
||||
ListOfKdNr.Add(770931)
|
||||
@@ -340,6 +352,15 @@ Module Mail
|
||||
|
||||
For Each kdNr As Integer In ListOfKdNr
|
||||
|
||||
Dim Adr As New cAdressen(kdNr)
|
||||
|
||||
Dim Body As String = "Please find attached the reports on customs declarations for the period from " & von.ToShortDateString & " to " & bis.ToShortDateString & " from " & Adr.Name_1 & " (Customer-No.: " & Adr.AdressenNr & ") " &
|
||||
"<br><br>Generated on: " & Now.ToShortDateString & ", um " & Now.ToShortTimeString &
|
||||
"<br><br><br>This is an automatically generated email. Please do not reply to this email." &
|
||||
"<br><br>VERAG SPEDITION AG"
|
||||
|
||||
|
||||
|
||||
Dim RPT As New VERAG_PROG_ALLGEMEIN.cSpeditionsbuchReport
|
||||
System.Console.WriteLine("Auswertung " & PARAM & " gestartet...")
|
||||
|
||||
@@ -1118,6 +1139,8 @@ Module Mail
|
||||
Body = replaceBodyVariable(Body, von, bis)
|
||||
End If
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA_ID = 0 Then VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA_ID = 1
|
||||
|
||||
Dim anhenge As New List(Of String)
|
||||
anhenge.Add(excel)
|
||||
If VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(Mailto, Subject, Body, getAbsenderEmail(),, False, cc, bcc, anhenge) Then
|
||||
|
||||
@@ -590,7 +590,7 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
|
||||
Case 2
|
||||
|
||||
'------------------------------------------
|
||||
'------------------ PDF ------------------
|
||||
'---- PDF - RECHNUNGEN AUS PDF-Datensatz --
|
||||
'------------------------------------------
|
||||
If fi.Extension.ToLower = ".pdf" Then
|
||||
|
||||
@@ -728,6 +728,10 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
|
||||
|
||||
Case 3
|
||||
|
||||
'------------------------------------------
|
||||
'---- PDF - Anhänge AUS PDF-Datensatz -----
|
||||
'------------------------------------------
|
||||
|
||||
|
||||
If (fi.Name.ToString.StartsWith("maut_") AndAlso fi.Name.ToString.Contains("EGR") AndAlso fi.Name.ToString.Contains("ALL")) Then 'bekommen wir diese PDFS noch??
|
||||
|
||||
@@ -757,7 +761,7 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
|
||||
RMC.SAVE()
|
||||
End If
|
||||
|
||||
frmStartOptions.moveFile_DateBack(fileNamePath, zielpfad & "Invoice_PDF\" & Now.Year & "\" & Now.ToString("yyyyMMdd") & "\")
|
||||
frmStartOptions.moveFile_DateBack(fileNamePath, zielpfad & "Attachments_PDF\" & Now.Year & "\" & Now.ToString("yyyyMMdd") & "\")
|
||||
If fi.Name.ToLower.Contains("pdf") Then addDGVEinarbeitung("PDF", fi.Name)
|
||||
dgvEinarbeitung.Refresh()
|
||||
found = True
|
||||
@@ -768,32 +772,54 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
|
||||
Dim fileNameMauteets As String = fi.Name
|
||||
fileNameMauteets = fileNameMauteets.Replace("mauteets_", "")
|
||||
|
||||
Dim kdNr As String = fileNameMauteets.Substring(0, 5)
|
||||
Dim mautteetsDate As String = ""
|
||||
Dim mauteetsCountry As String = ""
|
||||
' Dateiendung entfernen
|
||||
Dim fileNameWithoutExtension As String = Path.GetFileNameWithoutExtension(fileNameMauteets)
|
||||
|
||||
'22424_302753_20260808_IT_orig_bto.pdf
|
||||
' Dateiname anhand "_" aufteilen
|
||||
Dim parts() As String = fileNameWithoutExtension.Split("_"c)
|
||||
|
||||
mautteetsDate = fileNameMauteets.Substring(13, 8)
|
||||
mauteetsCountry = fileNameMauteets.Substring(23, 2)
|
||||
Dim kdNr As String = parts(0)
|
||||
Dim mautteetsDate As String = parts(2)
|
||||
Dim mauteetsCountry As String = parts(3)
|
||||
|
||||
Dim parsedDate As DateTime = DateTime.ParseExact(fileNameMauteets, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture)
|
||||
' Datum aus yyyyMMdd
|
||||
Dim parsedDate As DateTime = DateTime.ParseExact(mautteetsDate, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture)
|
||||
|
||||
Dim isBTO As Boolean = False
|
||||
If fileNameMauteets.ToString.ToLower.Contains("bto") Then
|
||||
isBTO = True
|
||||
' Nächsthöheres RMC-Datum ermitteln:
|
||||
' 01. - 14. -> 15. des Monats
|
||||
' 15. - Monatsende -> Monatsende
|
||||
' Monatsende -> 15. des Folgemonats
|
||||
|
||||
Dim getNextRMCDate As Date
|
||||
|
||||
Dim tag15 As Date = New Date(parsedDate.Year, parsedDate.Month, 15)
|
||||
Dim monatsende As Date = New Date(parsedDate.Year, parsedDate.Month, 1).AddMonths(1).AddDays(-1)
|
||||
|
||||
If parsedDate < tag15 Then
|
||||
getNextRMCDate = tag15
|
||||
ElseIf parsedDate < monatsende Then
|
||||
getNextRMCDate = monatsende
|
||||
Else
|
||||
getNextRMCDate = New Date(parsedDate.Year, parsedDate.Month, 1).AddMonths(1).AddDays(14)
|
||||
End If
|
||||
|
||||
' BTO prüfen
|
||||
Dim isBTO As Boolean = parts.Any(Function(p) p.Equals("bto", StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
|
||||
|
||||
Dim RMC As New cRMC(kdNr, parsedDate.ToString("dd.MM.yyyy"), mauteetsCountry, isBTO)
|
||||
Dim RMC As New cRMC(kdNr, getNextRMCDate.ToString("dd.MM.yyyy"), mauteetsCountry, isBTO)
|
||||
If RMC.hasEntry AndAlso RMC.rmc_daId_InvAtt Is Nothing Then
|
||||
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("MDM", "MDM_DATEN", "RMC_ATT", Now.Year, Now.ToString("yyyyMMdd"), frmStartOptions.getFileName(fileNamePath))
|
||||
DS.uploadDataToDATENSERVER(fileNamePath,,,,,, True)
|
||||
RMC.rmc_daId_InvAtt = DS.da_id
|
||||
RMC.SAVE()
|
||||
End If
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("MDM", "MDM_DATEN", "RMC_ATT", Now.Year, Now.ToString("yyyyMMdd"), frmStartOptions.getFileName(fileNamePath))
|
||||
DS.uploadDataToDATENSERVER(fileNamePath,,,,,, True)
|
||||
RMC.rmc_daId_InvAtt = DS.da_id
|
||||
RMC.SAVE()
|
||||
End If
|
||||
|
||||
frmStartOptions.moveFile_DateBack(fileNamePath, zielpfad & "Attachments_PDF\" & Now.Year & "\" & Now.ToString("yyyyMMdd") & "\")
|
||||
If fi.Name.ToLower.Contains("pdf") Then addDGVEinarbeitung("PDF", fi.Name)
|
||||
dgvEinarbeitung.Refresh()
|
||||
found = True
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user