Ankunft, etc,
This commit is contained in:
@@ -360,13 +360,24 @@ Module Mail
|
|||||||
|
|
||||||
Dim KdNr As String = "764755"
|
Dim KdNr As String = "764755"
|
||||||
|
|
||||||
If dtParam.Rows.Count = 1 Then
|
If dtParam.Rows.Count > 1 Then
|
||||||
|
|
||||||
|
'System.Console.WriteLine("OPTION erkannt: " & dtParam.Rows(0).Item("ms_info"))
|
||||||
|
'System.Console.WriteLine("Auswertung Details gestartet...")
|
||||||
|
'If SendEmail_ZF(dtParam.Rows(0).Item("ms_an"), dtParam.Rows(0).Item("ms_kundenNr"), von, bis, "quarter", dtParam.Rows(0).Item("ms_cc"), dtParam.Rows(0).Item("ms_bcc"), dtParam.Rows(0).Item("ms_subject"), dtParam.Rows(0).Item("ms_mailtext")) Then
|
||||||
|
' System.Console.WriteLine("Vorgang erfolgreich abgeschlossen ...")
|
||||||
|
'End If
|
||||||
|
|
||||||
|
|
||||||
|
For Each r As DataRow In dtParam.Rows
|
||||||
|
|
||||||
|
System.Console.WriteLine("OPTION erkannt: " & r.Item("ms_info"))
|
||||||
|
System.Console.WriteLine("Auswertung Details gestartet...")
|
||||||
|
If SendEmail_ZF(dtParam.Rows(0).Item("ms_an"), dtParam.Rows(0).Item("ms_kundenNr"), von, bis, "quarter", dtParam.Rows(0).Item("ms_cc"), dtParam.Rows(0).Item("ms_bcc"), dtParam.Rows(0).Item("ms_subject"), dtParam.Rows(0).Item("ms_mailtext")) Then
|
||||||
|
System.Console.WriteLine("Vorgang erfolgreich abgeschlossen ...")
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
System.Console.WriteLine("OPTION erkannt: " & dtParam.Rows(0).Item("ms_info"))
|
|
||||||
System.Console.WriteLine("Auswertung Details gestartet...")
|
|
||||||
If SendEmail_ZF(dtParam.Rows(0).Item("ms_an"), dtParam.Rows(0).Item("ms_kundenNr"), von, bis, "quarter", dtParam.Rows(0).Item("ms_cc"), dtParam.Rows(0).Item("ms_bcc"), dtParam.Rows(0).Item("ms_subject"), dtParam.Rows(0).Item("ms_mailtext")) Then
|
|
||||||
System.Console.WriteLine("Vorgang erfolgreich abgeschlossen ...")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
@@ -2455,10 +2466,17 @@ Module Mail
|
|||||||
Public Function genEXCEL_ZF(KdNr As String, von As Date, bis As Date, Auswertungstyp As String) As String
|
Public Function genEXCEL_ZF(KdNr As String, von As Date, bis As Date, Auswertungstyp As String) As String
|
||||||
Try
|
Try
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim KUNDENADR = New VERAG_PROG_ALLGEMEIN.cAdressen(KdNr)
|
Dim KUNDENADR = New VERAG_PROG_ALLGEMEIN.cAdressen(KdNr)
|
||||||
|
Dim Path = ""
|
||||||
|
|
||||||
|
If KdNr = "714869" Or KdNr = "718486" Or KdNr = "764755" Then 'ZUR SICHERHEIT, FALLS FALSCHE KDNR EINGEGEBEN WIRD!!!
|
||||||
|
|
||||||
|
|
||||||
Dim dt As DataTable = loadDgvBySqlFMZOLL("SELECT CAST([FilialenNr] as varchar) + '/' + CAST([AbfertigungsNr] as varchar) Abfertigungsnummer
|
|
||||||
|
Dim dt As DataTable = loadDgvBySqlFMZOLL("SELECT CAST([FilialenNr] as varchar) + '/' + CAST([AbfertigungsNr] as varchar) Abfertigungsnummer
|
||||||
,cast([Abfertigungsdatum] as date)Abfertigungsdatum
|
,cast([Abfertigungsdatum] as date)Abfertigungsdatum
|
||||||
,Absender
|
,Absender
|
||||||
,Rechnungsbetrag Betrag
|
,Rechnungsbetrag Betrag
|
||||||
@@ -2469,117 +2487,159 @@ Module Mail
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim sPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\SR\"
|
Dim sPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\SR\"
|
||||||
If Not My.Computer.FileSystem.DirectoryExists(sPath) Then
|
If Not My.Computer.FileSystem.DirectoryExists(sPath) Then
|
||||||
My.Computer.FileSystem.CreateDirectory(sPath)
|
My.Computer.FileSystem.CreateDirectory(sPath)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Path = ""
|
|
||||||
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")
|
|
||||||
|
|
||||||
Select Case Auswertungstyp
|
|
||||||
Case "monthly"
|
|
||||||
|
|
||||||
|
|
||||||
With exclApp
|
|
||||||
.Visible = False
|
|
||||||
|
|
||||||
Try
|
Dim exclApp As Object 'as Application
|
||||||
Path = sPath & "ZF_" & KdNr & "_" & von.ToShortDateString & " - " & bis.ToShortDateString & "" & ".xlsx"
|
Dim Datei As Object 'as WorkBook
|
||||||
While System.IO.File.Exists(Path)
|
Dim Blatt As Object 'Microsoft.Office.Interop.Excel.Worksheet 'As Object 'as Worksheet
|
||||||
Path = sPath & "ZF_" & KdNr & "_" & von.ToShortDateString & "-" & bis.ToShortDateString & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
|
exclApp = CreateObject("Excel.Application")
|
||||||
End While
|
|
||||||
My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.RG_ZF, False)
|
Select Case Auswertungstyp
|
||||||
Catch ex As System.Exception
|
Case "monthly"
|
||||||
' MsgBox(ex.Message)
|
|
||||||
MsgBox("Error 01: " & ex.Message & vbNewLine & ex.StackTrace)
|
|
||||||
|
|
||||||
|
|
||||||
Return ""
|
With exclApp
|
||||||
End Try
|
.Visible = False
|
||||||
|
|
||||||
Datei = .Workbooks.Open(Path) 'Anpassen
|
Try
|
||||||
Blatt = Datei.Worksheets(1) 'Anpassen
|
Path = sPath & "ZF_" & KdNr & "_" & von.ToShortDateString & " - " & bis.ToShortDateString & "" & ".xlsx"
|
||||||
|
While System.IO.File.Exists(Path)
|
||||||
|
Path = sPath & "ZF_" & KdNr & "_" & von.ToShortDateString & "-" & bis.ToShortDateString & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
|
||||||
|
End While
|
||||||
|
My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.RG_ZF, False)
|
||||||
|
Catch ex As System.Exception
|
||||||
|
' MsgBox(ex.Message)
|
||||||
|
MsgBox("Error 01: " & ex.Message & vbNewLine & ex.StackTrace)
|
||||||
|
|
||||||
Blatt.Range("I1").Value = von.ToShortDateString & "-" & bis.ToShortDateString
|
|
||||||
|
|
||||||
Dim cnt = 3
|
Return ""
|
||||||
For Each r In dt.Rows
|
End Try
|
||||||
Blatt.Range("A" & cnt).Value = cnt - 2
|
|
||||||
Blatt.Range("B" & cnt).Value = r("Abfertigungsnummer")
|
|
||||||
' Blatt.Range("C" & cnt).Value = r("RechnungsNr")
|
|
||||||
Blatt.Range("C" & cnt).Value = r("Abfertigungsdatum")
|
|
||||||
Blatt.Range("D" & cnt).Value = r("Abfertigungsbezeichnung")
|
|
||||||
Blatt.Range("E" & cnt).Value = r("Absender")
|
|
||||||
Blatt.Range("F" & cnt).Value = "" 'r("Betrag")
|
|
||||||
Blatt.Range("H" & cnt).Value = r("BelegNr")
|
|
||||||
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "VERAG"
|
Datei = .Workbooks.Open(Path) 'Anpassen
|
||||||
|
Blatt = Datei.Worksheets(1) 'Anpassen
|
||||||
|
|
||||||
Dim ZOLLANMELDUNG As New cZollsysteme_Aktenbeschriftung
|
Blatt.Range("I1").Value = von.ToShortDateString & "-" & bis.ToShortDateString
|
||||||
Dim zS = If(r("Zollsystem_Land") IsNot DBNull.Value, r("Zollsystem_Land").ToString(), "")
|
|
||||||
If ZOLLANMELDUNG.getDataByBezugsnummer(r("FilialenNr") & "/" & r("AbfertigungsNr"), r("Abfertigungsart"), "", False, zS) Then
|
Dim cnt = 3
|
||||||
Blatt.Range("F" & cnt).Value = ZOLLANMELDUNG.Rechnungspreis
|
For Each r In dt.Rows
|
||||||
Blatt.Range("G" & cnt).Value = ZOLLANMELDUNG.Handelsrechnung.Replace(", ", "," & vbNewLine)
|
Blatt.Range("A" & cnt).Value = cnt - 2
|
||||||
Blatt.Range("I" & cnt).Value = ZOLLANMELDUNG.ABGABEN_ZOLL
|
Blatt.Range("B" & cnt).Value = r("Abfertigungsnummer")
|
||||||
Blatt.Range("J" & cnt).Value = ZOLLANMELDUNG.ANZ_POS
|
' Blatt.Range("C" & cnt).Value = r("RechnungsNr")
|
||||||
If If(ZOLLANMELDUNG.ATCMRN, "") <> "" Then
|
Blatt.Range("C" & cnt).Value = r("Abfertigungsdatum")
|
||||||
Blatt.Range("H" & cnt).Value = ZOLLANMELDUNG.ATCMRN
|
Blatt.Range("D" & cnt).Value = r("Abfertigungsbezeichnung")
|
||||||
|
Blatt.Range("E" & cnt).Value = r("Absender")
|
||||||
|
Blatt.Range("F" & cnt).Value = "" 'r("Betrag")
|
||||||
|
Blatt.Range("H" & cnt).Value = r("BelegNr")
|
||||||
|
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "VERAG"
|
||||||
|
|
||||||
|
Dim ZOLLANMELDUNG As New cZollsysteme_Aktenbeschriftung
|
||||||
|
Dim zS = If(r("Zollsystem_Land") IsNot DBNull.Value, r("Zollsystem_Land").ToString(), "")
|
||||||
|
If ZOLLANMELDUNG.getDataByBezugsnummer(r("FilialenNr") & "/" & r("AbfertigungsNr"), r("Abfertigungsart"), "", False, zS) Then
|
||||||
|
Blatt.Range("F" & cnt).Value = ZOLLANMELDUNG.Rechnungspreis
|
||||||
|
Blatt.Range("G" & cnt).Value = ZOLLANMELDUNG.Handelsrechnung.Replace(", ", "," & vbNewLine)
|
||||||
|
Blatt.Range("I" & cnt).Value = ZOLLANMELDUNG.ABGABEN_ZOLL
|
||||||
|
Blatt.Range("J" & cnt).Value = ZOLLANMELDUNG.ANZ_POS
|
||||||
|
If If(ZOLLANMELDUNG.ATCMRN, "") <> "" Then
|
||||||
|
Blatt.Range("H" & cnt).Value = ZOLLANMELDUNG.ATCMRN
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
cnt += 1
|
cnt += 1
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Datei.Save()
|
Datei.Save()
|
||||||
.DisplayAlerts = False
|
.DisplayAlerts = False
|
||||||
.quit()
|
.quit()
|
||||||
Try : Datei.close(True) : Catch : End Try
|
Try : Datei.close(True) : Catch : End Try
|
||||||
End With
|
End With
|
||||||
|
|
||||||
|
|
||||||
Case "quarter"
|
Case "quarter"
|
||||||
|
|
||||||
|
|
||||||
With exclApp
|
With exclApp
|
||||||
.Visible = False
|
.Visible = False
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Path = sPath & "ZF_" & KdNr & "_" & von.ToShortDateString & " - " & bis.ToShortDateString & "" & ".xlsx"
|
Path = sPath & "ZF_" & KdNr & "_" & von.ToShortDateString & " - " & bis.ToShortDateString & "" & ".xlsx"
|
||||||
While System.IO.File.Exists(Path)
|
While System.IO.File.Exists(Path)
|
||||||
Path = sPath & "ZF_" & KdNr & "_" & von.ToShortDateString & "-" & bis.ToShortDateString & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
|
Path = sPath & "ZF_" & KdNr & "_" & von.ToShortDateString & "-" & bis.ToShortDateString & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
|
||||||
End While
|
End While
|
||||||
My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.RG_ZF_NEW, False)
|
My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.RG_ZF_NEW, False)
|
||||||
Catch ex As System.Exception
|
Catch ex As System.Exception
|
||||||
' MsgBox(ex.Message)
|
' MsgBox(ex.Message)
|
||||||
MsgBox("Error 01: " & ex.Message & vbNewLine & ex.StackTrace)
|
MsgBox("Error 01: " & ex.Message & vbNewLine & ex.StackTrace)
|
||||||
|
|
||||||
|
|
||||||
Return ""
|
Return ""
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Datei = .Workbooks.Open(Path) 'Anpassen
|
Datei = .Workbooks.Open(Path) 'Anpassen
|
||||||
Blatt = Datei.Worksheets(1) 'Anpassen
|
Blatt = Datei.Worksheets(1) 'Anpassen
|
||||||
|
|
||||||
|
|
||||||
Dim cnt = 2
|
Dim cnt = 2
|
||||||
|
|
||||||
For Each r In dt.Rows
|
For Each r In dt.Rows
|
||||||
|
|
||||||
Dim ZOLLANMELDUNG As New DAKOSY_Worker.cZollsysteme_Aktenbeschriftung
|
Dim ZOLLANMELDUNG As New DAKOSY_Worker.cZollsysteme_Aktenbeschriftung
|
||||||
|
|
||||||
Dim zS = If(r("Zollsystem_Land") IsNot DBNull.Value, r("Zollsystem_Land").ToString(), "")
|
Dim zS = If(r("Zollsystem_Land") IsNot DBNull.Value, r("Zollsystem_Land").ToString(), "")
|
||||||
If ZOLLANMELDUNG.getDataByBezugsnummer(r("FilialenNr") & "/" & r("AbfertigungsNr"), r("Abfertigungsart"), "", False, zS) Then
|
If ZOLLANMELDUNG.getDataByBezugsnummer(r("FilialenNr") & "/" & r("AbfertigungsNr"), r("Abfertigungsart"), "", False, zS) Then
|
||||||
|
|
||||||
If ZOLLANMELDUNG.dtWARENPOS.Rows.Count > 0 Then
|
If ZOLLANMELDUNG.dtWARENPOS.Rows.Count > 0 Then
|
||||||
|
|
||||||
Dim rowcounter As Integer = 0
|
Dim rowcounter As Integer = 0
|
||||||
|
|
||||||
For Each row As DataRow In ZOLLANMELDUNG.dtWARENPOS.Rows
|
For Each row As DataRow In ZOLLANMELDUNG.dtWARENPOS.Rows
|
||||||
|
|
||||||
|
Dim ZollInProzent As Double = ZOLLANMELDUNG.ABGABEN_ZOLL / ZOLLANMELDUNG.RechnungspreisohneWahrung * 100
|
||||||
|
|
||||||
|
Blatt.Range("A" & cnt).Value = cnt - 1
|
||||||
|
Blatt.Range("B" & cnt).Value = r("Abfertigungsdatum")
|
||||||
|
Blatt.Range("C" & cnt).Value = VERAG_PROG_ALLGEMEIN.cAllgemein.getFirmaFromFiliale(r("FilialenNr"))
|
||||||
|
Blatt.Range("D" & cnt).Value = ZOLLANMELDUNG.Empfaenger
|
||||||
|
Blatt.Range("E" & cnt).Value = r("FilialenNr") & "/" & r("AbfertigungsNr")
|
||||||
|
Blatt.Range("F" & cnt).Value = r("BelegNr")
|
||||||
|
Blatt.Range("G" & cnt).Value = row.Item("PosNr")
|
||||||
|
Blatt.Range("H" & cnt).Value = row.Item("WarenNr")
|
||||||
|
Blatt.Range("I" & cnt).Value = "-"
|
||||||
|
Blatt.Range("J" & cnt).Value = row.Item("WarenBez")
|
||||||
|
Blatt.Range("K" & cnt).Value = ""
|
||||||
|
Blatt.Range("L" & cnt).Value = ZOLLANMELDUNG.Waehrungscode
|
||||||
|
Blatt.Range("M" & cnt).Value = ZOLLANMELDUNG.Geschaeftsart
|
||||||
|
Blatt.Range("N" & cnt).Value = ZOLLANMELDUNG.Zollstelle_Eingang
|
||||||
|
Blatt.Range("O" & cnt).Value = ""
|
||||||
|
Blatt.Range("P" & cnt).Value = row.Item("Netto")
|
||||||
|
Blatt.Range("Q" & cnt).Value = row.Item("PosWert")
|
||||||
|
Blatt.Range("R" & cnt).Value = IIf(rowcounter = 0, ZOLLANMELDUNG.ABGABEN_EUST, "")
|
||||||
|
Blatt.Range("S" & cnt).Value = IIf(rowcounter = 0, ZOLLANMELDUNG.ABGABEN_ZOLL, "")
|
||||||
|
Blatt.Range("T" & cnt).Value = IIf(rowcounter = 0, ZollInProzent.ToString("N2") & " %", "")
|
||||||
|
Blatt.Range("U" & cnt).Value = IIf(ZOLLANMELDUNG.VerBestLandZst.ToString.Count > 1, ZOLLANMELDUNG.VerBestLandZst.ToString.Substring(0, 2), "")
|
||||||
|
Blatt.Range("V" & cnt).Value = ZOLLANMELDUNG.Absender
|
||||||
|
Blatt.Range("W" & cnt).Value = row.Item("Herkunft")
|
||||||
|
Blatt.Range("X" & cnt).Value = ZOLLANMELDUNG.Incoterms
|
||||||
|
Blatt.Range("Y" & cnt).Value = row.Item("Verfahren")
|
||||||
|
Blatt.Range("Z" & cnt).Value = row.Item("Preferenz")
|
||||||
|
Blatt.Range("AA" & cnt).Value = IIf(row.Item("isCBAM"), "Y", "N")
|
||||||
|
|
||||||
|
If If(ZOLLANMELDUNG.ATCMRN, "") <> "" AndAlso Blatt.Range("F" & cnt).Value = "" Then
|
||||||
|
Blatt.Range("F" & cnt).Value = ZOLLANMELDUNG.ATCMRN
|
||||||
|
End If
|
||||||
|
|
||||||
|
cnt += 1
|
||||||
|
rowcounter += 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
Else
|
||||||
|
|
||||||
Dim ZollInProzent As Double = ZOLLANMELDUNG.ABGABEN_ZOLL / ZOLLANMELDUNG.RechnungspreisohneWahrung * 100
|
Dim ZollInProzent As Double = ZOLLANMELDUNG.ABGABEN_ZOLL / ZOLLANMELDUNG.RechnungspreisohneWahrung * 100
|
||||||
|
|
||||||
@@ -2589,100 +2649,58 @@ Module Mail
|
|||||||
Blatt.Range("D" & cnt).Value = ZOLLANMELDUNG.Empfaenger
|
Blatt.Range("D" & cnt).Value = ZOLLANMELDUNG.Empfaenger
|
||||||
Blatt.Range("E" & cnt).Value = r("FilialenNr") & "/" & r("AbfertigungsNr")
|
Blatt.Range("E" & cnt).Value = r("FilialenNr") & "/" & r("AbfertigungsNr")
|
||||||
Blatt.Range("F" & cnt).Value = r("BelegNr")
|
Blatt.Range("F" & cnt).Value = r("BelegNr")
|
||||||
Blatt.Range("G" & cnt).Value = row.Item("PosNr")
|
Blatt.Range("G" & cnt).Value = ""
|
||||||
Blatt.Range("H" & cnt).Value = row.Item("WarenNr")
|
Blatt.Range("H" & cnt).Value = ""
|
||||||
Blatt.Range("I" & cnt).Value = "-"
|
Blatt.Range("I" & cnt).Value = "-"
|
||||||
Blatt.Range("J" & cnt).Value = row.Item("WarenBez")
|
Blatt.Range("J" & cnt).Value = ""
|
||||||
Blatt.Range("K" & cnt).Value = ""
|
Blatt.Range("K" & cnt).Value = ""
|
||||||
Blatt.Range("L" & cnt).Value = ZOLLANMELDUNG.Waehrungscode
|
Blatt.Range("L" & cnt).Value = ZOLLANMELDUNG.Waehrungscode
|
||||||
Blatt.Range("M" & cnt).Value = ZOLLANMELDUNG.Geschaeftsart
|
Blatt.Range("M" & cnt).Value = ZOLLANMELDUNG.Geschaeftsart
|
||||||
Blatt.Range("N" & cnt).Value = ZOLLANMELDUNG.Zollstelle_Eingang
|
Blatt.Range("N" & cnt).Value = ZOLLANMELDUNG.Zollstelle_Eingang
|
||||||
Blatt.Range("O" & cnt).Value = ""
|
Blatt.Range("O" & cnt).Value = ""
|
||||||
Blatt.Range("P" & cnt).Value = row.Item("Netto")
|
Blatt.Range("P" & cnt).Value = ""
|
||||||
Blatt.Range("Q" & cnt).Value = row.Item("PosWert")
|
Blatt.Range("Q" & cnt).Value = ""
|
||||||
Blatt.Range("R" & cnt).Value = IIf(rowcounter = 0, ZOLLANMELDUNG.ABGABEN_EUST, "")
|
Blatt.Range("R" & cnt).Value = ZOLLANMELDUNG.ABGABEN_EUST
|
||||||
Blatt.Range("S" & cnt).Value = IIf(rowcounter = 0, ZOLLANMELDUNG.ABGABEN_ZOLL, "")
|
Blatt.Range("S" & cnt).Value = ZOLLANMELDUNG.ABGABEN_ZOLL
|
||||||
Blatt.Range("T" & cnt).Value = IIf(rowcounter = 0, ZollInProzent.ToString("N2") & " %", "")
|
Blatt.Range("T" & cnt).Value = ZollInProzent.ToString("N2") & " %"
|
||||||
Blatt.Range("U" & cnt).Value = IIf(ZOLLANMELDUNG.VerBestLandZst.ToString.Count > 1, ZOLLANMELDUNG.VerBestLandZst.ToString.Substring(0, 2), "")
|
Blatt.Range("U" & cnt).Value = IIf(ZOLLANMELDUNG.VerBestLandZst.ToString.Count > 1, ZOLLANMELDUNG.VerBestLandZst.ToString.Substring(0, 2), "")
|
||||||
Blatt.Range("V" & cnt).Value = ZOLLANMELDUNG.Absender
|
Blatt.Range("V" & cnt).Value = ZOLLANMELDUNG.Absender
|
||||||
Blatt.Range("W" & cnt).Value = row.Item("Herkunft")
|
Blatt.Range("W" & cnt).Value = ""
|
||||||
Blatt.Range("X" & cnt).Value = ZOLLANMELDUNG.Incoterms
|
Blatt.Range("X" & cnt).Value = ZOLLANMELDUNG.Incoterms
|
||||||
Blatt.Range("Y" & cnt).Value = row.Item("Verfahren")
|
Blatt.Range("Y" & cnt).Value = ""
|
||||||
Blatt.Range("Z" & cnt).Value = row.Item("Preferenz")
|
Blatt.Range("Z" & cnt).Value = ""
|
||||||
Blatt.Range("AA" & cnt).Value = IIf(row.Item("isCBAM"), "Y", "N")
|
Blatt.Range("AA" & cnt).Value = ""
|
||||||
|
|
||||||
|
|
||||||
If If(ZOLLANMELDUNG.ATCMRN, "") <> "" AndAlso Blatt.Range("F" & cnt).Value = "" Then
|
If If(ZOLLANMELDUNG.ATCMRN, "") <> "" AndAlso Blatt.Range("F" & cnt).Value = "" Then
|
||||||
Blatt.Range("F" & cnt).Value = ZOLLANMELDUNG.ATCMRN
|
Blatt.Range("F" & cnt).Value = ZOLLANMELDUNG.ATCMRN
|
||||||
End If
|
End If
|
||||||
|
|
||||||
cnt += 1
|
cnt += 1
|
||||||
rowcounter += 1
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
|
||||||
|
|
||||||
Dim ZollInProzent As Double = ZOLLANMELDUNG.ABGABEN_ZOLL / ZOLLANMELDUNG.RechnungspreisohneWahrung * 100
|
|
||||||
|
|
||||||
Blatt.Range("A" & cnt).Value = cnt - 1
|
|
||||||
Blatt.Range("B" & cnt).Value = r("Abfertigungsdatum")
|
|
||||||
Blatt.Range("C" & cnt).Value = VERAG_PROG_ALLGEMEIN.cAllgemein.getFirmaFromFiliale(r("FilialenNr"))
|
|
||||||
Blatt.Range("D" & cnt).Value = ZOLLANMELDUNG.Empfaenger
|
|
||||||
Blatt.Range("E" & cnt).Value = r("FilialenNr") & "/" & r("AbfertigungsNr")
|
|
||||||
Blatt.Range("F" & cnt).Value = r("BelegNr")
|
|
||||||
Blatt.Range("G" & cnt).Value = ""
|
|
||||||
Blatt.Range("H" & cnt).Value = ""
|
|
||||||
Blatt.Range("I" & cnt).Value = "-"
|
|
||||||
Blatt.Range("J" & cnt).Value = ""
|
|
||||||
Blatt.Range("K" & cnt).Value = ""
|
|
||||||
Blatt.Range("L" & cnt).Value = ZOLLANMELDUNG.Waehrungscode
|
|
||||||
Blatt.Range("M" & cnt).Value = ZOLLANMELDUNG.Geschaeftsart
|
|
||||||
Blatt.Range("N" & cnt).Value = ZOLLANMELDUNG.Zollstelle_Eingang
|
|
||||||
Blatt.Range("O" & cnt).Value = ""
|
|
||||||
Blatt.Range("P" & cnt).Value = ""
|
|
||||||
Blatt.Range("Q" & cnt).Value = ""
|
|
||||||
Blatt.Range("R" & cnt).Value = ZOLLANMELDUNG.ABGABEN_EUST
|
|
||||||
Blatt.Range("S" & cnt).Value = ZOLLANMELDUNG.ABGABEN_ZOLL
|
|
||||||
Blatt.Range("T" & cnt).Value = ZollInProzent.ToString("N2") & " %"
|
|
||||||
Blatt.Range("U" & cnt).Value = IIf(ZOLLANMELDUNG.VerBestLandZst.ToString.Count > 1, ZOLLANMELDUNG.VerBestLandZst.ToString.Substring(0, 2), "")
|
|
||||||
Blatt.Range("V" & cnt).Value = ZOLLANMELDUNG.Absender
|
|
||||||
Blatt.Range("W" & cnt).Value = ""
|
|
||||||
Blatt.Range("X" & cnt).Value = ZOLLANMELDUNG.Incoterms
|
|
||||||
Blatt.Range("Y" & cnt).Value = ""
|
|
||||||
Blatt.Range("Z" & cnt).Value = ""
|
|
||||||
Blatt.Range("AA" & cnt).Value = ""
|
|
||||||
|
|
||||||
|
|
||||||
If If(ZOLLANMELDUNG.ATCMRN, "") <> "" AndAlso Blatt.Range("F" & cnt).Value = "" Then
|
|
||||||
Blatt.Range("F" & cnt).Value = ZOLLANMELDUNG.ATCMRN
|
|
||||||
End If
|
End If
|
||||||
cnt += 1
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Datei.Save()
|
Datei.Save()
|
||||||
.DisplayAlerts = False
|
.DisplayAlerts = False
|
||||||
.quit()
|
.quit()
|
||||||
Try : Datei.close(True) : Catch : End Try
|
Try : Datei.close(True) : Catch : End Try
|
||||||
|
|
||||||
End With
|
End With
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
|
'Dim filepath = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt,,,,, False, "Report Data_" & KUNDENADR.FullName & "_" & von.ToShortDateString & "-" & bis.ToShortDateString)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Dim filepath = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt,,,,, False, "Report Data_" & KUNDENADR.FullName & "_" & von.ToShortDateString & "-" & bis.ToShortDateString)
|
|
||||||
Dim filepath = Path
|
Dim filepath = Path
|
||||||
If filepath = "" Then Return "ERROR 01: Fehler beim Erzeugen des XLS."
|
If filepath = "" Then Return "ERROR 01: Fehler beim Erzeugen des XLS."
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,20 @@ Public Class cGetMsgType
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Shared Function isNCTS_SumABekanntgabeMassnahme(doc As XmlDocument, ByRef version As String) As Boolean
|
||||||
|
If doc.HasChildNodes Then
|
||||||
|
If doc.GetElementsByTagName("SumABekanntgabeMassnahme").Count > 0 Then
|
||||||
|
|
||||||
|
If doc.GetElementsByTagName("Version").Count > 0 Then
|
||||||
|
version = doc.GetElementsByTagName("Version")(0).InnerText
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Shared Function isAES_DEXPSD(doc As XmlDocument) As Boolean
|
Shared Function isAES_DEXPSD(doc As XmlDocument) As Boolean
|
||||||
If doc.HasChildNodes Then
|
If doc.HasChildNodes Then
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports com.sun.xml.internal.bind.v2.model.core
|
Imports com.sun.xml.internal.bind.v2.model.core
|
||||||
|
Imports Microsoft.Office.Core
|
||||||
Imports VERAG_PROG_ALLGEMEIN
|
Imports VERAG_PROG_ALLGEMEIN
|
||||||
|
|
||||||
Public Class cWorker_Verwahrung
|
Public Class cWorker_Verwahrung
|
||||||
@@ -12,8 +13,9 @@ Public Class cWorker_Verwahrung
|
|||||||
Try
|
Try
|
||||||
|
|
||||||
Dim VWI As DAKOSY_Worker.SumAVerwahrungsinfo_009.SumAVerwahrungsinfoSVTyp = DAKOSY_Worker.SumAVerwahrungsinfo_009.SumAVerwahrungsinfoSVTyp.LoadFromFile(d)
|
Dim VWI As DAKOSY_Worker.SumAVerwahrungsinfo_009.SumAVerwahrungsinfoSVTyp = DAKOSY_Worker.SumAVerwahrungsinfo_009.SumAVerwahrungsinfoSVTyp.LoadFromFile(d)
|
||||||
Dim Vorpapiernummer = ""
|
Dim VorpapiernummerInput = ""
|
||||||
Dim RegistriernummerATLAS = ""
|
Dim RegistriernummerATLAS = ""
|
||||||
|
Dim VeralteteWeitereRegistriernummer = ""
|
||||||
Dim ankungsdatum As Object = Nothing
|
Dim ankungsdatum As Object = Nothing
|
||||||
Dim gestellungsdatum As Object = Nothing
|
Dim gestellungsdatum As Object = Nothing
|
||||||
Dim posGestellung As New DataTable
|
Dim posGestellung As New DataTable
|
||||||
@@ -27,12 +29,16 @@ Public Class cWorker_Verwahrung
|
|||||||
End If
|
End If
|
||||||
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten IsNot Nothing Then
|
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten IsNot Nothing Then
|
||||||
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten.Vorpapiernummer IsNot Nothing Then
|
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten.Vorpapiernummer IsNot Nothing Then
|
||||||
Vorpapiernummer = VWI.EinzelSumAVerwahrungsinfo.KopfDaten.Vorpapiernummer
|
VorpapiernummerInput = VWI.EinzelSumAVerwahrungsinfo.KopfDaten.Vorpapiernummer
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten.RegistriernummerATLAS IsNot Nothing Then
|
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten.RegistriernummerATLAS IsNot Nothing Then
|
||||||
RegistriernummerATLAS = VWI.EinzelSumAVerwahrungsinfo.KopfDaten.RegistriernummerATLAS
|
RegistriernummerATLAS = VWI.EinzelSumAVerwahrungsinfo.KopfDaten.RegistriernummerATLAS
|
||||||
End If
|
End If
|
||||||
|
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten.VeralteteWeitereRegistriernummer IsNot Nothing Then
|
||||||
|
VeralteteWeitereRegistriernummer = VWI.EinzelSumAVerwahrungsinfo.KopfDaten.VeralteteWeitereRegistriernummer
|
||||||
|
End If
|
||||||
|
|
||||||
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten.GestellungDatum > "01.01.2000" Then
|
If VWI.EinzelSumAVerwahrungsinfo.KopfDaten.GestellungDatum > "01.01.2000" Then
|
||||||
gestellungsdatum = VWI.EinzelSumAVerwahrungsinfo.KopfDaten.GestellungDatum
|
gestellungsdatum = VWI.EinzelSumAVerwahrungsinfo.KopfDaten.GestellungDatum
|
||||||
End If
|
End If
|
||||||
@@ -52,6 +58,7 @@ Public Class cWorker_Verwahrung
|
|||||||
posGestellung.Columns.Add("VerwahrerFirma", GetType(String))
|
posGestellung.Columns.Add("VerwahrerFirma", GetType(String))
|
||||||
posGestellung.Columns.Add("VerwahrerOrt", GetType(String))
|
posGestellung.Columns.Add("VerwahrerOrt", GetType(String))
|
||||||
posGestellung.Columns.Add("VerwahrerEORI", GetType(String))
|
posGestellung.Columns.Add("VerwahrerEORI", GetType(String))
|
||||||
|
posGestellung.Columns.Add("SpezifischerOrdnungsbegriffDaten", GetType(String))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ro As DataRow = posGestellung.NewRow
|
Dim ro As DataRow = posGestellung.NewRow
|
||||||
@@ -63,6 +70,7 @@ Public Class cWorker_Verwahrung
|
|||||||
ro("VerwahrerFirma") = POS.Verwahrer.NameFirma
|
ro("VerwahrerFirma") = POS.Verwahrer.NameFirma
|
||||||
ro("VerwahrerOrt") = POS.Verwahrer.Ortsteil
|
ro("VerwahrerOrt") = POS.Verwahrer.Ortsteil
|
||||||
ro("VerwahrerEORI") = POS.Verwahrer.TeilnehmerEORI
|
ro("VerwahrerEORI") = POS.Verwahrer.TeilnehmerEORI
|
||||||
|
ro("SpezifischerOrdnungsbegriffDaten") = POS.SpezifischerOrdnungsbegriffDaten
|
||||||
posGestellung.Rows.Add(ro)
|
posGestellung.Rows.Add(ro)
|
||||||
|
|
||||||
|
|
||||||
@@ -78,7 +86,7 @@ Public Class cWorker_Verwahrung
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If readVW_SumAVerwahrungsinfo <> "" And Vorpapiernummer <> "" Then 'BEZUGSNR vorhanden
|
If readVW_SumAVerwahrungsinfo <> "" And VorpapiernummerInput <> "" Then 'BEZUGSNR vorhanden
|
||||||
Dim STATUS As DAKOSY_Worker.cDakosy_Statusmeldungen = FORM.getStatusCheckTransID(VWI.Transaktion.IOReferenz, VWI.Transaktion.IODatumZeit)
|
Dim STATUS As DAKOSY_Worker.cDakosy_Statusmeldungen = FORM.getStatusCheckTransID(VWI.Transaktion.IOReferenz, VWI.Transaktion.IODatumZeit)
|
||||||
STATUS.dySt_BezugsNr = readVW_SumAVerwahrungsinfo
|
STATUS.dySt_BezugsNr = readVW_SumAVerwahrungsinfo
|
||||||
STATUS.dySt_artMitteilung = "VW_INFO"
|
STATUS.dySt_artMitteilung = "VW_INFO"
|
||||||
@@ -94,145 +102,14 @@ Public Class cWorker_Verwahrung
|
|||||||
|
|
||||||
'LINKE SEITE BEI GESAMTSICHERHEITEN!!!!!!!!!!!!!
|
'LINKE SEITE BEI GESAMTSICHERHEITEN!!!!!!!!!!!!!
|
||||||
|
|
||||||
If saveVerwahrung Then
|
If saveVerwahrung Then saveVerwahrungseingang(readVW_SumAVerwahrungsinfo, VWI, RegistriernummerATLAS, posGestellung, VorpapiernummerInput, VeralteteWeitereRegistriernummer)
|
||||||
|
|
||||||
'----------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
Try
|
|
||||||
|
|
||||||
Dim BezugsNr = readVW_SumAVerwahrungsinfo
|
|
||||||
|
|
||||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True Then VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
|
||||||
|
|
||||||
Dim filiale As String = ""
|
|
||||||
Dim abfertigungsnummer = ""
|
|
||||||
Dim Standort As String = ""
|
|
||||||
Dim warenort = ""
|
|
||||||
|
|
||||||
If BezugsNr.Length > 4 AndAlso IsNumeric(BezugsNr.Substring(0, 4)) Then
|
|
||||||
filiale = IIf(BezugsNr.Length > 4, BezugsNr.Substring(0, 4), "")
|
|
||||||
abfertigungsnummer = IIf(BezugsNr.Length >= 14, BezugsNr.Substring(5, 8), "")
|
|
||||||
|
|
||||||
ElseIf Vorpapiernummer <> "" Then
|
|
||||||
If Vorpapiernummer.Length > 18 Then
|
|
||||||
Vorpapiernummer = Vorpapiernummer.ToString.Substring(0, 18)
|
|
||||||
End If
|
|
||||||
Dim dtSendungsInfo As New DataTable
|
|
||||||
dtSendungsInfo = SQL.loadDgvBySql("SELECT [FilialenNr],[AbfertigungsNr],[UnterNr] FROM [dbo].[tblSendungen] where tblSnd_ATB_T1 = '" & Vorpapiernummer & "'", "AVISO")
|
|
||||||
|
|
||||||
If dtSendungsInfo.Rows.Count > 0 Then
|
|
||||||
filiale = dtSendungsInfo.Rows(0).Item("FilialenNr")
|
|
||||||
abfertigungsnummer = dtSendungsInfo.Rows(0).Item("AbfertigungsNr")
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Select Case filiale
|
|
||||||
Case "4803", "4809"
|
|
||||||
Standort = "VERAG AG"
|
|
||||||
Case "4810", "5103", "5901"
|
|
||||||
Standort = "VERAG GmbH"
|
|
||||||
Case "5501"
|
|
||||||
Standort = "IMEX"
|
|
||||||
Case Else
|
|
||||||
GoTo Anzeige
|
|
||||||
End Select
|
|
||||||
|
|
||||||
|
|
||||||
Dim dy_SendungsId = VWI.Transaktion.IOReferenz
|
|
||||||
|
|
||||||
If filiale <> "" AndAlso abfertigungsnummer <> "" AndAlso IsNumeric(filiale) AndAlso IsNumeric(abfertigungsnummer) Then
|
|
||||||
|
|
||||||
Dim SND = VERAG_PROG_ALLGEMEIN.cSendungen.LOADByFilialenNrAbfertigungsNr(filiale, abfertigungsnummer)
|
|
||||||
|
|
||||||
If SND IsNot Nothing AndAlso SND.tblSnd_Abfertigungsart_ID = 44 Then
|
|
||||||
|
|
||||||
Dim existingEntry As Integer = 0
|
|
||||||
existingEntry = CInt((New SQL).getValueTxtBySql("Select gs_gsnr from [tblGesamtsicherheit] where [gs_ATBNr] = '" & Vorpapiernummer & "' order by gs_datum desc", "AVISO",,,, "0"))
|
|
||||||
If existingEntry = 0 Then
|
|
||||||
existingEntry = CInt((New SQL).getValueTxtBySql("Select gs_gsnr from [tblGesamtsicherheit] where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & ") or (gs_avisoId = " & SND.tblSnd_AvisoID & ") order by gs_datum desc", "AVISO",,, "0"))
|
|
||||||
End If
|
|
||||||
|
|
||||||
If existingEntry > 0 Then
|
|
||||||
|
|
||||||
Dim urspringsSicherheit As New cSicherheiten(existingEntry)
|
|
||||||
|
|
||||||
|
|
||||||
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cGesamtsicherheitsReferenz(urspringsSicherheit.gs_standort)
|
|
||||||
Dim saldo = GesSichRef.CalcSaldo()
|
|
||||||
|
|
||||||
If SND.FilialenNr > 0 Then filiale = SND.FilialenNr
|
|
||||||
If SND.AbfertigungsNr > 0 Then abfertigungsnummer = SND.AbfertigungsNr
|
|
||||||
|
|
||||||
'Verwahrung ANSCHREIBUNG
|
|
||||||
|
|
||||||
Dim gsId As Integer
|
|
||||||
|
|
||||||
urspringsSicherheit.gs_systemuser = "DAKOSY-AUTO"
|
|
||||||
urspringsSicherheit.gs_posNr = CInt(posGestellung.Rows(0).Item("PosNr"))
|
|
||||||
urspringsSicherheit.gs_freitext = RegistriernummerATLAS
|
|
||||||
urspringsSicherheit.gs_MRNNr = RegistriernummerATLAS
|
|
||||||
|
|
||||||
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
|
||||||
gsId = urspringsSicherheit.SAVEOBJECT()
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
|
||||||
|
|
||||||
If posGestellung.Rows.Count > 1 Then
|
|
||||||
For i As Integer = 2 To posGestellung.Rows.Count - 1
|
|
||||||
|
|
||||||
Dim ANSCHREIBUNG_POS As New cSicherheiten()
|
|
||||||
With ANSCHREIBUNG_POS
|
|
||||||
|
|
||||||
.gs_gsNr = gsId
|
|
||||||
.gs_ATBNr = urspringsSicherheit.gs_ATBNr
|
|
||||||
.gs_freitext = RegistriernummerATLAS
|
|
||||||
.gs_posNr = i
|
|
||||||
.gs_datum = gestellungsdatum
|
|
||||||
.gs_gsNr = urspringsSicherheit.gs_gsNr
|
|
||||||
.gs_warenwert = 0
|
|
||||||
.gs_sicherheitsbetrag = 0
|
|
||||||
.gs_standort = Standort
|
|
||||||
.gs_art = "OPEN"
|
|
||||||
.gs_erstellungsdatum = DateTime.Now
|
|
||||||
.gs_MRNNr = RegistriernummerATLAS
|
|
||||||
.gs_saldo = saldo
|
|
||||||
.gs_atr = ""
|
|
||||||
.gs_systemuser = urspringsSicherheit.gs_systemuser
|
|
||||||
.gs_zollsatz = GesSichRef.gsr_zollsatz
|
|
||||||
.gs_avisoId = SND.tblSnd_AvisoID
|
|
||||||
.gs_warenort = urspringsSicherheit.gs_warenort
|
|
||||||
|
|
||||||
End With
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
|
||||||
ANSCHREIBUNG_POS.SAVE()
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
|
||||||
Next
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
|
|
||||||
|
|
||||||
End Try
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Anzeige:
|
Anzeige:
|
||||||
|
|
||||||
FORM.addDGVEinarbeitung("VW: Verwahrungsinfo", STATUS.dySt_BezugsNr)
|
FORM.addDGVEinarbeitung("VW: Verwahrungsinfo", STATUS.dySt_BezugsNr)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -241,20 +118,9 @@ Anzeige:
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function AddNewGesamtSichNr() As Integer
|
|
||||||
Dim sqlq As String = "select MAX([gs_gsNr]) as MaxGesSich from tblGesamtsicherheit"
|
|
||||||
Dim dt As New DataTable
|
|
||||||
dt = SQL.loadDgvBySql(sqlq, "AVISO", 100, True)
|
|
||||||
Dim LetzteGesSichNum As Integer = -1
|
|
||||||
If (dt.Rows(0).Item(0) IsNot DBNull.Value) Then
|
|
||||||
|
|
||||||
LetzteGesSichNum = dt.Rows(0).Item(0)
|
|
||||||
Return LetzteGesSichNum + 1
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Return 0
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -270,6 +136,7 @@ Anzeige:
|
|||||||
Dim zp As Object = Nothing
|
Dim zp As Object = Nothing
|
||||||
Dim regNR = ""
|
Dim regNR = ""
|
||||||
Dim division = ""
|
Dim division = ""
|
||||||
|
Dim veralteteregNR = ""
|
||||||
|
|
||||||
readEZA_SumAErledigungsinformationVorpapier_005 = ""
|
readEZA_SumAErledigungsinformationVorpapier_005 = ""
|
||||||
If EZA IsNot Nothing Then
|
If EZA IsNot Nothing Then
|
||||||
@@ -296,6 +163,10 @@ Anzeige:
|
|||||||
If EZA.EinzelSumAErledigungsinformation.KopfDaten.RegNrATLASWeitereNachweise IsNot Nothing Then
|
If EZA.EinzelSumAErledigungsinformation.KopfDaten.RegNrATLASWeitereNachweise IsNot Nothing Then
|
||||||
regNR = EZA.EinzelSumAErledigungsinformation.KopfDaten.RegNrATLASWeitereNachweise
|
regNR = EZA.EinzelSumAErledigungsinformation.KopfDaten.RegNrATLASWeitereNachweise
|
||||||
End If
|
End If
|
||||||
|
If EZA.EinzelSumAErledigungsinformation.KopfDaten.VeralteteWeitereNachweise IsNot Nothing Then
|
||||||
|
veralteteregNR = EZA.EinzelSumAErledigungsinformation.KopfDaten.VeralteteWeitereNachweise
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If EZA.EinzelSumAErledigungsinformation.Position IsNot Nothing Then
|
If EZA.EinzelSumAErledigungsinformation.Position IsNot Nothing Then
|
||||||
@@ -368,111 +239,7 @@ Anzeige:
|
|||||||
'Verwahrung ABSCHREIBUNG - rechte Seite bei Gesamtsicherheiten
|
'Verwahrung ABSCHREIBUNG - rechte Seite bei Gesamtsicherheiten
|
||||||
|
|
||||||
If saveAbschreibung Then
|
If saveAbschreibung Then
|
||||||
|
saveVerwahrungsAusgang(regNR, posErledigung, veralteteregNR, EZA)
|
||||||
If posErledigung IsNot Nothing AndAlso posErledigung.Rows.Count > 0 Then
|
|
||||||
|
|
||||||
If regNR <> "" Then
|
|
||||||
|
|
||||||
Dim dtGesamtsicherheit = SQL.loadDgvBySql("Select * From [tblGesamtsicherheit] where [gs_MRNNr] = '" & regNR & "' or [gs_ATBNr]= '" & regNR & "'", "AVISO")
|
|
||||||
|
|
||||||
If dtGesamtsicherheit.Rows.Count > 0 Then
|
|
||||||
|
|
||||||
For Each POS As DataRow In posErledigung.Rows
|
|
||||||
|
|
||||||
Dim MRNNR As String = ""
|
|
||||||
Dim existingEntryID As Integer = 0
|
|
||||||
|
|
||||||
|
|
||||||
If Not IsDBNull(POS.Item("IDRegNrSumA")) AndAlso POS.Item("IDRegNrSumA") IsNot Nothing AndAlso POS.Item("IDRegNrSumA") <> "" Then
|
|
||||||
|
|
||||||
Dim POSNr As Integer = CInt(POS.Item("IDRegNrSumAPos"))
|
|
||||||
|
|
||||||
If MRNNR <> POS.Item("IDRegNrSumA") Then
|
|
||||||
MRNNR = POS.Item("IDRegNrSumA")
|
|
||||||
|
|
||||||
Dim firmaID = -1
|
|
||||||
|
|
||||||
'Select Case dtGesamtsicherheit.Rows(0).Item("gs_standort")
|
|
||||||
|
|
||||||
' Case "VERAG GmbH"
|
|
||||||
' firmaID = 23
|
|
||||||
' Case "Verag AG"
|
|
||||||
' firmaId = 1
|
|
||||||
' Case "Unisped GmbH"
|
|
||||||
' firmaId = 21
|
|
||||||
' Case "AMBAR GmbH"
|
|
||||||
' firmaId = 24
|
|
||||||
' Case "Verag CS"
|
|
||||||
' firmaId = 11
|
|
||||||
' Case "IMEX"
|
|
||||||
' firmaId = 20
|
|
||||||
|
|
||||||
|
|
||||||
'End Select
|
|
||||||
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
|
||||||
|
|
||||||
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cGesamtsicherheitsReferenz(dtGesamtsicherheit.Rows(0).Item("gs_standort"))
|
|
||||||
Dim saldo As Double = GesSichRef.CalcSaldo()
|
|
||||||
|
|
||||||
Try
|
|
||||||
|
|
||||||
'innerhalb der gs_gsnr muss mithilfe der gs_gsid die richtige PosNr ermittelt werden!
|
|
||||||
|
|
||||||
Dim Warenwert As Double = 0
|
|
||||||
|
|
||||||
Dim dtSendungen = SQL.loadDgvBySql("SELECT")
|
|
||||||
|
|
||||||
Dim SicherheitsPos As New cGesamtsicherheitsPositionen()
|
|
||||||
With SicherheitsPos
|
|
||||||
.gsp_gsId = dtGesamtsicherheit.Rows(0).Item("gs_gsId")
|
|
||||||
'.gsp_gspPosId = CInt(POSNr)
|
|
||||||
.gsp_gspPosId = dtGesamtsicherheit.Rows(0).Item("gs_posNr")
|
|
||||||
.gsp_warenwert = 0
|
|
||||||
.gsp_sicherheitsbetrag = 0
|
|
||||||
.gsp_freitext = "DASKOY-IMPORT"
|
|
||||||
.gsp_filialenNr = dtGesamtsicherheit.Rows(0).Item("gs_filialenNr")
|
|
||||||
.gsp_art = "CLOSE"
|
|
||||||
.gsp_gsNr = dtGesamtsicherheit.Rows(0).Item("gs_gsnr")
|
|
||||||
.gsp_abfertigungsNr = dtGesamtsicherheit.Rows(0).Item("gs_abfertigungsnr")
|
|
||||||
.gsp_datum = DateTime.Now
|
|
||||||
.gsp_erstellungsdatum = DateTime.Now
|
|
||||||
.gsp_ust = dtGesamtsicherheit.Rows(0).Item("gs_ust")
|
|
||||||
.gsp_ATCNr = POS.Item("IDRegNrSumA")
|
|
||||||
.gsp_avisoId = dtGesamtsicherheit.Rows(0).Item("gs_avisoID")
|
|
||||||
.gsp_systemuser = "DAKOSY-AUTO"
|
|
||||||
End With
|
|
||||||
|
|
||||||
|
|
||||||
SicherheitsPos.SAVE()
|
|
||||||
|
|
||||||
GesSichRef.CalcSaldo()
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
|
||||||
End Try
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Anzeige:
|
Anzeige:
|
||||||
|
|
||||||
@@ -582,4 +349,486 @@ Anzeige:
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Shared Function readNCTS_SumAMassnahmenbekanntgabe(FORM As frmDYNachrichtenVerarbeitung, d As String, saveAbschreibung As Boolean) As String
|
||||||
|
Try
|
||||||
|
|
||||||
|
Dim NCTS As DAKOSY_Worker.SumAErledigungsinformationCDXWare_007.SumAErledigungsinformationCDXWareSCTyp = DAKOSY_Worker.SumAErledigungsinformationCDXWare_007.SumAErledigungsinformationCDXWareSCTyp.LoadFromFile(d)
|
||||||
|
Dim ART = ""
|
||||||
|
' Dim details = ""
|
||||||
|
|
||||||
|
Dim zp As Object = Nothing
|
||||||
|
Dim regNR = ""
|
||||||
|
Dim division = ""
|
||||||
|
|
||||||
|
readNCTS_SumAMassnahmenbekanntgabe = ""
|
||||||
|
If NCTS IsNot Nothing Then
|
||||||
|
|
||||||
|
If NCTS.Transaktion IsNot Nothing Then
|
||||||
|
If NCTS.Transaktion.IODivision3 IsNot Nothing Then
|
||||||
|
division = NCTS.Transaktion.IODivision3
|
||||||
|
ElseIf NCTS.Transaktion.IODivision1 IsNot Nothing Then
|
||||||
|
division = NCTS.Transaktion.IODivision1
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If NCTS.EinzelSumAErledigungsinformationCDXWare IsNot Nothing Then
|
||||||
|
If NCTS.EinzelSumAErledigungsinformationCDXWare.ObjektIdentifizierung IsNot Nothing Then
|
||||||
|
If NCTS.EinzelSumAErledigungsinformationCDXWare.ObjektIdentifizierung.ObjektName IsNot Nothing Then
|
||||||
|
readNCTS_SumAMassnahmenbekanntgabe = NCTS.EinzelSumAErledigungsinformationCDXWare.ObjektIdentifizierung.ObjektName
|
||||||
|
End If
|
||||||
|
zp = NCTS.EinzelSumAErledigungsinformationCDXWare.ObjektIdentifizierung.ZeitpunktNachrichteneingang
|
||||||
|
End If
|
||||||
|
If NCTS.EinzelSumAErledigungsinformationCDXWare.KopfDaten IsNot Nothing Then
|
||||||
|
|
||||||
|
If NCTS.EinzelSumAErledigungsinformationCDXWare.KopfDaten.RegNrATLAS IsNot Nothing Then
|
||||||
|
regNR = NCTS.EinzelSumAErledigungsinformationCDXWare.KopfDaten.RegNrATLAS
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
' EZA.LOADByBezugsNr(bezugsNr, False) ' Falls schon ein DS mit dieser Bezugsnummer vorhanden ist.
|
||||||
|
|
||||||
|
If readNCTS_SumAMassnahmenbekanntgabe <> "" Then 'BEZUGSNR vorhanden
|
||||||
|
Dim STATUS As DAKOSY_Worker.cDakosy_Statusmeldungen = FORM.getStatusCheckTransID(NCTS.Transaktion.IOReferenz, NCTS.Transaktion.IODatumZeit)
|
||||||
|
STATUS.dySt_BezugsNr = readNCTS_SumAMassnahmenbekanntgabe
|
||||||
|
STATUS.dySt_artMitteilung = "VW_EVP_CDX"
|
||||||
|
STATUS.dySt_dyArt = "VW" '"EZA" 'T1/T2
|
||||||
|
|
||||||
|
STATUS.dySt_status = DAKOSY_Worker.cDY_Statusliste.V_60 '???
|
||||||
|
STATUS.dySt_ergZeitpunkt = zp
|
||||||
|
|
||||||
|
|
||||||
|
' STATUS.dySt_ergDetails = details
|
||||||
|
'EINTRAG IN tblDakosy_Zollanmeldungen
|
||||||
|
Dim DY_TMP As DAKOSY_Worker.cDakosy_Zollanmeldungen = FORM.saveDY_ZA(STATUS, NCTS.Transaktion.IOReferenz, If(zp, NCTS.Transaktion.IODatumZeit), "NCTS")
|
||||||
|
|
||||||
|
If DY_TMP IsNot Nothing Then STATUS.dySt_dyId = DY_TMP.dy_Id
|
||||||
|
STATUS.SAVE()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
'Verwahrung ABSCHREIBUNG
|
||||||
|
|
||||||
|
If saveAbschreibung Then
|
||||||
|
|
||||||
|
Try
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
'----------------------------------------------------------------
|
||||||
|
|
||||||
|
FORM.addDGVEinarbeitung("VW: Erledigungsinformation-Vorpapier CDX", STATUS.dySt_BezugsNr)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
readNCTS_SumAMassnahmenbekanntgabe = ""
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Shared Function saveVerwahrungseingang(readVW_SumAVerwahrungsinfo As String, VWI As DAKOSY_Worker.SumAVerwahrungsinfo_009.SumAVerwahrungsinfoSVTyp, RegistriernummerATLAS As String, posGestellung As DataTable, VorpapiernummerInput As String, VeralteteWeitereRegistriernummer As String)
|
||||||
|
|
||||||
|
Dim BezugsNr = readVW_SumAVerwahrungsinfo
|
||||||
|
|
||||||
|
If VeralteteWeitereRegistriernummer = "" Then Return False
|
||||||
|
|
||||||
|
Dim filiale As String = ""
|
||||||
|
Dim abfertigungsnummer = ""
|
||||||
|
Dim Standort As String = ""
|
||||||
|
Dim Vorpapiernummer = ""
|
||||||
|
Dim laufnummer As Integer = -1
|
||||||
|
|
||||||
|
Dim parts() As String = VorpapiernummerInput.Split("-"c)
|
||||||
|
|
||||||
|
If parts.Length = 2 Then
|
||||||
|
Vorpapiernummer = parts(0)
|
||||||
|
Integer.TryParse(parts(1), laufnummer)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If BezugsNr.Length > 4 AndAlso IsNumeric(BezugsNr.Substring(0, 4)) Then
|
||||||
|
If BezugsNr.Length > 4 Then
|
||||||
|
filiale = BezugsNr.Substring(0, 4)
|
||||||
|
End If
|
||||||
|
If BezugsNr.Length >= 14 Then
|
||||||
|
abfertigungsnummer = BezugsNr.Substring(5, 8)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Vorpapiernummer <> "" Then
|
||||||
|
If Vorpapiernummer.Length > 18 Then
|
||||||
|
Vorpapiernummer = Vorpapiernummer.ToString.Substring(0, 18)
|
||||||
|
End If
|
||||||
|
Dim dtSendungsInfo As New DataTable
|
||||||
|
dtSendungsInfo = SQL.loadDgvBySql("SELECT [FilialenNr],[AbfertigungsNr],[UnterNr] FROM [dbo].[tblSendungen] where tblSnd_ATB_T1 = '" & Vorpapiernummer & "'", "AVISO")
|
||||||
|
|
||||||
|
If dtSendungsInfo.Rows.Count > 0 Then
|
||||||
|
filiale = dtSendungsInfo.Rows(0).Item("FilialenNr")
|
||||||
|
abfertigungsnummer = dtSendungsInfo.Rows(0).Item("AbfertigungsNr")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Select Case filiale
|
||||||
|
Case "4803", "4809"
|
||||||
|
Standort = "VERAG AG"
|
||||||
|
Case "4810", "5103", "5901"
|
||||||
|
Standort = "VERAG GmbH"
|
||||||
|
Case "5501"
|
||||||
|
Standort = "IMEX"
|
||||||
|
Case Else
|
||||||
|
Return False
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
|
Dim dy_SendungsId = VWI.Transaktion.IOReferenz
|
||||||
|
|
||||||
|
If filiale <> "" AndAlso abfertigungsnummer <> "" AndAlso IsNumeric(filiale) AndAlso IsNumeric(abfertigungsnummer) Then
|
||||||
|
|
||||||
|
Dim SND = VERAG_PROG_ALLGEMEIN.cSendungen.LOADByFilialenNrAbfertigungsNr(filiale, abfertigungsnummer)
|
||||||
|
|
||||||
|
If SND IsNot Nothing AndAlso SND.tblSnd_Abfertigungsart_ID = 44 Then
|
||||||
|
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||||
|
|
||||||
|
Dim existingEntries As DataTable
|
||||||
|
existingEntries = (New SQL).loadDgvBySql("Select gs_gsnr, gs_gsId, gs_posNr, gs_freitext,gs_systemuser,gs_VeralteteWeitereRegistriernummer from [tblGesamtsicherheit] where [gs_ATBNr] = '" & Vorpapiernummer & "' order by gs_datum desc", "AVISO")
|
||||||
|
If existingEntries.Rows.Count = 0 Then
|
||||||
|
existingEntries = (New SQL).loadDgvBySql("Select gs_gsnr, gs_gsId, gs_freitext,gs_systemuser,gs_VeralteteWeitereRegistriernummer from [tblGesamtsicherheit] where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) or (gs_avisoId = " & SND.tblSnd_AvisoID & ") order by gs_datum desc", "AVISO")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If existingEntries.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
Dim zubehandelndeGS As Boolean = existingEntries.AsEnumerable().
|
||||||
|
Any(Function(r_entry)
|
||||||
|
Return Not r_entry.IsNull("gs_posNr") AndAlso r_entry.Field(Of Integer)("gs_posNr") = laufnummer AndAlso Not r_entry.IsNull("gs_VeralteteWeitereRegistriernummer") AndAlso r_entry.Field(Of String)("gs_VeralteteWeitereRegistriernummer") <> "" AndAlso r_entry.Field(Of String)("gs_VeralteteWeitereRegistriernummer") = VeralteteWeitereRegistriernummer
|
||||||
|
End Function)
|
||||||
|
|
||||||
|
If zubehandelndeGS Then
|
||||||
|
Return True 'bereits behandelt ->
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim urspringsSicherheit As cSicherheiten
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim rows = existingEntries.Select("gs_freitext = 'DAKOSY DUMMY' AND gs_posNr = 0")
|
||||||
|
|
||||||
|
If rows.Length > 0 Then
|
||||||
|
Dim row = rows(0)
|
||||||
|
urspringsSicherheit = New cSicherheiten(row("gs_gsId"), row("gs_posNr"))
|
||||||
|
Else
|
||||||
|
Return False 'kein Dummy-Eintrag
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim newSicherheit As New cSicherheiten()
|
||||||
|
|
||||||
|
If Not urspringsSicherheit.hasEntry Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cGesamtsicherheitsReferenz(urspringsSicherheit.gs_standort)
|
||||||
|
Dim saldo = GesSichRef.CalcSaldo()
|
||||||
|
|
||||||
|
If SND.FilialenNr > 0 Then filiale = SND.FilialenNr
|
||||||
|
If SND.AbfertigungsNr > 0 Then abfertigungsnummer = SND.AbfertigungsNr
|
||||||
|
|
||||||
|
'Verwahrung ANSCHREIBUNG
|
||||||
|
|
||||||
|
newSicherheit.gs_systemuser = "DAKOSY-AUTO"
|
||||||
|
newSicherheit.gs_VeralteteWeitereRegistriernummer = VeralteteWeitereRegistriernummer 'wichtig für Zuweisung DAKOSY
|
||||||
|
newSicherheit.gs_gsNr = urspringsSicherheit.gs_gsNr
|
||||||
|
newSicherheit.gs_ATBNr = urspringsSicherheit.gs_ATBNr
|
||||||
|
|
||||||
|
Dim FreitextInfo As String = ""
|
||||||
|
|
||||||
|
If posGestellung.Rows.Count > 0 Then
|
||||||
|
FreitextInfo = posGestellung.Rows(0).Item("AnzPackst") & " " & posGestellung.Rows(0).Item("PackstArt")
|
||||||
|
Else
|
||||||
|
FreitextInfo = "DAKOSY-IMPORT"
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
newSicherheit.gs_freitext = FreitextInfo
|
||||||
|
newSicherheit.gs_MRNNr = RegistriernummerATLAS
|
||||||
|
newSicherheit.gs_standort = urspringsSicherheit.gs_standort
|
||||||
|
newSicherheit.gs_datum = urspringsSicherheit.gs_datum 'VWI.EinzelSumAVerwahrungsinfo.ObjektIdentifizierung.ZeitpunktNachrichteneingang
|
||||||
|
newSicherheit.gs_erstellungsdatum = Now()
|
||||||
|
newSicherheit.gs_posNr = laufnummer
|
||||||
|
newSicherheit.gs_abfertigungsnr = abfertigungsnummer
|
||||||
|
newSicherheit.gs_filialenNr = filiale
|
||||||
|
newSicherheit.gs_LKWKZ = urspringsSicherheit.gs_LKWKZ
|
||||||
|
newSicherheit.gs_zollsatz = urspringsSicherheit.gs_zollsatz
|
||||||
|
newSicherheit.gs_warenwert = 0
|
||||||
|
newSicherheit.gs_sicherheitsbetrag = 0
|
||||||
|
newSicherheit.gs_art = "OPEN"
|
||||||
|
newSicherheit.gs_saldo = saldo
|
||||||
|
newSicherheit.gs_avisoId = urspringsSicherheit.gs_avisoId
|
||||||
|
newSicherheit.gs_warenort = urspringsSicherheit.gs_warenort
|
||||||
|
newSicherheit.gs_posSubNr = 1
|
||||||
|
|
||||||
|
|
||||||
|
Dim gsid = newSicherheit.SAVEOBJECT()
|
||||||
|
|
||||||
|
Dim CLOSED_DUMMY = New cGesamtsicherheitsPositionen(gsid, laufnummer)
|
||||||
|
|
||||||
|
|
||||||
|
With CLOSED_DUMMY
|
||||||
|
.gsp_gsNr = urspringsSicherheit.gs_gsNr
|
||||||
|
.gsp_warenwert = 0 ' = 0 wichtig
|
||||||
|
.gsp_sicherheitsbetrag = 0 ' = 0 wichtig
|
||||||
|
.gsp_filialenNr = filiale
|
||||||
|
.gsp_art = "CLOSE"
|
||||||
|
.gsp_abfertigungsNr = abfertigungsnummer
|
||||||
|
.gsp_erstellungsdatum = DateTime.Now
|
||||||
|
.gsp_ust = ""
|
||||||
|
.gsp_freitext = "DAKOSY-IMP-DY"
|
||||||
|
.gsp_avisoId = urspringsSicherheit.gs_avisoId
|
||||||
|
.gsp_gsNr = urspringsSicherheit.gs_gsNr
|
||||||
|
.gsp_systemuser = "DAKOSY-AUTO"
|
||||||
|
End With
|
||||||
|
|
||||||
|
CLOSED_DUMMY.SAVE()
|
||||||
|
|
||||||
|
|
||||||
|
'pro gestellungsposition bekommen wir eine SumAVerwahrungsinfo -> daher sind die Positionen innerhalb dieser info irrelevant (vorerst).
|
||||||
|
|
||||||
|
If posGestellung.Rows.Count > 1 Then
|
||||||
|
If True Then
|
||||||
|
For i As Integer = 2 To posGestellung.Rows.Count
|
||||||
|
Dim OPEN_DUMMY_SUBPOS As New cSicherheiten()
|
||||||
|
With OPEN_DUMMY_SUBPOS
|
||||||
|
.gs_systemuser = "DAKOSY-AUTO"
|
||||||
|
.gs_VeralteteWeitereRegistriernummer = VeralteteWeitereRegistriernummer 'wichtig für Zuweisung DAKOSY
|
||||||
|
.gs_gsNr = urspringsSicherheit.gs_gsNr
|
||||||
|
.gs_ATBNr = urspringsSicherheit.gs_ATBNr
|
||||||
|
.gs_freitext = posGestellung.Rows(i - 1).Item("AnzPackst") & " " & posGestellung.Rows(i - 1).Item("PackstArt")
|
||||||
|
.gs_MRNNr = RegistriernummerATLAS
|
||||||
|
.gs_standort = urspringsSicherheit.gs_standort
|
||||||
|
.gs_datum = urspringsSicherheit.gs_datum 'VWI.EinzelSumAVerwahrungsinfo.ObjektIdentifizierung.ZeitpunktNachrichteneingang
|
||||||
|
.gs_erstellungsdatum = Now()
|
||||||
|
.gs_posNr = laufnummer + i - 1
|
||||||
|
.gs_abfertigungsnr = abfertigungsnummer
|
||||||
|
.gs_filialenNr = filiale
|
||||||
|
.gs_LKWKZ = urspringsSicherheit.gs_LKWKZ
|
||||||
|
.gs_zollsatz = urspringsSicherheit.gs_zollsatz
|
||||||
|
.gs_warenwert = 0
|
||||||
|
.gs_sicherheitsbetrag = 0
|
||||||
|
.gs_art = "OPEN"
|
||||||
|
.gs_saldo = saldo
|
||||||
|
.gs_avisoId = urspringsSicherheit.gs_avisoId
|
||||||
|
.gs_warenort = urspringsSicherheit.gs_warenort
|
||||||
|
'.gs_posSubNr = i
|
||||||
|
|
||||||
|
End With
|
||||||
|
|
||||||
|
Dim gsid_SupPos = OPEN_DUMMY_SUBPOS.SAVEOBJECT()
|
||||||
|
|
||||||
|
Dim CLOSED_DUMMY_SUBPOS = New cGesamtsicherheitsPositionen()
|
||||||
|
|
||||||
|
With CLOSED_DUMMY_SUBPOS
|
||||||
|
.gsp_gspPosId = OPEN_DUMMY_SUBPOS.gs_posNr
|
||||||
|
.gsp_gsId = gsid_SupPos
|
||||||
|
.gsp_gsNr = urspringsSicherheit.gs_gsNr
|
||||||
|
.gsp_warenwert = 0 ' = 0 wichtig
|
||||||
|
.gsp_sicherheitsbetrag = 0 ' = 0 wichtig
|
||||||
|
.gsp_filialenNr = filiale
|
||||||
|
.gsp_art = "CLOSE"
|
||||||
|
.gsp_abfertigungsNr = abfertigungsnummer
|
||||||
|
.gsp_erstellungsdatum = DateTime.Now
|
||||||
|
.gsp_ust = ""
|
||||||
|
.gsp_freitext = "DAKOSY-IMP-DY"
|
||||||
|
.gsp_avisoId = urspringsSicherheit.gs_avisoId
|
||||||
|
.gsp_gsNr = urspringsSicherheit.gs_gsNr
|
||||||
|
.gsp_systemuser = "DAKOSY-AUTO"
|
||||||
|
End With
|
||||||
|
|
||||||
|
CLOSED_DUMMY_SUBPOS.SAVE()
|
||||||
|
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
|
Return True
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
|
Return False
|
||||||
|
|
||||||
|
Finally
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Shared Sub saveVerwahrungsAusgang(regNR As String, posErledigung As DataTable, veralteteregNR As String, EZA As DAKOSY_Worker.SumAErledigungsinformationVorpapier_005.SumAErledigungsinformationVorpapierSIVRPTyp)
|
||||||
|
|
||||||
|
If posErledigung IsNot Nothing AndAlso posErledigung.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
If regNR <> "" AndAlso veralteteregNR <> "" Then
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||||
|
|
||||||
|
|
||||||
|
For Each POS As DataRow In posErledigung.Rows
|
||||||
|
|
||||||
|
Dim MRNNR As String = ""
|
||||||
|
Dim existingEntryID As Integer = 0
|
||||||
|
|
||||||
|
|
||||||
|
If Not IsDBNull(POS("IDRegNrSumA")) AndAlso POS("IDRegNrSumA").ToString <> "" Then
|
||||||
|
|
||||||
|
Dim POSNr As Integer = If(IsDBNull(POS("IDRegNrSumAPos")), 0, CInt(POS("IDRegNrSumAPos")))
|
||||||
|
|
||||||
|
If MRNNR <> POS.Item("IDRegNrSumA") Then
|
||||||
|
MRNNR = POS.Item("IDRegNrSumA")
|
||||||
|
|
||||||
|
Dim firmaID = -1
|
||||||
|
|
||||||
|
Dim dtGesamtsicherheit = SQL.loadDgvBySql("Select * From [tblGesamtsicherheit] as gs left join tblGesamtsicherheitsPositionen as pos on pos.gsp_gsnr = gs.gs_gsnr where [gs_VeralteteWeitereRegistriernummer] = '" & MRNNR & "' order by gsp_gspPosId", "AVISO")
|
||||||
|
|
||||||
|
If dtGesamtsicherheit.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Try
|
||||||
|
|
||||||
|
Dim gs_row As DataRow = dtGesamtsicherheit.Rows(0)
|
||||||
|
|
||||||
|
Dim rows = dtGesamtsicherheit.Select("gsp_gspPosId = " & gs_row("gs_posNr") & " AND gsp_MRNNr IS NOT NULL")
|
||||||
|
|
||||||
|
If rows.Length > 0 Then
|
||||||
|
Exit Sub 'bereits vorhanden
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cGesamtsicherheitsReferenz(gs_row("gs_standort"))
|
||||||
|
Dim saldo As Double = GesSichRef.CalcSaldo()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim Warenwert As Double = 0
|
||||||
|
Dim Sicherheitsbetrag As Double = 0
|
||||||
|
|
||||||
|
'Berechnung Warenwert und Sicherheitsbetrag aus Sendung
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
|
Dim dtVorpapiere As DataTable = SQL.loadDgvBySql("SELECT tblSnd_Warenwert,tblSnd_WarenwertWaehrung,tblSnd_Vorpapier_Pos,tblSnd_Vorpapier2_Pos, tblSnd_Vorpapier3_Pos from tblSendungen where tblSnd_Vorpapier = '" & gs_row("gs_ATBNr") & "' Or tblSnd_Vorpapier2 = '" & gs_row("gs_ATBNr") & "' OR tblSnd_Vorpapier3 = '" & gs_row("gs_ATBNr") & "'", "AVISO")
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||||
|
If dtVorpapiere.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
Dim rowsVorp = dtVorpapiere.Select("tblSnd_Warenwert is not null AND (tblSnd_Vorpapier_Pos = '" & gs_row.Item("gs_posNr") & "' or tblSnd_Vorpapier2_Pos = '" & gs_row.Item("gs_posNr") & "' or tblSnd_Vorpapier3_Pos = '" & gs_row.Item("gs_posNr") & "')")
|
||||||
|
|
||||||
|
Dim row = rowsVorp(0)
|
||||||
|
Warenwert = CDbl(row("tblSnd_Warenwert"))
|
||||||
|
Sicherheitsbetrag = Math.Round(Warenwert * (GesSichRef.gsr_zollsatz / 100))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'Dim dtSendungen = SQL.loadDgvBySql("SELECT")
|
||||||
|
Dim anzahlPackstuecke As Integer = -1
|
||||||
|
Dim AnzahlStückErledigt As Integer = If(IsDBNull(POS("StueckzahlErledigte")), 0, CInt(POS("StueckzahlErledigte")))
|
||||||
|
Dim AnzahlStückStorniert As Integer = If(IsDBNull(POS("StueckzahlErledigte")), 0, CInt(POS("StueckzahlErledigte")))
|
||||||
|
If gs_row.Item("gs_freitext") <> "" Then
|
||||||
|
anzahlPackstuecke = CInt(System.Text.RegularExpressions.Regex.Match(gs_row.Item("gs_freitext"), "\d+").Value)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If anzahlPackstuecke > 0 AndAlso anzahlPackstuecke <> AnzahlStückErledigt Then 'Hinweismeldung, wenn nicht alle erledigt wurden!
|
||||||
|
'verwahrung@verag.ag
|
||||||
|
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail("verwahrung@verag.ag", IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & "Erledigungsmeldung-DAKOSY fehlende Positionen - " & Now().ToShortDateString, "Bei " & MRNNR & "/" & regNR & " wurden nur " & AnzahlStückErledigt & " von " & gs_row.Item("gs_freitext") & " erledigt" & vbNewLine & "*Automatic generated e-mail*",,,,, "d.breimaier@verag.ag")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim SicherheitsPos As New cGesamtsicherheitsPositionen()
|
||||||
|
With SicherheitsPos
|
||||||
|
.gsp_gsId = gs_row("gs_gsId")
|
||||||
|
'.gsp_gspPosId = CInt(POSNr)
|
||||||
|
.gsp_gspPosId = gs_row.Item("gs_posNr")
|
||||||
|
.gsp_warenwert = Warenwert
|
||||||
|
.gsp_sicherheitsbetrag = Sicherheitsbetrag
|
||||||
|
.gsp_freitext = "DASKOY-IMPORT"
|
||||||
|
.gsp_filialenNr = gs_row("gs_filialenNr")
|
||||||
|
.gsp_art = "CLOSE"
|
||||||
|
.gsp_gsNr = gs_row("gs_gsnr")
|
||||||
|
.gsp_abfertigungsNr = gs_row("gs_abfertigungsnr")
|
||||||
|
.gsp_datum = EZA.EinzelSumAErledigungsinformation.ObjektIdentifizierung.ZeitpunktNachrichteneingang
|
||||||
|
.gsp_erstellungsdatum = DateTime.Now
|
||||||
|
.gsp_ust = gs_row("gs_ust")
|
||||||
|
.gsp_ATCNr = veralteteregNR
|
||||||
|
.gsp_MRNNr = regNR
|
||||||
|
.gsp_avisoId = gs_row("gs_avisoID")
|
||||||
|
.gsp_systemuser = "DAKOSY-AUTO"
|
||||||
|
End With
|
||||||
|
|
||||||
|
|
||||||
|
SicherheitsPos.SAVE()
|
||||||
|
GesSichRef.CalcSaldo()
|
||||||
|
'VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
'VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
|
|
||||||
|
Finally
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Function AddNewGesamtSichNr() As Integer
|
||||||
|
Dim sqlq As String = "select MAX([gs_gsNr]) as MaxGesSich from tblGesamtsicherheit"
|
||||||
|
Dim dt As New DataTable
|
||||||
|
dt = SQL.loadDgvBySql(sqlq, "AVISO", 100, True)
|
||||||
|
Dim LetzteGesSichNum As Integer = -1
|
||||||
|
If (dt.Rows(0).Item(0) IsNot DBNull.Value) Then
|
||||||
|
|
||||||
|
LetzteGesSichNum = dt.Rows(0).Item(0)
|
||||||
|
Return LetzteGesSichNum + 1
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return 0
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -427,6 +427,14 @@ Public Class frmDYNachrichtenVerarbeitung
|
|||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'VW: SumABekanntgabeMassnahme
|
||||||
|
If Not found And cGetMsgType.isNCTS_SumABekanntgabeMassnahme(doc, VERSION) Then
|
||||||
|
Select Case VERSION
|
||||||
|
Case False
|
||||||
|
Case Else : If cWorker_Verwahrung.readNCTS_SumAMassnahmenbekanntgabe(Me, d, saveVerwahrung) <> "" Then found = True
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
'------------------------------------------
|
'------------------------------------------
|
||||||
'------------------ EXPORT / Gestellung (AES) ------------------
|
'------------------ EXPORT / Gestellung (AES) ------------------
|
||||||
|
|||||||
@@ -2964,6 +2964,7 @@ Public Class frmStartOptions
|
|||||||
Me.Visible = False
|
Me.Visible = False
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||||
Dim f As New frmDYNachrichtenVerarbeitung
|
Dim f As New frmDYNachrichtenVerarbeitung
|
||||||
|
f.saveVerwahrung = cbxGestellungspeichern.Checked
|
||||||
f.ShowDialog()
|
f.ShowDialog()
|
||||||
Me.Visible = True
|
Me.Visible = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user